Skip to main content
QUICK REVIEW

[Paper Review] Adapting Large Language Models to Domains via Reading Comprehension

Daixuan Cheng, Shaohan Huang|arXiv (Cornell University)|Sep 18, 2023
Topic ModelingComputer Science9 citations
TL;DR

The paper shows that continued pre-training on domain raw corpora gives domain knowledge but harms prompting, and proposes converting raw domain texts into reading comprehension tasks (with general instructions) to retain knowledge while boosting prompting ability, yielding AdaptLLM with strong domain performance.

ABSTRACT

We explore how continued pre-training on domain-specific corpora influences large language models, revealing that training on the raw corpora endows the model with domain knowledge, but drastically hurts its prompting ability for question answering. Taken inspiration from human learning via reading comprehension--practice after reading improves the ability to answer questions based on the learned knowledge--we propose a simple method for transforming raw corpora into reading comprehension texts. Each raw text is enriched with a series of tasks related to its content. Our method, highly scalable and applicable to any pre-training corpora, consistently enhances performance across various tasks in three different domains: biomedicine, finance, and law. Notably, our 7B language model achieves competitive performance with domain-specific models of much larger scales, such as BloombergGPT-50B. Furthermore, we demonstrate that domain-specific reading comprehension texts can improve the model's performance even on general benchmarks, showing the potential to develop a general model across even more domains. Our model, code, and data are available at https://github.com/microsoft/LMOps.

Motivation & Objective

  • Investigate how domain-adaptive pre-training on raw corpora affects prompting and knowledge for large language models.
  • Develop a scalable method to convert raw domain texts into reading comprehension formats to preserve prompting ability.
  • Demonstrate that reading-comprehension-based adaptation improves domain-specific tasks across biomedicine, finance, and law.

Proposed method

  • Experimentally analyze continued pre-training on domain-specific raw corpora (biomedicine, finance, law) and assess prompting, fine-tuning, and knowledge probing.
  • Convert raw domain texts into reading-comprehension texts with a set of tasks (summarization, word-to-text, natural language inference, commonsense reasoning, paraphrase detection, text completion).
  • Augment reading-comprehension texts with general instructions to broaden input-output formats.
  • Train LLaMA-7B on domain data using a mix of reading-comprehension texts and general instructions (data ratios: bio 1:1, finance 1:2, law 1:1).
  • Perform ablations and comparisons against general LLMs and vanilla domain-adaptive pre-training (DAPT).
  • Evaluate on domain-specific benchmarks (biomedicine, finance, law) and general prompting benchmarks to assess both knowledge and prompting capability.

Experimental results

Research questions

  • RQ1Does continued pre-training on domain raw corpora embed domain knowledge in LLMs and how does it affect prompting performance?
  • RQ2Can transforming raw domain texts into reading-comprehension tasks preserve or enhance prompting ability while imparting domain knowledge?
  • RQ3Do reading-comprehension augmented corpora improve domain-specific and general prompting benchmarks across multiple domains?
  • RQ4What is the relative impact of individual comprehension task types on domain tasks?
  • RQ5Can this approach yield a competitive 7B model vs larger domain-specific models?

Key findings

  • Continued pre-training on domain-specific raw corpora improves fine-tuning performance and domain knowledge probing but reduces prompting ability.
  • Transforming raw corpora into reading-comprehension texts with task prompts preserves and enhances prompting ability across domains.
  • Augmenting reading-comprehension texts with general instructions further improves prompting performance.
  • AdaptLLM (7B) achieves competitive results with larger domain-specific models in finance and approaches domain-specific baselines in other domains.
  • Reading-comprehension-based adaptation improves domain-specific task performance and even benefits general benchmarks, suggesting potential for broader generalization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.