Adapting Large Language Models via Reading Comprehension

Daixuan Cheng, Shaohan Huang, Furu Wei

The Challenge of Domain Adaptation

When developers want a Large Language Model (LLM) to become an expert in a specialized field like medicine, finance, or law, the standard approach is "Domain-Adaptive Pre-training" (DAPT). This involves feeding the model massive amounts of raw, domain-specific text.

However, this approach presents a major paradox. While DAPT successfully helps the model learn new facts, it severely degrades its "prompting ability." Because raw text lacks an input-output or question-answer structure, the model effectively "unlearns" how to be a helpful assistant. It might acquire the medical knowledge you are asking about, but it forgets how to format the answer or follow your instructions.

To address this, researchers have introduced AdaptLLM, a novel method that transforms raw corpora into "reading comprehension" tasks. This allows models to absorb specialized knowledge while actually improving their instruction-following capabilities.

The Reading Comprehension Framework

The core innovation of AdaptLLM mimics how humans study: practice after reading. Instead of just passively reading a paragraph, the model is forced to perform tasks based on that specific text.

  1. The "Reading" Phase: The model is presented with a segment of raw, domain-specific text.
  2. The "Comprehension" Phase: The raw text is immediately followed by several automatically generated tasks related to its content.
Transforming raw text into a reading comprehension format with automatically mined tasks.

Crucially, rather than relying on expensive human annotators or larger LLMs (like GPT-4) to create these questions, the authors used regex-based patterns to "mine" tasks directly from the text. This highly scalable pipeline extracts several types of tasks:

  • Summarization: Utilizing the article's title or topic sentences.
  • Word-to-Text: Forcing the model to generate sentences using specific domain keywords.
  • Natural Language Inference (NLI): Determining if one sentence entails or contradicts another based on the text.
  • Commonsense Reasoning: Identifying cause-and-effect relationships using cues like "Therefore" or "Because."
  • Text Completion: Prompting the model to finish the article.

Finally, these domain-specific reading comprehension texts are mixed with general instruction-tuning datasets (like LIMA or WizardLM) to ensure the model remains a versatile generalist.

Datasets and Evaluation

The researchers tested their method across three high-stakes domains:

  • Biomedicine: 15.5 million documents from PubMed Abstracts.
  • Finance: 1.1 million stock news articles.
  • Law: 3.6 million legal opinions from FreeLaw.

Evaluation was conducted using established benchmarks in each field (e.g., PubMedQA, ConvFinQA, CaseHOLD), alongside general benchmarks like MMLU and ARC to check for "catastrophic forgetting."

Key Insights and Results

The study reveals that raw text is a double-edged sword: training on it increases "Knowledge Probing" scores but drastically decreases "Prompting" scores. By structuring the text into a Q&A format, the model learns the domain's facts and its logic simultaneously.

Comparison of Domain Knowledge and Prompting Ability across General LLMs, models trained on Raw Text, and models trained with Reading Comprehension.

The results demonstrate that data quality and structure can effectively rival sheer model size:

  • Outperforming Giants: The AdaptLLM-7B model (built on LLaMA-7B) achieved a score of 63.4 on finance tasks, outperforming BloombergGPT-50B—a model nearly seven times its size that was trained from scratch.
  • Consistent Gains: Across biomedicine, finance, and law, AdaptLLM consistently outperformed both the base LLaMA model and the vanilla DAPT model trained on raw text.
  • General Intelligence Boost: Surprisingly, training on domain-specific reading comprehension tasks improved performance on some general benchmarks, suggesting that deep, structured specialized learning reinforces general reasoning skills.
  • Versatility: The method proved effective across different base architectures (like Pythia-70M) and even models that had already undergone Reinforcement Learning from Human Feedback (RLHF), such as LLaMA-2-Chat.

Limitations and Future Work

While highly effective, the authors note a few areas for future refinement. The current task mining relies on specific linguistic cues (verbalizers); if a text is written in a non-standard style, the regex patterns might fail to extract meaningful tasks. Additionally, while the framework covers six task types, real-world professional tasks are more varied. Future work could involve using LLMs to distill even more complex reasoning tasks from raw text, with the ultimate goal of scaling this approach to create a truly "universal" expert model across dozens of specialized fields.

Summary updated

BibTeX
@inproceedings{cheng2024adapting,
  author = {Daixuan Cheng and Shaohan Huang and Furu Wei},
  title = {{Adapting Large Language Models via Reading Comprehension}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=y886UXPEZ0},
}
Figure