All posts
AI SafetyNovember 23, 20264 min read

Run One, Get Two: ToRA Makes Streaming Safety Checks Nearly Free on Local LLMs

A new adapter called ToRA runs a full safety monitor as a hidden "extra row" inside a local LLM's decode step - sharing weights and KV cache - matching dedicated guard accuracy while adding under 4% latency per token.

Running safety checks on a local LLM has always felt like choosing between two bad options: accuracy or speed. A dedicated guard model is thorough but nearly doubles per-token latency; a lightweight probe on hidden states is cheap but misses too much. A new paper from UC San Diego, "Run One, Get Two: Near-Free Streaming Safety Checks for Local LLMs", proposes a third path that escapes the trade-off almost entirely - and the trick is elegant enough to fit in a single insight about how memory-bandwidth-bound decoding actually works. 1

The Problem: Idle GPU Compute During Local Decoding

When a local LLM assistant decodes for a single user, every step is dominated by streaming the model's weights from GPU memory, not by arithmetic. That means the GPU's compute units are mostly sitting idle while weights pour in. 1 Today's streaming safety approaches either (a) run a separate guard model in parallel - accurate, but it doubles memory traffic and latency - or (b) attach a lightweight probe to the generator's hidden states - fast, but noticeably less accurate. 2

The root cause is that both approaches pay for weight access twice: once for generation, once for the safety check. The UC San Diego team asked a simple question: what if the safety checker didn't need its own weight access at all?

Introducing ToRA: Safety as an Extra Decode Row

The answer is ToRA (Tandem of low-Rank Adapters). Instead of running a second model alongside the generator, ToRA attaches low-rank adapters that execute as an extra row in the generator's existing decode step, sharing the same weight accesses and KV cache. 13

Rather than running an independent guard model, ToRA adapts the generator's upper K transformer layers using low-rank adapters (LoRA) and a lightweight classification head. 3 The verifier path branches from the generator at the first adapted feed-forward layer, reusing all preceding computations. 3

The key implementation detail is a set of dual-row Triton GPU kernels that fuse generation and verification into a single memory pass. 2 Custom dual-row Triton kernels apply the adapter inside the weight pass, keeping the verifier's added memory traffic below 1% of the generator's. 3 The result is that you get safety classification essentially for the cost of a probe, but with the accuracy of a full guard model.

ToRA produces two predictions per token: one for prompt-level harm (evaluated at the final prompt token) and one for response-level harm (evaluated at the final response token). 4 Training uses a single frozen generator pass per sequence, so the adapter is efficient to fit as well as to run. 1

Benchmark Results: Matching Guards at Probe Cost

The numbers hold up under scrutiny. Tested on Qwen3-0.6B running on a single RTX A6000 GPU at batch size 1:

  • ToRA achieves higher F1 than the dedicated Qwen3Guard-Stream on 12 of 17 safety benchmarks 4
  • It detects 11.8 percentage points more unsafe responses than SingProbe at a comparable cost 5
  • Latency overhead is under 4% per token over running the generator alone 5

For streaming unsafe-response detection specifically - where the goal is to interrupt harmful output mid-stream - ToRA catches 83.6% of unsafe responses at a 5% false-alarm budget, compared to 84.7% for Qwen3Guard-Stream and just 71.8% for the hidden-state probe. 6 In other words, ToRA nearly matches the best-in-class dedicated guard while costing almost nothing extra.

The evaluation covers 17 safety benchmarks, with two output heads handling prompt harm and response harm respectively. 4

Why This Matters for On-Device AI

The engineering context here is important. As local LLMs get smaller and faster, they're increasingly deployed in contexts where a cloud-based moderation API is either too slow, too expensive, or simply unavailable - think edge devices, enterprise air-gapped deployments, or privacy-sensitive consumer applications. In all of these settings, the memory-bandwidth constraint ToRA exploits is real and persistent. 2

The existing trade-off - pay double for accuracy, or sacrifice accuracy for speed - has been a genuine blocker for anyone trying to build responsibly deployed local AI assistants. ToRA dissolves that trade-off by recognizing that the cost of a decode step is dominated by weight access, and that sharing those accesses between generation and safety classification is architecturally straightforward once you write the right GPU kernels.

The code is open-sourced on GitHub, and the paper was submitted to arXiv on November 20, 2026. 3

Why It Matters

ToRA is a small paper with a large practical implication: you no longer have to choose between a safe local LLM and a fast one. The technique is model-agnostic in principle, relies on well-understood low-rank adapter training, and the custom Triton kernels are openly available. As on-device AI proliferates across consumer hardware and sensitive enterprise contexts, the ability to monitor every generated token for harm - in real time, without meaningful overhead - shifts from a nice-to-have to a baseline expectation. ToRA makes that baseline achievable.

This article was researched and drafted by an AI writer agent (claude-sonnet-4-6) and reviewed by an editor agent before publishing.

Ask about Julian Walder

Grounded in his real work

Hi! I'm Julian Walder's assistant. Ask me anything about his work, projects, or background in AI.