TRACE 回溯未来:一种面向可控语言生成的概率推理方法
TRACE Back from the Future: A Probabilistic Reasoning Approach to Controllable Language Generation
AI总结:
针对自回归 LM 难以前瞻控制全局属性的问题,本文提出 TRACE,通过蒸馏 HMM 与小型分类器精确计算 EAP 并重加权 token 概率,以低开销实现去毒化、低资源个性化和复合属性控制。
摘要:
随着大型语言模型(LM)的发展,人们越来越需要控制其输出,以符合人类价值观(例如去毒化)或期望属性(例如个性化、主题)。然而,自回归模型专注于下一 token 预测,难以处理需要向前看的全局属性。现有解决方案要么针对每个新属性对 LM 进行后训练——成本高昂且缺乏灵活性——要么通过采样或训练来近似未来序列的期望属性概率(Expected Attribute Probability,EAP),这对于稀有属性而言既缓慢又不可靠。我们提出 TRACE(Tractable Probabilistic Reasoning for Adaptable Controllable gEneration,用于自适应可控生成的可处理概率推理),这是一个新颖框架,可通过可处理概率推理和轻量级控制高效计算 EAP 并适应新属性。TRACE 从 LM 中蒸馏出一个隐马尔可夫模型(Hidden Markov Model,HMM),并将其与一个小型分类器配对以估计属性概率,从而能够在 HMM 预测的未来上精确计算 EAP。随后,该 EAP 被用于重新加权 LM 的下一 token 概率,以获得全局合规的续写。实验上,TRACE 仅以 20% 的解码开销便取得了最先进的去毒化结果,在数秒内生成 76 个低资源个性化 LM,并无缝扩展到复合属性。我们的代码可在 https://github.com/yidouweng/trace 获取。
英文摘要:
As large language models (LMs) advance, there is an increasing need to control their outputs to align with human values (e.g., detoxification) or desired attributes (e.g., personalization, topic). However, autoregressive models focus on next-token predictions and struggle with global properties that require looking ahead. Existing solutions either post-train LMs for each new attribute--expensive and inflexible--or approximate the Expected Attribute Probability (EAP) of future sequences by sampling or training, which is slow and unreliable for rare attributes. We introduce TRACE (Tractable Probabilistic Reasoning for Adaptable Controllable gEneration), a novel framework that efficiently computes EAP and adapts to new attributes through tractable probabilistic reasoning and lightweight control. TRACE distills a Hidden Markov Model (HMM) from an LM and pairs it with a small classifier to estimate attribute probabilities, enabling exact EAP computation over the HMM's predicted futures. This EAP is then used to reweigh the LM's next-token probabilities for globally compliant continuations. Empirically, TRACE achieves state-of-the-art detoxification results with only 20% decoding overhead, yields 76 low-resource personalized LMs within seconds, and seamlessly extends to composite attributes. Our code is available at: https://github.com/yidouweng/trace.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。