[论文解读] Adapting Large Language Models to Domains via Reading Comprehension
本文表明在领域原始语料上进行持续预训练可以获得领域知识,但会损害提示能力;并提出将领域原始文本转换为阅读理解任务(附带通用指令),以在保留知识的同时提升提示能力,从而产生在领域上具有强劲表现的 AdaptLLM。
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.
研究动机与目标
- 研究领域自适应预训练在原始语料上如何影响大型语言模型的提示能力和知识。
- 开发一种可扩展的方法,将领域原始文本转换为阅读理解格式,以保留提示能力。
- 证明基于阅读理解的适配在生物医学、金融和法律等领域的领域特定任务上有所提升。
提出的方法
- 通过实验分析对领域特定原始语料进行持续预训练(生物医学、金融、法律),并评估提示、微调和知识探测。
- 将领域原始文本转换为包含一组任务的阅读理解文本(摘要、从词到文本、自然语言推理、常识推理、同义句检测、文本完成)。
- 在阅读理解文本中加入通用指令,以拓展输入输出格式。
- 在领域数据上训练 LLaMA-7B,使用阅读理解文本与通用指令的混合(数据比例:bio 1:1, finance 1:2, law 1:1)。
- 进行消融研究并与通用大语言模型及 vanilla 的领域自适应预训练(DAPT)进行比较。
- 在领域特定基准(生物医学、金融、法律)和通用提示基准上进行评估,以评估知识与提示能力。
实验结果
研究问题
- RQ1持续在领域原始语料上进行预训练是否会向LLMs内嵌领域知识,以及这对提示性能有何影响?
- RQ2将领域原始文本转换为阅读理解任务,是否能在传授领域知识的同时保留或提升提示能力?
- RQ3基于阅读理解增强的语料是否在多个领域的领域特定和通用提示基准上有所提升?
- RQ4单个阅读理解任务类型对领域任务的相对影响是什么?
- RQ5这种方法能否在与更大规模的领域特定模型相比时达到具有竞争力的7B模型?
主要发现
- 对领域特定原始语料进行持续预训练可以提升微调性能和领域知识探测,但会降低提示能力。
- 将原始语料转换为带有任务提示的阅读理解文本,在各领域保持并提升提示能力。
- 在阅读理解文本中加入通用指令进一步提高提示性能。
- AdaptLLM(7B)在金融领域与更大规模的领域特定模型相比具有竞争力,在其他领域接近领域特定基线。
- 基于阅读理解的适配提高领域特定任务的表现,甚至有利于通用基准,暗示更广泛泛化的潜力。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。