View a PDF of the paper titled Controllable Context Sensitivity and the Knob Behind It, by Julian Minder and six other authors
Abstract: 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 that 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.
Submission History
From: Julian Minder [view email]
[v1] Mon, 11 Nov 2024 22:22:21 UTC (4,236 KB)
[v2] Mon, 3 Mar 2025 03:02:55 UTC (10,174 KB)
[v3] Tue, 27 May 2025 21:44:35 UTC (10,289 KB)
[v4] Fri, 30 May 2025 15:21:51 UTC (3,380 KB)
### Exploring Controllable Context Sensitivity in Language Models
Language models, such as the ones fine-tuned in the paper “Controllable Context Sensitivity and the Knob Behind It,” venture into a fascinating realm where they must balance reliance on context versus prior knowledge. This balance is crucial for achieving higher accuracy in tasks like retrieval-augmented generation and question-answering. Understanding how language models make this trade-off is essential to enhancing their effectiveness.
#### The Role of Context in Language Models
Context serves as a crucial component in determining how language models generate responses. When presented with information like “Paris is in England,” the model’s ability to discern context from its general knowledge can significantly affect the accuracy of its answers. The task outlined in the paper serves to explore this very capability: it pits the context against prior knowledge, illustrating the model’s decision-making process. By asking a question like “Where is Paris?” and directing the model to choose between deriving its answer from context or prior knowledge, researchers can measure performance accurately.
#### Defining the Sensitivity Knob
This research seeks to identify a mechanism—termed as a ‘knob’—that allows for the adjustment of context sensitivity within language models. By implementing a fine-tuned model that can achieve accuracy rates ranging from 85% to 95%, the authors demonstrate that they can manipulate the model’s responses depending on the desired outcome. Interestingly, this knob is not just limited to fine-tuned models; it can also be utilized effectively in non-fine-tuned instruction and base models, showcasing its versatility and importance in model design.
#### Methodology and Findings
The authors devised a specialized task to gauge controllable context sensitivity best. After analyzing high-performing models—such as Llama-3.1, Mistral-v0.3, and Gemma-2—the study employed a novel linear-time algorithm that pinpoints which layers within these models are crucial for context sensitivity.
By isolating a one-dimensional subspace in a specific layer, the researchers were able to reveal how these models separate context-agreeing answers from those that ignore context. Remarkably, this subspace serves as a control mechanism across different iterations of models, indicating that understanding a single encoding can lead to broader insights about model behavior.
#### Correlation Between Performance and Sensitivity
The findings underscore a compelling correlation between the model’s performance and its distinct ability to separate context-bound answers from those based on general knowledge. As the research further uncovers the nuances of this relationship, it hints at a simple yet powerful mechanism that could streamline how future models approach context sensitivity.
### Implications for Future Research
As the field of artificial intelligence continues to advance, the implications of this research extend far beyond just language modeling. By understanding and controlling context sensitivity, developers and researchers can create more accurate and responsive AI models capable of nuanced comprehension and interaction. This research not only provides a foundation for improving existing models but also lays the groundwork for future explorations into how language models can navigate the balance between contextual awareness and generalized knowledge.
Through continued investigation and refinement of these mechanisms, we can expect to see significant enhancements in the effectiveness of language models, particularly in areas like natural language understanding and generation.
Inspired by: Source

