Unsupervised LLM Adaptation for Question Answering

Kuniaki Saito, Kihyuk Sohn, Chen-Yu Lee, Yoshitaka Ushiku

Abstract

Large language models require updates to remain up-to-date or adapt to new domains by fine-tuning them with new documents. One key is memorizing the latest information in a way that the memorized information is extractable with a query prompt. However, LLMs suffer from a phenomenon called perplexity curse; despite minimizing document perplexity during fine-tuning, LLMs struggle to extract information through a prompt sentence. In this new knowledge acquisition and extraction, we find a very intriguing fact that LLMs can accurately answer questions about the first sentence, but they struggle to extract information described in the middle or end of the documents used for fine-tuning. Our study suggests that the auto-regressive training causes this issue; each token is prompted by reliance on all previous tokens, which hinders the model from recalling information from training documents by question prompts. To conduct the in-depth study, we publish both synthetic and real datasets, enabling the evaluation of the QA performance w.r.t. the position of the corresponding answer in a document. Our investigation shows that even a large model suffers from the perplexity curse, but regularization such as denoising auto-regressive loss can enhance the information extraction from diverse positions. These findings will be (i) a key to improving knowledge extraction from LLMs and (ii) new elements to discuss the trade-off between RAG and fine-tuning in adapting LLMs to a new domain.

Introduction: The Perplexity Curse and Positional Bias

As the world changes, Large Language Models (LLMs) must be updated with new information, such as recent news or specialized domain data. Developers typically achieve this by fine-tuning the model on new documents. However, models often suffer from the "perplexity curse": even if a model becomes highly proficient at predicting the next word in a document (achieving low perplexity), it often fails to answer direct questions about that same information.

The core issue identified in this research is Positional Bias. In standard auto-regressive training, a model learns to predict a word based on every preceding word. If a fact is located at the end of a document, the model learns to "recall" it only when prompted by the specific sequence of preceding words. When a user asks a short question, this long chain of context is missing, causing the model's memory to fail.

LLM fine-tuning workflow and the resulting drop in accuracy as the answer's position in the document moves further from the start.

Methods: Breaking the Sequence Dependency

To address this over-reliance on previous tokens, the authors investigated several training strategies to regularize the learning process:

  1. Standard Auto-Regressive (AR): The baseline where the model predicts the next token given all previous ones.
  2. Denoising Auto-Regressive (D-AR): The primary contribution. During training, the model randomly replaces a percentage of input tokens with random words but is still required to predict the original next token. This forces the model to learn underlying facts without relying on a rigid, specific sequence of words.
  3. Sentence Shuffling: Randomizing sentence order so the model doesn't learn a fixed narrative position for a fact.
  4. Attention Dropout: Randomly dropping connections in the attention mechanism to prevent over-reliance on specific previous tokens.
Standard auto-regressive training mechanism where each token prediction depends on the entire preceding sequence.

Datasets and Evaluation

The study utilized three primary datasets to track information location and extraction performance:

  • Synthetic Bio: 3,000 biographies with facts placed in consistent positions to measure recall accuracy.
  • Wiki2023+: Created from 2023 Wikipedia articles (post-initial pre-training). Every question-answer pair is mapped to a specific sentence in the source document.
  • MedQuAD: A real-world medical QA dataset for testing specialized domain adaptation.

Key Insights

  • Perplexity is Deceptive: Low perplexity does not guarantee knowledge extraction. Standard training creates "hard-to-extract" memories.
  • Spurious Correlation: Models use the "vibe" or specific phrasing of the first half of a document as a crutch. Denoising (D-AR) acts as a regularizer to break this dependency.
  • Training vs. Inference Bias: This positional bias is baked in during the learning phase, distinct from the "Lost in the Middle" phenomenon seen during inference.
  • Scaling Limitations: Even 70B parameter models suffer from this bias, though they are more robust than 7B models.

Key Results

  • The Performance Drop: On Wiki2023+, a 7B model achieved ~41% accuracy for facts at the start of a document, plummeting to ~11% for facts in the middle or end.
  • D-AR Impact: Denoising doubled average extraction accuracy (from 14.9% to 30.4% Exact Match).
  • Synergy: Combining D-AR with sentence shuffling provided the best results for long-form knowledge extraction.
  • 70B Model Gains: For Llama-2 70B, D-AR improved average accuracy from 31.7% to 46.2%.

Conclusion

While D-AR significantly improves knowledge extraction, fine-tuned models still lag behind Retrieval-Augmented Generation (RAG), which achieved ~90% accuracy on these tasks. Storing knowledge in parameters remains inherently more difficult than reading it from a prompt. Future work will focus on closing this gap and exploring complex reasoning beyond factual lookups.

Summary updated

Abstract

Large language models require updates to remain up-to-date or adapt to new domains by fine-tuning them with new documents. One key is memorizing the latest information in a way that the memorized information is extractable with a query prompt. However, LLMs suffer from a phenomenon called perplexity curse; despite minimizing document perplexity during fine-tuning, LLMs struggle to extract information through a prompt sentence. In this new knowledge acquisition and extraction, we find a very intriguing fact that LLMs can accurately answer questions about the first sentence, but they struggle to extract information described in the middle or end of the documents used for fine-tuning. Our study suggests that the auto-regressive training causes this issue; each token is prompted by reliance on all previous tokens, which hinders the model from recalling information from training documents by question prompts. To conduct the in-depth study, we publish both synthetic and real datasets, enabling the evaluation of the QA performance w.r.t. the position of the corresponding answer in a document. Our investigation shows that even a large model suffers from the perplexity curse, but regularization such as denoising auto-regressive loss can enhance the information extraction from diverse positions. These findings will be (i) a key to improving knowledge extraction from LLMs and (ii) new elements to discuss the trade-off between RAG and fine-tuning in adapting LLMs to a new domain.
BibTeX
@misc{saito2024unsupervised,
  author = {Kuniaki Saito and Kihyuk Sohn and Chen-Yu Lee and Yoshitaka Ushiku},
  title = {{Unsupervised LLM Adaptation for Question Answering}},
  year = {2024},
  eprint = {2402.12170},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.12170},
}
Figure