[论文解读] ChemLLM: A Chemical Large Language Model
ChemLLM 是首个专为化学领域设计的开源大型语言模型,采用两阶段指令微调,利用 ChemData 和 ChemBench,在核心化学任务上实现 GPT-4–level 的性能,并在通用能力方面具有竞争力。
Large language models (LLMs) have made impressive progress in chemistry applications. However, the community lacks an LLM specifically designed for chemistry. The main challenges are two-fold: firstly, most chemical data and scientific knowledge are stored in structured databases, which limits the model's ability to sustain coherent dialogue when used directly. Secondly, there is an absence of objective and fair benchmark that encompass most chemistry tasks. Here, we introduce ChemLLM, a comprehensive framework that features the first LLM dedicated to chemistry. It also includes ChemData, a dataset specifically designed for instruction tuning, and ChemBench, a robust benchmark covering nine essential chemistry tasks. ChemLLM is adept at performing various tasks across chemical disciplines with fluid dialogue interaction. Notably, ChemLLM achieves results comparable to GPT-4 on the core chemical tasks and demonstrates competitive performance with LLMs of similar size in general scenarios. ChemLLM paves a new path for exploration in chemical studies, and our method of incorporating structured chemical knowledge into dialogue systems sets a new standard for developing LLMs in various scientific fields. Codes, Datasets, and Model weights are publicly accessible at https://hf.co/AI4Chem
研究动机与目标
- 激发需要一个专注于化学的 LLM,能够处理结构化的化学知识和自然语言对话。
- 创建一个大规模的指令微调数据集(ChemData),将结构化的化学数据转换为对话形式的问答对。
- 建立一个健壮的化学基准测试(ChemBench),用于对 LLM 的化学能力进行客观、以事实为中心的评估。
- 通过两阶段指令微调开发 ChemLLM,以在化学专业知识和通用语言能力之间取得平衡。
- 证明 ChemLLM 在化学任务上达到与 GPT-4 相当的水平,并在一般基准测试中优于同等规模的开源模型。
提出的方法
- 以 InternLM2-Base-7B 为起点的两阶段指令微调,得到 InternLM2-Chat-7B,然后用 ChemData+Multi-Corpus 混合数据进行微调。
- ChemData:包含分子、反应和领域特定任务的 700 万条指令微调问答,通过种子模板和 GPT-4 提示变体创建;使用多轮 CoT 风格的提示来丰富上下文。
- ChemBench:覆盖九项化学任务的 4,100 道选择题,用于客观评估化学理解并降低输出风格偏差;通过 OpenCompass 开源。
- 训练使用 DeepSpeed ZeRO++ 提高内存效率,LoRA 实现参数高效微调;自回归交叉熵损失的监督微调(SFT);混合精度(BF16)和 flash attention-2;在 8x2x GPU 上的基线,采用特定超参数(AdamW,学习率 5e-5 等)。
- 评估在化学任务(ChemBench)和一般能力基准(MMLU、C-Eval、GSM8K、C-MHChem)上,将 ChemLLM 与 GPT-4 及其他模型进行比较。
实验结果
研究问题
- RQ1面向化学的 LLM 是否能够在核心化学任务上达到相对于 GPT-4 的具有竞争力的表现?
- RQ2通过指令微调加入结构化的化学知识是否能提升通用推理和多语言能力?
- RQ3与同等规模的开源模型相比,ChemLLM 在通用领域基准上的表现如何?
- RQ4ChemBench 基准在对 LLM 的化学能力进行公平、客观评估方面是否有效?
主要发现
- ChemLLM 在核心化学任务上与 GPT-4 相当,涵盖 ChemBench,且常常超越/公开等同于其他 7B 参数基线。
- 在一般基准上,ChemLLM 在 MMLU、C-Eval 和 GSM8K 上超过同等规模的其他模型,表明其普遍推理能力和多语言能力得到加强。
- ChemLLM 在大多数任务上超越 GPT-3.5,尽管 GPT-4 整体仍然更出色,ChemLLM 在九项化学任务中排名靠前。
- 这两阶段训练(领域特定数据加广泛语料)较单阶段方法(InternLM2-Chat-7B)取得显著改进。
- 展示了定性化学自然语言处理能力(如文献翻译、化学主题创意任务),强调在化学情境中的实际应用价值。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。