arXiv:2411.07404cs.CLcs.AI2024-11ICLR被引 24

发现控制语言模型依赖上下文或先验知识的单一调控开关。

Controllable Context Sensitivity and the Knob Behind It

  • 设计可控制上下文敏感性的任务,通过指令微调让模型准确区分上下文与先验知识。
  • 在多个模型中定位到单层中的1维子空间,该空间决定模型是听从上下文还是先验。
  • 该子空间不仅适用于微调模型,也适用于原始模型,揭示统一机制。

语言模型在预测时需权衡依赖上下文与先验知识的程度。本文旨在寻找控制这种敏感性的调节开关。为此,设计了一项可控上下文敏感性任务:给模型输入错误上下文(巴黎在英格兰)和问题(巴黎在哪?),并指令其基于上下文或先验知识回答。微调后的Llama-3.1、Mistral-v0.3和Gemma-2在该任务上达到85%-95%准确率。通过新提出的线性时间算法分析,发现特定层中存在一个1维子空间,编码模型选择上下文或先验的决策。有趣的是,该子空间在微调模型中被激活后,同样适用于同系列的非微调指令与基础模型。进一步发现,模型性能与该子空间中对齐上下文与忽略上下文答案的分离度强相关。结果表明,一个单一子空间可能构成模型选择上下文或先验的底层机制。

原文摘要 · Abstract (English)

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.

语言模型上下文敏感可调控性机制分析

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。