[Paper Review] Large Language Models with Controllable Working Memory
This paper proposes Knowledge-aware Fine-tuning (KAFT), a method to enhance large language models' controllability and robustness by training them to prioritize task-relevant context over memorized world knowledge. KAFT uses counterfactual and irrelevant context augmentations during fine-tuning, significantly improving model behavior on conflicting or distracting inputs without degrading standard performance.
Large language models (LLMs) have led to a series of breakthroughs in natural language processing (NLP), owing to their excellent understanding and generation abilities. Remarkably, what further sets these models apart is the massive amounts of world knowledge they internalize during pretraining. While many downstream applications provide the model with an informational context to aid its performance on the underlying task, how the model's world knowledge interacts with the factual information presented in the context remains under explored. As a desirable behavior, an LLM should give precedence to the context whenever it contains task-relevant information that conflicts with the model's memorized knowledge. This enables model predictions to be grounded in the context, which can then be used to update or correct specific model predictions without frequent retraining. By contrast, when the context is irrelevant to the task, the model should ignore it and fall back on its internal knowledge. In this paper, we undertake a first joint study of the aforementioned two properties, namely controllability and robustness, in the context of LLMs. We demonstrate that state-of-the-art T5 and PaLM (both pretrained and finetuned) could exhibit poor controllability and robustness, which do not scale with increasing model size. As a solution, we propose a novel method - Knowledge Aware FineTuning (KAFT) - to strengthen both controllability and robustness by incorporating counterfactual and irrelevant contexts to standard supervised datasets. Our comprehensive evaluation showcases the utility of KAFT across model architectures and sizes.
Motivation & Objective
- To investigate how large language models (LLMs) handle conflicts between memorized world knowledge and task-specific context.
- To identify that state-of-the-art LLMs like T5 and PaLM exhibit poor controllability and robustness, even at scale.
- To develop a method that enables LLMs to correctly prioritize context when it contradicts internal knowledge, while ignoring irrelevant context.
- To create a fine-tuning approach that strengthens model behavior without degrading performance on standard benchmarks.
Proposed method
- KAFT introduces data augmentation by adding counterfactual contexts (where context contradicts memorized knowledge) and irrelevant contexts (unrelated to the task) to standard supervised datasets.
- The method fine-tunes LLMs on these augmented datasets to teach them to suppress memorized knowledge when context is relevant and to ignore irrelevant context.
- Training uses a loss function that encourages the model to generate answers aligned with the context, even when it conflicts with the model’s pretrained knowledge.
- The approach is applied to both T5 and PaLM architectures across multiple sizes, including 540B parameter models.
- KAFT does not require retraining or weight editing; instead, it modifies activation patterns during inference via context control.
- The method is evaluated using TriviaQA with counterfactual augmentations and context relevance filtering to isolate controllability and robustness effects.
Experimental results
Research questions
- RQ1Can large language models be effectively trained to prioritize context over memorized world knowledge when the two conflict?
- RQ2How does model size affect controllability and robustness in the presence of conflicting or irrelevant context?
- RQ3Can a single fine-tuning procedure improve both controllability and robustness without degrading standard performance?
- RQ4To what extent does data augmentation with counterfactual and irrelevant contexts improve model behavior?
- RQ5Can the model be trained to ignore irrelevant context even when it is factually plausible or semantically related?
Key findings
- KAFT reduces the match rate between closed-book answers and counterfactual answers from 0.6% (PaLM 540B) to 0.7%, indicating minimal memorization of incorrect answers.
- For PaLM 62B, KAFT improves controllability on head counterfactual questions from 1.4% to 1.3% match rate, showing consistent improvement.
- On T5 XXL, KAFT increases controllability from 6.6% to 6.8% match rate, demonstrating effectiveness across model sizes.
- KAFT with TriviaQA data removed achieves 52% and 69% controllability on T5 XXL and PaLM 62B respectively, outperforming noisy fine-tuning.
- The method maintains strong performance on standard metrics while significantly improving behavior in context-controlling scenarios.
- Even without access to TriviaQA data during training, KAFT achieves high controllability, suggesting robustness to data distribution shifts.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.