# LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset

LlaSMol: 대규모·포괄적·고품질 지시 튜닝 데이터셋으로 화학을 위한 대규모 언어 모델 발전시키기

Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · arXiv · 2024년 2월 14일

- **연구 문제** 대규모 언어 모델은 화학 과제에서 성능이 낮다는 보고가 있었으며, 이 연구는 대규모 화학 instruction 데이터셋 SMolInstruct를 구축해 이를 개선할 수 있는지 검증합니다.
- **연구 방법** SMolInstruct의 14개 과제로 Galactica, Llama 2, Code Llama, Mistral을 LoRA로 미세조정하여 LlaSMol 모델을 만듭니다.
- **주요 결과** LlaSMolMistral은 여러 화학 과제에서 GPT-4와 Claude 3 Opus를 넘었지만, 대부분의 과제에서 SoTA 특정 과제 모델에는 미치지 못했습니다.

## 화학 과제에서 LLM이 약한 이유와 이 연구의 질문

대규모 언어 모델은 자연어 처리에서 뛰어나지만, 화학 과제에서는 성능이 낮다는 보고가 있었습니다. 특히 SMILES 문자열을 정확히 이해하거나 생성해야 하는 과제에서 GPT 계열 모델은 취약합니다. 기존 화학 instruction 데이터셋은 규모와 과제 범위, 데이터 품질, 분할 방식에서 한계가 있었습니다. 이 논문은 14개 화학 과제와 330만 개 이상의 샘플로 구성된 SMolInstruct를 구축하고, 이를 이용해 LlaSMol 모델이 기존 LLM과 화학 특화 모델을 넘을 수 있는지 검증합니다.

## SMolInstruct 데이터셋의 구성과 구축 방식

SMolInstruct는 이름 변환(NC), 속성 예측(PP), 분자 설명(MC와 MG), 화학 반응(FS와 RS)의 4가지 유형, 14개 과제로 이루어집니다. 이름 변환 데이터는 PubChem에서, 속성 예측 데이터는 MoleculeNet에서, 분자 설명 데이터는 ChEBI-20과 Mol-Instructions에서, 반응 데이터는 USPTO-full에서 수집합니다. 품질 관리에서는 RDKit으로 잘못된 SMILES를 걸러내고, 반응물과 시약의 표지 오류를 원자 매핑으로 바로잡으며, 중복 샘플을 제거합니다. 데이터 분할에서는 서로 대응하는 과제 쌍의 같은 분자나 반응을 같은 쪽에 두어 누출을 막고, PP 과제는 scaffold 분할을 사용합니다.

또한 SMILES는 정규화하여 표준 형식으로 통일합니다.

![Figure 1: An overview of tasks in the proposed SMolInstruct dataset](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-7e90e7914457ef231b02cca386236e09.png?thumb=512)

**Figure 1** : An overview of tasks in the proposed SMolInstruct dataset.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.

![Table 5: The statistics of SMolInstruct. “Qry.” and “Resp.” are average lengths of queries and responses, respectively](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-01e3592611cede8b4e9ea45ae8c743d3.png?thumb=512)

**Table 5** : The statistics of SMolInstruct. “Qry.” and “Resp.” are average lengths of queries and responses, respectively.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.

![Figure 2: The statistics of molecules in SMolInstruct, with the long tail parts removed for a clear presentation](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-c4d475c45551e58232e7864acb7017e2.png?thumb=512)

**Figure 2** : The statistics of molecules in SMolInstruct, with the long tail parts removed for a clear presentation.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 17쪽에서 그림 영역을 추출했습니다.

![Table 6: Comparison between Mol-Instructions (the molecule-oriented part) (Fang et al., 2023) and our SMolInstruct](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-84c59e7cf9ebcbd709fec333d6b08a3e.png?thumb=512)

**Table 6** : Comparison between Mol-Instructions (the molecule-oriented part) (Fang et al., 2023) and our SMolInstruct.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.

## LlaSMol 모델의 fine-tuning 방법

LlaSMol은 Galactica, Llama 2, Code Llama, Mistral 네 가지 기반 LLM을 SMolInstruct로 instruction tuning한 모델 시리즈입니다. fine-tuning에는 LoRA를 사용하며, 모든 self-attention과 FFN의 가중치 행렬에 적용하고 lora r과 lora alpha는 16으로 설정합니다. 학습은 3 에폭 동안 8비트 AdamW, 학습률 1e-4, 코사인 스케줄러로 진행합니다. 추론은 beam search를 사용합니다. 이 설정은 LlaSMol 모델들의 공통 학습 조건이며, 다른 기준선 모델에는 같은 설정을 적용하지 않았습니다.

## 주요 결과와 비교 기준

LlaSMol Mistral은 여러 화학 과제에서 GPT-4와 Claude 3 Opus보다 높은 성능을 보였다고 원문이 보고합니다. GPT-4와 Claude 3 Opus는 최대 500개의 테스트 샘플에서 평가되었고, 각각 제로샷 설정으로 평가되었습니다. 기반 모델 간에는 차이가 있었으며, Mistral 기반 모델이 Llama 2 기반 모델보다 여러 과제에서 뚜렷하게 높았습니다. 다만 LlaSMol 모델은 전체 SoTA 특정 과제 모델을 넘지 못했고, PP-Clintox와 PP-SIDER에서만 SoTA를 앞섰습니다. 평가 지표는 과제별로 EM, FTS, RMSE, METEOR, Acc, Validity를 사용합니다.

![Table 1: Results for name conversion (NC) and property prediction (PP) tasks. Metrics EM, Valid, and Acc are in percentage](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-2b71fe7e4507f06186cc658e3af033a6.png?thumb=512)

**Table 1** : Results for name conversion (NC) and property prediction (PP) tasks. Metrics EM, Valid, and Acc are in percentage.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

![Table 2: Results for molecule captioning (MC), molecule generation (MG), forward synthesis (FS), and retrosynthesis (RS). Metrics EM, FTS, and Valid are in per…](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-a87416169dd27126643c208e9d08a0c3.png?thumb=512)

**Table 2** : Results for molecule captioning (MC), molecule generation (MG), forward synthesis (FS), and retrosynthesis (RS). Metrics EM, FTS, and Valid are in percentage.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 절제 실험으로 본 SMolInstruct와 정규화 SMILES의 효과

절제 실험은 LlaSMolMistral에서 한 가지 요소만 바꾼 변형을 비교합니다. w/o canonical 변형은 정규화되지 않은 SMILES를 사용하며, 표 3과 표 4에서 FS와 RS에서 성능이 뚜렷하게 낮아졌습니다. 원문은 이를 바탕으로 정규화 SMILES가 학습 난이도를 낮춘다고 해석합니다. SELFIES 변형은 유효성을 약간 높였지만 대부분 과제에서 성능이 낮았습니다. Mol-Instructions로 학습한 변형은 같은 기반 모델과 설정에서도 SMolInstruct 학습 모델보다 크게 낮았으며, 이는 데이터셋의 효과를 보여 줍니다.

![Table 4: Results of ablation study on MC, MG, FS, and RS. Metrics EM, FTS, and Valid are in percentage. Orange represents better results than LlaSMolMistral, w…](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21/figures/figure-3c4dfcb90dd10e26e0b93a9fd84630b4.png?thumb=512)

**Table 4** : Results of ablation study on MC, MG, FS, and RS. Metrics EM, FTS, and Valid are in percentage. Orange represents better results than LlaSMolMistral, while blue represents worse results.

[원문](https://arxiv.org/abs/2402.09391v4) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun · LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.

## 평가의 한계와 적용 범위

원문은 MC와 MG 과제의 평가 지표가 생성된 설명이나 분자의 화학적 정확성을 정확히 평가하지 못한다고 명시합니다. 또한 일반화 능력은 이번 연구의 범위 밖이며, LlaSMol 모델이 SoTA 특정 과제 모델을 넘지 못한 것은 훈련 가능한 파라미터 비율이 작았거나 학습 절차가 최적이 아니었을 가능성과 관련된다고 제시됩니다. 이 가능성은 저자들의 해석이며 실험으로 증명된 원인은 아닙니다. GPT-4와 Claude 3 Opus의 결과는 자원 제약으로 최대 500개 샘플에서 얻었습니다.

## 논문 정보

- **저자**: Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2024년 2월 14일
- **등록일**: 2026년 11월 5일
- **수정일**: 2024년 8월 10일
- **버전**: v4
- **arXiv**: 2402.09391
- **분류**: cs.AI · cs.CE · cs.CL
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2402.09391v4) · [원문 PDF ↗](https://arxiv.org/pdf/2402.09391v4)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Chemistry plays a crucial role in many domains, such as drug discovery and material science. While large language models (LLMs) such as GPT-4 exhibit remarkable capabilities on natural language processing tasks, existing research indicates that their performance on chemistry tasks is discouragingly low. In this paper, however, we demonstrate that our developed LLMs can achieve very strong results on a comprehensive set of chemistry tasks, outperforming the most advanced GPT-4 and Claude 3 Opus by a substantial margin. To accomplish this, we propose SMolInstruct, a large-scale, comprehensive, and high-quality dataset for instruction tuning. It contains 14 selected chemistry tasks and over three million samples, laying a solid foundation for training and evaluating LLMs for chemistry. Using SMolInstruct, we fine-tune a set of open-source LLMs, among which, we find that Mistral serves as the best base model for chemistry tasks. Our analysis further demonstrates the critical role of the proposed dataset in driving the performance improvements.

## 원문 인용

Botao Yu, Frazier N. Baker, Ziqi Chen, Xia Ning, Huan Sun (2024). LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset. arXiv:2402.09391v4. https://arxiv.org/abs/2402.09391v4

**BibTeX**

```
@misc{yu2024llasmol,
  title = {{LlaSMol: Advancing Large Language Models for Chemistry with a Large-Scale, Comprehensive, High-Quality Instruction Tuning Dataset}},
  author = {Botao Yu and Frazier N. Baker and Ziqi Chen and Xia Ning and Huan Sun},
  year = {2024},
  eprint = {2402.09391},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.09391v4}
}
```

## 이 논문의 용어

- [LoRA](https://refivu.com/terms/84da7a415b66-low-rank-adaptation-lora)
- [RMSE](https://refivu.com/terms/ad2579cf164a-rmse)
- [GPT-4](https://refivu.com/terms/1e2d0d2cdc44-gpt-4)
- [Beam search](https://refivu.com/terms/3e449f8f713b-beam-search)
- [Validity](https://refivu.com/terms/a7c49056c0e6-validity)
- [SMILES](https://refivu.com/terms/7799e9d8f4ed-smiles)
- [Exact Match (EM)](https://refivu.com/terms/dbbdbf078db9-exact-match-em)
- [ablation study](https://refivu.com/terms/ce1cb4927402-ablation-study)
- [Accuracy (ACC)](https://refivu.com/terms/8944d861ae21-accuracy-acc)
- [Llama 2](https://refivu.com/terms/891032ad79a6-llama-2)
- [Mistral](https://refivu.com/terms/b07fed40d3ac-mistral)
- [MoleculeNet](https://refivu.com/terms/955b24e71a9c-moleculenet)
- [scaffold splitting](https://refivu.com/terms/04c8a9dc0120-scaffold-splitting)
- [SELFIES](https://refivu.com/terms/61ff93dbf909-selfies)
- [Claude 3 Opus](https://refivu.com/terms/9a014ca053e2-claude-3-opus)
- [Code Llama](https://refivu.com/terms/3efe18e06ee0-code-llama)
- [Galactica](https://refivu.com/terms/82bd6a866225-galactica)

## 다른 논문 해설

- [Instruction Tuning Chronologically Consistent Language Models](https://refivu.com/papers/9e4b2208-795b-4200-909d-af8bd7b7290b-instruction-tuning-chronologically-consistent-language.md)
- [MLAN: Language-Based Instruction Tuning Preserves and Transfers Knowledge in Multimodal Language Models](https://refivu.com/papers/383b925a-1b95-4fc1-97e6-b9874917052c-mlan-language-based-instruction-tuning-preserves-and.md)
- [Code Comparison Tuning for Code Large Language Models](https://refivu.com/papers/a0648f88-23de-40b7-8728-abfc653fee3a-code-comparison-tuning-for-code-large-language-models.md)
- [Parameter-Efficient Instruction Tuning of Large Language Models For Extreme Financial Numeral Labelling](https://refivu.com/papers/fe79f5fe-6112-4cdb-8ffe-b049c3d860a6-parameter-efficient-instruction-tuning-of-large-language.md)
- [Neuron-Aware Data Selection In Instruction Tuning For Large Language Models](https://refivu.com/papers/1804c30c-140b-474c-87dc-21d33fff29fd-neuron-aware-data-selection-in-instruction-tuning-for.md)
- [Vikhr: The Family of Open-Source Instruction-Tuned Large Language Models for Russian](https://refivu.com/papers/213f8125-9ee3-459b-ad47-fed9dd92b224-vikhr-the-family-of-open-source-instruction-tuned.md)
- [Lost in the Flow with Code Talkers: Unveiling the Instruction-Tuning Tax of Large Language Models in Code Tasks](https://refivu.com/papers/9c5c4cac-6576-4e60-97d0-311199a7b11c-lost-in-the-flow-with-code-talkers-unveiling.md)
- [Explaining Sequence-Level Knowledge Distillation as Data-Augmentation for Neural Machine Translation](https://refivu.com/papers/bed362a2-5462-4d3e-b4f6-dbaa75490982-explaining-sequence-level-knowledge-distillation-as-data.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/a04cfe10-8c2c-40b6-ad31-5a013bb9eb21-llasmol-advancing-large-language-models-for-chemistry-with)
