面向可信性的上下文工程:混合与不当上下文下的Rescorla-Wagner引导方法
Context Engineering for Trustworthiness: Rescorla Wagner Steering Under Mixed and Inappropriate Contexts
AI总结:
本研究针对混合不当内容的上下文会降低大语言模型回复质量的问题,基于Rescorla-Wagner模型揭示其易受低占比不当信息影响的特性,提出两阶段微调的RW-Steering方法,实现跨不当内容比例的强泛化,显著提升LLM安全性与回复质量。
摘要:
引入外部上下文可显著提升大语言模型(LLM)的回复质量,但现实场景中的上下文往往混合了相关信息与占比失衡的不当内容,带来可靠性风险。LLM如何处理混合上下文并确定信息优先级?为研究该问题,我们提出Poisoned Context Testbed(投毒上下文测试基准),将查询与包含相关及不当内容的现实上下文配对。受动物联想学习机制启发,我们改编了神经科学领域的Rescorla-Wagner(RW)模型,用以量化相互竞争的上下文信号对LLM输出的影响。经调整的模型揭示出一致的行为模式:LLM强烈倾向于整合上下文中占比较低的信息。这种易感性在现实场景中危害极大,少量不当内容就会大幅降低回复质量,我们在测试基准上的实证评估进一步证实了这一脆弱性。为解决该问题,我们提出RW-Steering(RW引导),这是一种基于两阶段微调的方法,可让模型在内部识别并忽略不当信号。与依赖多样上下文混合体下大量监督的现有方法不同,RW-Steering在不同比例的不当内容场景下均具备强泛化能力。实验表明,我们表现最佳的微调模型将回复质量提升了39.8%,扭转了不良行为曲线,证明RW-Steering是一种鲁棒、可泛化的上下文工程方案,可提升现实应用中LLM的安全性。
英文摘要:
Incorporating external context can significantly enhance the response quality of Large Language Models (LLMs). However, real-world contexts often mix relevant information with disproportionate inappropriate content, posing reliability risks. How do LLMs process and prioritize mixed context? To study this, we introduce the Poisoned Context Testbed, pairing queries with real-world contexts containing relevant and inappropriate content. Inspired by associative learning in animals, we adapt the Rescorla-Wagner (RW) model from neuroscience to quantify how competing contextual signals influence LLM outputs. Our adapted model reveals a consistent behavioral pattern: LLMs exhibit a strong tendency to incorporate information that is less prevalent in the context. This susceptibility is harmful in real-world settings, where small amounts of inappropriate content can substantially degrade response quality. Empirical evaluations on our testbed further confirm this vulnerability. To tackle this, we introduce RW-Steering, a two-stage finetuning-based approach that enables the model to internally identify and ignore inappropriate signals. Unlike prior methods that rely on extensive supervision across diverse context mixtures, RW-Steering generalizes robustly across varying proportions of inappropriate content. Experiments show that our best fine-tuned model improves response quality by 39.8% and reverses the undesirable behavior curve, establishing RW-Steering as a robust, generalizable context engineering solution for improving LLM safety in real-world use.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。