arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.15365cs.AIcs.LG
收藏

TRACE:用于更安全语言生成的时间风险评估与概念编辑

TRACE: Temporal Risk Assessment and Concept Editing for Safer Language Generation

University of Calgary(卡尔加里大学);Dalhousie University(达尔豪斯大学);Mila - Quebec AI Institute(米拉-魁北克人工智能研究所)

Ankur Garg, Xuemin Yu, Hassan Sajjad, Samira Ebrahimi Kahou

AI总结:

TRACE是一种用于更安全语言生成的框架,通过跟踪生成过程中的有害风险、选择性编辑令牌激活并提供可审计记录,在提升流F1值的同时降低了攻击成功率。

摘要:

大型语言模型(LLMs)在生成响应时可能产生有害内容。一个实用的安全防护措施不仅应在生成过程中检测此类风险,还需进行干预,同时尽可能保留安全响应不变,并提供支持其决策的内部模式的可审计记录。我们提出TRACE(Temporal Risk Assessment and Concept Editing,时间风险评估与概念编辑),这一框架可在生成过程中跟踪有害响应风险,选择性编辑令牌激活,并提供其检测和引导决策的可审计跟踪记录。TRACE学习一个由重复激活模式构成的码本,每个码本向量代表一个潜在概念。在推理时,它将每个令牌激活分配给最近的码本向量以获取对应概念。门控循环单元(GRU)处理这些激活及其分配的概念特征,以预测完整响应的有害性和单调累积流风险。在引导过程中,分配给有害概念的激活会沿附近良性目标定义的方向进行引导。外部LLMs事后对学习到的概念进行标注,使检测序列和有害到良性的编辑记录具有可解释性。在三个生成器以及WildGuard和S-Eval基准上的实验表明,TRACE在六次比较中有五次的流F1值优于Kelp,同时在完整响应检测上保持竞争力。TRACE的选择性引导降低了Harmbench攻击成功率,而对原本安全响应的弃权(不执行)几乎没有变化。事后审计揭示了学习到的概念中的重复语义结构,以及与有害检测、安全生成和激活编辑相关的不同跟踪记录。

英文摘要:

Large language models (LLMs) can produce harmful content while generating a response. A useful safeguard should not only detect this risk during generation but also intervene while leaving safe responses largely unchanged and provide an auditable record of the internal patterns supporting its decisions. We propose TRACE (Temporal Risk Assessment and Concept Editing), a framework that tracks harmful-response risk during generation, selectively edits token activations, and leaves an auditable trace of its detection and steering decisions. TRACE learns a codebook of recurring activation patterns, with each codebook vector representing a latent concept. At inference time, it assigns each token activation to the nearest codebook vector to obtain the corresponding concept. A gated recurrent unit (GRU) processes the activations and their assigned concept features to predict completed-response harmfulness and a monotone cumulative streaming risk. During steering, activations assigned to harmful concepts are steered along directions defined by nearby benign targets. An external LLM labels the learned concepts post hoc, making detection sequences and harmful-to-benign edit records interpretable. Experiments across three generators and the WildGuard and S-Eval benchmarks show that TRACE improves streaming F1 over Kelp in five of six comparisons while remaining competitive on completed-response detection. TRACE's selective steering reduces Harmbench attack success with little change in refusal on originally safe responses. The post-hoc audit reveals recurring semantic structure in the learned concepts and distinct traces associated with harmful detection, safe generation, and activation edits.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑