ToRA:本地 LLM 近乎免费的流式安全检查,一次解码跑两个模型
Run One, Get Two: Near-Free Streaming Safety Checks for Local LLMs
AI 导读
arXiv 论文提出 ToRA,一种适配器方法,让第二个模型作为生成器解码步骤中的额外行运行,共享权重和 KV cache,为本地 LLM 提供近乎免费的流式安全检查。在 Qwen3-0.6B 上,ToRA 匹配或超越专用流式 guard,在 17 个基准中的 12 个上 F1 更高,检测不安全响应比 hidden-state probe 多 11.8 个点,每 token 额外延迟低于 4%。
正文 · 原文
Abstract:Local LLM assistants decode for one user at a time, so decoding is bound by memory bandwidth and leaves compute idle. Streaming safety checks today trade accuracy against cost. A dedicated guard model is accurate but nearly doubles the latency per token, while a hidden-state probe is cheap but less accurate. We present ToRA, an adapter that runs a second model as an extra row in the generator's decode step, sharing its weights and KV cache. Dual-row kernels read each weight once for both rows. On Qwen3-0.6B, ToRA matches or beats a dedicated streaming guard, with higher F1 on 12 of 17 benchmarks. It detects 11.8 points more unsafe responses than the probe at a similar cost, under 4% added latency per token.
| Subjects: | Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Machine Learning (cs.LG); Performance (cs.PF) |
| MSC classes: | 68T50 |
| ACM classes: | I.2.7; I.2.6; C.4 |
| Cite as: | arXiv:2611.26975 [cs.AI] |
| (or arXiv:2611.26975v1 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2611.26975 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Soheil Zibakhsh Shabgahi [view email]
[v1]
Fri, 20 Nov 2026 01:53:11 UTC (125 KB)
来源:arXiv cs.AI · arxiv.org