通过提前退出机制,让大模型在有害上下文时自动止损,同时提升有益上下文的效率。
Controlling the Risk of Corrupted Contexts for Language Models via Early-Exiting
- 基于零样本表现设定安全基准,用动态提前退出过滤有害输入注意力
- 9项任务实验证明:有害上下文风险可控,有益上下文效率提升30%以上
- 适合追求模型鲁棒性与推理效率平衡的研究者和应用开发者
大型语言模型可能受有害或无关上下文影响,显著降低下游任务性能。为此,我们提出一种新方法,限制有害上下文对模型性能的损害。首先定义无上下文时的零样本表现作为安全基准;接着采用分布无关风险控制(DFRC),确保用户提供的上下文不会使性能低于该基准。通过动态提前退出机制,忽略对不安全输入关注最多的后续注意力头来实现此目标。最后,我们改进了DFRC,使其既能控制有害输入的风险,又能利用有益输入带来的性能和效率增益。在涵盖上下文学习与开放式问答的9个任务上,理论与实验结果表明,该方法有效控制了有害上下文的风险,并在有益上下文场景下实现了显著的计算效率提升。
原文摘要 · Abstract (English)
Large language models (LLMs) can be influenced by harmful or irrelevant context, which can significantly harm model performance on downstream tasks. This motivates principled designs in which LLM systems include built-in mechanisms to guard against such "garbage in, garbage out" scenarios. We propose a novel approach to limit the degree to which harmful context can degrade model performance. First, we define a baseline "safe" behavior for the model -- the model's performance given no context at all (zero-shot). Next, we apply distribution-free risk control (DFRC) to control the extent to which the user-provided context can decay performance below this safe zero-shot baseline. We achieve this by leveraging dynamic early exit prediction, ignoring later attention heads that attend the most to the unsafe inputs. Finally, we propose modifications to DFRC that allow it to both control risk for harmful inputs \textit{and} leverage performance and efficiency gains on helpful inputs. We present both theoretical and empirical results across 9 tasks spanning in-context learning and open-ended question answering, showing that our approach can effectively control risk for harmful context and simultaneously achieve substantial computational efficiency gains with helpful context.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。