Adapting Large Language Models to Domains via Reading Comprehension

Daixuan Cheng, Shaohan Huang, Furu Wei
9/18/2023
60 citations
cs.CL

Official code: microsoft/LMOps (4,481 stars, Python, MIT, last commit 2026-04-30).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

microsoft/LMOpsOfficial100%
MIT

General technology for enabling AI capabilities w/ LLMs and MLLMs

4,481377Python, ShellDec 13, 20227 months agoMIT
agigptlanguage-modelllmlm+6 more

Similar Papers

Cite this paper

@article{cheng2023adapting,
  title  = {Adapting Large Language Models to Domains via Reading Comprehension},
  author = {Daixuan Cheng and Shaohan Huang and Furu Wei},
  year   = {2023},
  eprint = {2309.09530},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.09530v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.09530.svg)](https://codeofpaper.com/paper/2309.09530)

Discussion