arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.07404cs.CLcs.AI
收藏

可控的上下文敏感性及其背后的旋钮

Controllable Context Sensitivity and the Knob Behind It

ETH Zürich(苏黎世联邦理工学院);EPFL(苏黎世联邦理工学院);Cornell University(康奈尔大学)

Julian Minder, Kevin Du, Niklas Stoehr, Giovanni Monea, Chris Wendler, Robert West, Ryan Cotterell

AI总结:

本文研究语言模型在上下文与先验知识间的权衡,设计可控上下文敏感性任务,通过微调模型识别出单层一维子空间作为控制旋钮,并验证其在同家族非微调模型中的有效性及与性能的强相关性。

摘要:

在进行预测时,语言模型必须权衡其依赖上下文与依赖先验知识的程度。选择模型对其上下文的敏感度是一项基本功能,因为这使得模型能够在检索增强生成和问答等任务中表现出色。在本文中,我们寻找一个控制这种敏感性的旋钮,以决定语言模型是根据上下文还是其先验知识来回答问题。为了指导这一搜索,我们设计了一项用于可控上下文敏感性的任务。在该任务中,我们首先向模型输入一个上下文(Paris is in England)和一个问题(Where is Paris?);然后我们指示模型使用其先验知识或上下文知识,并评估它是否针对这两种意图都生成了正确的答案(即France或England)。在此任务上进行微调后,Llama-3.1、Mistral-v0.3和Gemma-2的指令微调版本能够以高准确率(85-95%)解决该问题。通过分析这些高性能模型,我们使用一种新颖的线性时间算法缩小了可能对上下文敏感性至关重要的层的范围。随后,在每个模型中,我们在单个层内识别出了一个一维子空间,该子空间编码了模型是遵循上下文还是先验知识。有趣的是,尽管我们是在微调模型中识别出该子空间的,但我们发现完全相同的子空间不仅在该模型中,而且在该模型家族的非微调指令模型和基础模型中,都能作为有效的旋钮发挥作用。最后,我们展示了模型性能与其在该子空间中区分遵循上下文与忽略上下文答案的清晰程度之间存在强相关性。这些结果表明,单个子空间促进了模型在上下文与先验知识之间做出选择,暗示着存在一种控制该行为的简单基本机制。

英文摘要:

When making predictions, a language model must trade off how much it relies on its context vs. its prior knowledge. Choosing how sensitive the model is to its context is a fundamental functionality, as it enables the model to excel at tasks like retrieval-augmented generation and question-answering. In this paper, we search for a knob which controls this sensitivity, determining whether language models answer from the context or their prior knowledge. To guide this search, we design a task for controllable context sensitivity. In this task, we first feed the model a context (Paris is in England) and a question (Where is Paris?); we then instruct the model to either use its prior or contextual knowledge and evaluate whether it generates the correct answer for both intents (either France or England). When fine-tuned on this task, instruction-tuned versions of Llama-3.1, Mistral-v0.3, and Gemma-2 can solve it with high accuracy (85-95%). Analyzing these high-performing models, we narrow down which layers may be important to context sensitivity using a novel linear time algorithm. Then, in each model, we identify a 1-D subspace in a single layer that encodes whether the model follows context or prior knowledge. Interestingly, while we identify this subspace in a fine-tuned model, we find that the exact same subspace serves as an effective knob in not only that model but also non-fine-tuned instruct and base models of that model family. Finally, we show a strong correlation between a model's performance and how distinctly it separates context-agreeing from context-ignoring answers in this subspace. These results suggest a single subspace facilitates how the model chooses between context and prior knowledge, hinting at a simple fundamental mechanism that controls this behavior.

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

↑