원시데이터 수집 시스템
선정목록으로

ALMol: Aligned Language-Molecule Translation LLMs through Offline Preference Contrastive Optimisation

간접 관련 화학·수지 · (21) 에폭시수지 (19) 석유수지(20) 페놀수지(23) 컴파운드

기본 정보

저자
  1. Dimitris Gkoumas — Queen Mary University of London , London , UK
DOI
10.18653/v1/2024.langmol-1.3
저널
–
발행년도
2024
발행기관
–
피인용수
0
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
http://dx.doi.org/10.18653/v1/2024.langmol-1.3
토픽
Fuel Cells and Related Materials
OpenAlex ID
W4402669731

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(19) 석유수지, (20) 페놀수지, (23) 컴파운드
R&D 측면
분석·모델링
확신도
0.70
근거 용어
language-molecule translation, SMILES, large language models, chemical domain, molecular patterns
판단 근거
본 논문은 언어와 분자 구조(SMILES) 간의 번역을 위한 거대언어모델(LLM) 학습 방법론을 다루고 있습니다. 이는 직접적인 제품 연구는 아니나, 화학 구조 예측 및 신소재 설계를 위한 AI 모델링 기술로서 코오롱인더스트리의 수지(에폭시, 페놀, 석유수지) 및 컴파운드 개발 R&D에 응용 가능한 간접 관련 기술입니다.
R&D 활용 포인트
AI 기반의 분자 구조 설계 및 물성 예측 모델 개발에 활용하여, 신규 에폭시 수지나 고기능성 컴파운드 배합 설계의 효율성을 높일 수 있습니다.
평가 입력
본문 28,979자

초록

The field of chemistry and Artificial Intelligence (AI) intersection is an area of active research that aims to accelerate scientific discovery.The integration of large language models (LLMs) with scientific modalities has shown significant promise in this endeavour.However, challenges persist in effectively addressing training efficacy and the out-of-distribution problem, particularly as existing approaches rely on larger models and datasets.In this context, we focus on machine language-molecule translation and deploy a novel training approach called contrastive preference optimisation, which avoids generating translations that are merely adequate but not perfect.To ensure generalisability and mitigate memorisation effects, we conduct experiments using only 10% of the data.Our results demonstrate that our models achieve up to a 32% improvement compared to counterpart models.Finally, we introduce a fine-grained, domain-agnostic evaluation method to assess hallucination in LLMs and promote responsible use.

본문 28,979자

본문 펼치기
# ALMol: Aligned Language-Molecule Translation LLMs through Offline Preference Contrastive Optimisation Dimitris Gkoumas Queen Mary University of London, London, UK d.gkoumas@qmul.ac.uk Abstract The field of chemistry and Artificial Intelligence (AI) intersection is an area of active research that aims to accelerate scientific discovery. The integration of large language models (LLMs) with scientific modalities has shown significant promise in this endeavour. However, challenges persist in effectively addressing training efficacy and the out-of-distribution problem, particularly as existing approaches rely on larger models and datasets. In this context, we focus on machine language-molecule translation and deploy a novel training approach called contrastive preference optimisation, which avoids generating translations that are merely adequate but not perfect. To ensure generalisability and mitigate memorisation effects, we conduct experiments using only 10% of the data. Our results demonstrate that our models achieve up to a 32% improvement compared to counterpart models. Finally, we introduce a fine-grained, domain-agnostic evaluation method to assess hallucination in LLMs and promote responsible use. 1 Introduction The world is facing unprecedented complexity in the form of global challenges such as climate change, healthcare, and pandemics. Innovative scientific solutions are urgently needed to address these challenges. Chemistry has been at the forefront of developing such solutions, pioneering new drugs (Ferguson and Gray, 2018), creating advanced materials (Kippelen and Brédas, 2009), or enhancing chemical processes (Zhong et al., 2023). However, these frontiers are vast and require the involvement of Artificial Intelligence (AI) technology to navigate them effectively. Large language models (LLMs) have shown promising potential for accelerating scientific discovery across various domains, including chemistry, biology, and materials science (Zhang et al., 2023; AI4Science and Quantum, 2023). Existing work has applied successful paradigms from natural language processing (NLP) and multimodal representation learning to the chemistry domain. One common approach involves converting the inherent three-dimensional structures of molecules into SMILES, which provide a mapping to symbolic character-level representations. Subsequently, researchers have explored learning language-molecule representations either in separate yet coordinated spaces (Edwards et al., 2022, 2021; Liu et al., 2023a), in a joint space (Liu et al., 2023b), or through hybrid approaches (Luo et al., 2023; Christofidellis et al., 2023). In light of the recent significant advancements in the field, none of the above approaches effectively tackle the inherent challenges in training such models. Instead, they rely on sparse or noisy synthetic data, often necessitating exponentially more data than is typically used in NLP tasks (Edwards et al., 2024). However, training on larger models and datasets does not necessarily guarantee higher performance. A successful paradigm that augments the capabilities of LLMs across multiple NLP tasks is Reinforcement Learning with Human Feedback (RLHF) (Ouyang et al., 2022). Although initially challenged by issues of slowness and instability, recent research has addressed many of these challenges by shifting towards closed-form losses that operate directly on offline preference data (Rafailov et al., 2024). RLHF has demonstrated superior performance compared to standard minimising crossentropy optimisation approaches. In this context, we address challenges related to effectively training robust language models when integrated with scientific modalities. We deploy a novel way of training LLMs for language-molecule translation that avoids generating translations that are only adequate but not perfect, called contrastive preference optimisation (CTO) (Xu et al., 2024). CTO is based on offline preferences instead of su 22 _Proceedings of the 1st Workshop on Language + Molecules (L+M 2024)_ pages 22 28 pervised fine-tuning, mimicking reference translations. To ensure that our models can effectively generalise instead of memorising patterns, we conduct experiments using only 10% of the L+M-24 dataset (Edwards et al., 2024). Our contributions have as follows: - Our models achieve significant performance improvements across various evaluation metrics compared to models trained on extensive indistribution and out-of-distribution data ( _§_ 4 _._ 4). - We showcase their robustness through experiments comparing pivot and minor cross-modals. Our empirical results demonstrate that our models consistently outperform the leading baseline, Meditron, which is trained on the entire dataset, even in agnostic cross-modal scenarios ( _§_ 4 _._ 4). - We propose a fine-grained evaluation method that is domain-independent, assessing factual consistency in generated captions using a questionanswering evaluation metric and measuring overlaps of unigrams in generated molecules against references ( _§_ 3 _._ 3). Our analysis shows that our models achieve improved factual consistency and character-level unigram overlaps for caption and molecule generation ( _§_ 4 _._ 5). 2 Background Reinforcement Learning with Human Feedback (RLHF) optimisation (Ouyang et al., 2022) operates with a triple dataset _D_ = _{x, yw, yl}_, where _yw_ and _yl_ represent preferred and dis-preferred outputs, corresponding to input _x_, such that _yw_ _≻_ _yl_ for _x_ . The probability of _yw_ over _yl_ in pairwise comparisons is typically computed using the Bradley-Terry model (Bradley and Terry, 1952): _p_ <sup>_∗_</sup> ( _yw_ _≻_ _yl|x_ ) = _σ_ ( _r_ <sup>_∗_</sup> ( _x, yw_ ) _−_ _r_ <sup>_∗_</sup> ( _x, yl_ )) (1) where _σ_ is the logistic function, and _r_ <sup>_∗_</sup> denotes the reward function that underlies the preferences. As obtaining the reward directly from a human would be prohibitively expensive, a reward model _rϕ_ is trained to act as a surrogate by minimising the negative log-likelihood of the preference data: _L_ ( _rϕ_ ) = _−_ E( _x,yw,yl_ ) _∼D_ [log _σ_ ( _rϕ_ ( _x, yw_ ) _−rϕ_ ( _x, yl_ ))] (2) Additionally, the Kullback-Leibler (KL) divergence between the outputs generated by _π_ ref and the parameterised _πθ_ models serves as an additional reward signal, ensuring that the generated responses closely align with the reference model. Conse 23 quently, an optimal model _πθ_ is one that maximises: E( _x∈D,y∈πθ_ )[ _rϕ_ ( _x, y_ )] _−βD_ KL( _πθ_ ( _y|x_ ) _||π_ ref( _y|x_ )) (3) where _β_ is the temperature parameter typically _∈_ [0 _._ 1 _,_ 0 _._ 5]. RLHF can present challenges due to its inherent slowness and instability, especially in distributed settings (Zheng et al., 2024). Recent work has shifted towards closed-form losses to align LLMs with human preferences. Here, we experiment with contrastive preference optimisation that adopts a closed-form loss for RLHF. 3 Methodology 3.1 Task Formulation Let ( _x, y_ ) be a pair of source and target sequences mapped to X and Y spaces, respectively. We cast the problem of language-molecule translation as a cross-modal translation task that operates on offline preference data _D_ = _{x_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _, yw_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_, y_</sup> _l_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_}_</sup> _i_ <sup>_N_</sup> =1 <sup>, where</sup> <sup>_x_</sup> _w_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_, y_</sup> _l_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> preference data _D_ = _{x_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> _, yw_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_, y_</sup> _l_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_}_</sup> _i_ <sup>_N_</sup> =1 <sup>, where</sup> <sup>_x_</sup> is an input, _yw_ are preferred (e.g. human gold standard) and _yl_ dis-preferred outputs (typically synthetic, obtained from an appropriate translation model), and _N_ is the total number of pairs. The goal is to learn an optimal function _f_ : _X_ _↔_ _Y_ through a model _πθ_ parameterised by _θ_ . We coordinate the two spaces through instructional modelling to regulate the translation process in both directions. Specifically, for LMolT, we use instructions for language-to-molecule and molecule-to-language translation (see Appx. A). 3.2 Contrastive Preference Optimisation Contrastive preference optimisation (CTO) (Xu et al., 2024) addresses challenges stemming from the inherent limitation in RLHF, as discussed in _§_ 2, and from the necessity of high-quality data. CTO is a general approximation of Eq. 3 using a uniform reference model, which assumes equal likelihood for all possible generated outputs: _l_ <sup>(</sup> <sup>_i_</sup> <sup>)</sup> <sup>_}_</sup> _i_ <sup>_N_</sup> _L_ ( _πθ_ ; _U_ ) = _−_ E( _x,yw,yl_ ) _∼D_ log _σ_ _β_ log _πθ_ ( _yw|x_ ) _−_ - <sup>�</sup> log _σ_ _β_ log _πθ_ ( _yw|x_ ) _−_ _β_ log _πθ_ ( _yl|x_ ) (4) where _πθ_ is parameterised model by _θ_ and _β_ hyperparameter (please refer _§_ 2). Eq. 4 implies that the loss is calculated based on how well the generated translations match this uniform distribution of possible translations, rather than being biased towards any particular translation. To maintain _πθ_ close to the preferred data distribution, a behaviour cloning (BC) (Hejna et al., 2023) regulariser is introduced: min s.t. _θ_ _L_ ( _πθ, U_ ) _< ϵ,_ (5) min Reference Caption <u>It belongs to the orexin receptor modulator class of molecules.</u> Generated Caption <u>The molecule is an antiviral.</u> Selected Answer <u>an antiviral</u> Generated Question <u>What is the molecule?</u> QA Output <u>Orexin receptor modulator</u> Scores <u>Overlap: 0.5, f1: 0.0, Is answered: 0.5</u> Figure 1: A toy example illustrating a factual inconsistency between a generated and a reference caption. The QAFactEval metric selects a noun-phrase answer from the generated caption. A QG model then generates an associated question that a QA model answers based on the reference caption. The scores measure the semantic overlap between the QA model’s answer and the selected answer from the generated caption Molecule Evaluation: For language-to-molecule translation, we employ the Chr-F metric, an F-score statistic, to evaluate character n-gram matches between prediction-reference pairs (Popovi´c, 2015). This metric assesses the matches in generated molecules against their references by averaging the scores of unigram, bigram, and trigram matches. A higher Chr-F score indicates better performance. Bias Evaluation: We also calculate the character and token length bias in generated-reference pairs of molecules and captions, respectively, to investigate potential length bias in the evaluated LLMs. 4 Experiments 4.1 Data We conduct experiments on the _L+M-24_ bench mark dataset, which encompasses both molecule and linguistic modalities (Edwards et al., 2024). It is divided into four categories, each with significant applications in small-molecule domain; biomedical; light and electricity; human interaction and organoleptics; and agriculture and industry. The training and validation subsets consist of approximately 127k and 34k language-molecule pairs, respectively. Here, we utilise 10% of these subsets for training and validation. To operationalise CTO, we recreate a triples dataset consisting of preferred and dis-preferred outputs (see _§_ 2), where the former are the golden references and the latter are generated from MolT5 (Edwards et al., 2022). For evaluation, we randomly selected 3k unseen pairs E( _x,yw_ ) _∼D_ KL( _πw_ ( _yw|x_ ) _||πθ_ ( _yw|x_ )) Here, _ϵ_ denotes a small positive constant, and KL signifies the Kullback-Leibler divergence. The regulariser is enhanced with an additional SFT term on the preferred data, bolstering the CPO loss as: _L_ CPO = min _θ_ _<u>L</u>_ ( _πθ, U_ ) _L_ prefer ~~�~~ ~~�~~ - ~~�~~ _−_ E( _x,yw_ ) _<u>∼D</u>_ [ log _πθ_ ( _yw|x_ )] _L_ NLL (6) ~~�~~ ~~�~~ - ~~�~~ 3.3 Proposed Evaluation Methodology Prior studies have utilised embedding representations, for assessing the semantics in chemicaldomain models (Jaeger et al., 2018; Edwards et al., 2021; Christofidellis et al., 2023). However, these approaches require domain adaptation for out-ofdistribution data (Edwards et al., 2024) and might lead to opaque and arbitrary outcomes (Steck et al., 2024). We address these limitations by introducing a scalable fine-grained evaluation methodology for assessing the presence of hallucinations <sup>1</sup> in generated outputs. Language Evaluation: For molecule-tolanguage translation, we deploy the QAFactEval (Fabbri et al., 2022) metric to evaluate the factual consistency of generated captions. QAFactEval first selects noun phrases and named entities (NER) from the generated outputs. A question generation (QG) model then formulates associated questions, which a question answering (QA) model addresses based on the reference text. QAFactEval measures the semantic overlap between the QA model’s responses and the selected answers to produce the final metric score. An example is illustrated in Fig. 1. Here, we report the semantic _overlap_, the _f_ 1 _accuracy_ between the QA model and the selected answer, and _answerability_, which is the probability of the question being answered by the reference caption. 1Hallucination in LLMs refers to a phenomenon where the generated outputs are inaccurate, nonsensical, or contradictory to the provided factual information. 24 from a distinct dataset provided by the research group of L+M-24. <sup>2</sup> 4.2 Bechmark Models We compare our results with established language molecule models as captured in the literature: - TxtChem-T5 (Christofidellis et al., 2023): A T5 model trained on both linguistic and molecule modalities with a multi-task objective across various datasets, including the CheBI-20 dataset (Edwards et al., 2022), akin to _L+M-24_ . - Chem-LLM (Zhang et al., 2024): An InternLM2Base-7B model, trained on an extensive chemical domain knowledge dataset, with the direct preference optimisation objective (Rafailov et al., 2024), achieves results comparable to GPT-4. - Meditron (Chen et al., 2023): A Meditron-7B model fine-tuned on the entire _L+M-24_ for unidirectional language-molecule translation. - SFT-Meditron: We fine-tune Meditron-7B on a 10% subset of _L+M-24_ for bi-directional machine language-molecule translation. 4.3 Experimental Settings Here, we train Meditron with CTO on a 10% subset of _L+M-24_ . We experiment with both language and molecule weight initialisation obtained from Meditron trained on the entire data (Edwards et al., 2024). We refer to them as CTO-Meditron _Lan.−−→_ and CTO-Meditron _Mol.−−→_ <sup>, respectively.</sup> <sup>We train the</sup> models with QLoRA (Dettmers et al., 2024). For evaluation, we adopt established metrics in (Edwards et al., 2022). 4.4 Experiment Results Table 2 presents a summary of the moleculeto-language results. We observed a significant decrease in performance for benchmark models trained on extensive data with SFT when tested on out-of-distribution data. Among the baseline models, Meditron demonstrated the highest performance, likely due to its training on the entire _L+M-24_ dataset utilised in our experiments. Training Meditron with SFT for bi-directional languagemolecule translation has demonstrated neither effectiveness (see Table 1) nor efficiency (refer to Appx. B). This suggests that the performance in our experiments is not dependent on memorised patterns from Meditron trained on the entire dataset. In contrast, our models trained with the CTO objective on only 10% of _L+M-24_ achieved a remarkable 2Sampling is conducted from a distinct subset. improvement in performance across diverse evaluation metrics, up to 32% compared to Meditron trained on the entire dataset. This improvement is consistent, as our model consistently enhances performance when initialised from agnostic crossmodals, i.e., CTO-Meditron _−−→Lan_ <sup>in Table 1.</sup> We observed similar performance patterns for language-to-molecule translation as reported in Table 2. However, even though our model achieved better performance compared to Meditron when initialised from agnostic cross-modals, it struggled to learn molecular patterns (see CTO-Meditron _Mol.−−→_ in Table 2). This suggests that language plays a pivotal role in the molecule modality. In the future, we aim to explore more advanced initialised methods to address this challenge. 4.5 Evaluation Results Fig. 2 illustrates the evaluation results on the factual consistency of generated captions against references for the molecule-to-language task. CTOMeditron _Mol.−−→_ <sup>, trained on 10% of the available data,</sup> exhibited superior factual consistency, achieving a semantic overlap of 2.08, _f_ 1 accuracy of 0.34, and answerability of 0.68, compared to 1.34, 0.20, and 0.51, respectively, for Meditron trained on the entire dataset. CTO-Meditron _−−→Lan._ <sup>also outperformed</sup> Meditron but showed lower performance than CTOMeditron _Mol.−−→_ <sup>.</sup> <sup>We attribute this to the model being</sup> initialised by agnostic cross-modals. Meditron CPO-Meditron-Lan CPO-Meditron-Mol (A) Semantic overlap (B) F1 accuracy (C) Answerability Figure 2: Factual consistency in generated captions against references, assessed through (A) semantic overlap, (B) F1 accuracy, and (C) answerability using QAFactEval ( _§_ 3.3) across various LLMs. 25 <u>Model</u> <u>Blue-2</u> _<u>↑</u>_ <u>Blue-4</u> _<u>↑</u>_ <u>Rouge-1</u> _<u>↑</u>_ <u>Rouge-2</u> _<u>↑</u>_ <u>Rouge-L</u> _<u>↑</u>_ <u>METEOR</u> _<u>↑</u>_ <u>TxtChem-T5</u> <u>0.08</u> <u>0.09</u> <u>0.19</u> <u>0.06</u> <u>0.17</u> <u>0.16</u> <u>Chem-LLM</u> <u>0.03</u> <u>0.00</u> <u>0.11</u> <u>0.02</u> <u>0.09</u> <u>0.14</u> <u>Meditron</u> <u>0.42</u> <u>0.30</u> <u>0.63</u> <u>0.47</u> <u>0.49</u> <u>0.54</u> <u>SFT-Meditron</u> <u>0.37</u> <u>0.26</u> <u>0.54</u> <u>0.39</u> <u>0.38</u> <u>0.60</u> <u>0.62 (+0.20)</u> <u>0.45 (+0.15)</u> <u>0.67 (+0.03)</u> <u>0.50 (+0.03)</u> <u>0.48 (-0.01)</u> <u>0.62 (+0.08)</u> <u>CTO-Meditron</u> _<u>Lan−−→</u>_ <u>0.74 (+0.32)</u> <u>0.53 (+0.23)</u> <u>0.76 (+0.10)</u> <u>0.56 (+0.09)</u> <u>0.53 (+0.04)</u> <u>0.71(+0.17)</u> <u>CTO-Meditron</u> _<u>Mol−−→</u>_ Table 1: Molecule-to-language translation results. Arrows next to metrics indicate the higher value the better performance. Numbers in parentheses show deviations from Meditron trained on the entire dataset. <u>Model</u> <u>BLEU</u> _<u>↑</u>_ <u>Exact</u> _<u>↑</u>_ <u>Levenshtein</u> _<u>↓</u>_ <u>MACCS FTS</u> _<u>↑</u>_ <u>RDK FTS</u> _<u>↑</u>_ <u>Morgan FTS</u> _<u>↑</u>_ <u>FCD</u> _<u>↓</u>_ <u>Validity</u> _<u>↑</u>_ <u>TxtChem-T5</u> <u>0.18</u> <u>0.00</u> <u>133.29</u> <u>0.21</u> <u>0.10</u> <u>0.03</u> <u>37.67</u> <u>0.58</u> <u>Chem-LLM</u> <u>0.04</u> <u>0.00</u> <u>732.74</u> <u>0.00</u> <u>0.00</u> <u>0.00</u> <u>59.44</u> <u>0.19</u> <u>Meditron</u> <u>0.43</u> <u>0.00</u> <u>66.16</u> <u>0.35</u> <u>0.29</u> <u>0.19</u> <u>13.64</u> <u>0.57</u> <u>SFT-Meditron</u> <u>0.30</u> <u>0.00</u> <u>186.99</u> <u>0.70</u> <u>0.62</u> <u>0.41</u> <u>11.14</u> <u>0.98</u> <u>CTO-Meditron</u> _<u>Lan.−−→</u>_ <u>0.71 (+0.28)</u> <u>0.00</u> <u>42.65 (-23.51)</u> <u>0.78 (+0.43)</u> <u>0.70 (+0.41)</u> <u>0.48 (+0.29)</u> <u>4.19 (-9.45)</u> <u>1.00 (+0.43)</u> <u>CTO-Meditron</u> _<u>Mol.−−→</u>_ <u>0.52 (+0.09)</u> <u>0.00</u> <u>76.95 (+10.43)</u> <u>0.52 (+0.17)</u> <u>0.49 (+0.20)</u> <u>0.37 (+0.18)</u> <u>27.39 (+13.75)</u> <u>0.58 (+0.01)</u> Table 2: Language-to-molecule translation results. Arrows next to metrics indicate whether higher or lower values denote better performance. Numbers in parentheses show deviations from Meditron trained on the entire dataset. For the language-to-molecule task, we observed that both Meditron _−−→Lan._ <sup>and Meditron</sup> <sup>_−−→_</sup> _Mol._ <sup>achieved</sup> similar performance in terms of uni-, bi-, and tri-gram overlaps between generated and reference pairs, outperforming Meditron (see Fig. 3). However, when the model was initialized with known cross-modal weights, i.e., Meditron _Lan.−−→_ <sup>, it</sup> achieved a slightly increased performance Meditron CPO-Meditron-Lan CPO-Meditron-Mol Char-F Figure 3: Overlaps of n-gram matches between generated and reference molecules as captured by the char-F ( _§_ 3.3) score across various LLMs. For the language-to-molecule task, we observed that Meditron and Meditron _−−→Mol._ <sup>generated signifi-</sup> cantly shorter and longer outputs, respectively (see Fig. 4). In contrast, Meditron _−−→Lan._ <sup>did not exhibit</sup> any length bias, producing outputs similar in length to the actual ones. Conversely, for the moleculeto-language task, our models did not show any significant length bias, while Meditron, trained on the entire dataset, generated significantly shorter answers against references. Meditron CPO-Meditron-Lan CPO-Meditron-Mol (A) Character-level length deviation between generated and reference molecules. (B) Token-level length deviation between generated and reference captions. Figure 4: Length-bias across different LLMs. 5 Conclusion This work address training efficacy and the outof-distribution problem for automatic languagemolecule translation. We train models using only 10% of available data and deploying contrastive preference optimisation which avoids generating translations that are merely adequate but not perfect. We achieve significant improvement in performance when compared with models trained on extensive in and out-of-the-distribution data. Finally, we propose a fine-grained, domain-agnostic evaluation method to assess hallucination in LLMs. Our models show superior factual consistency for caption generation and character-level unigram overlaps for molecule generation. 26 References Microsoft Research AI4Science and Microsoft Azure Quantum. 2023. The impact of large language models on scientific discovery: a preliminary study using gpt-4. _arXiv preprint arXiv:2311.07361_ . Ralph Allan Bradley and Milton E Terry. 1952. Rank analysis of incomplete block designs: I. the method of paired comparisons. _Biometrika_, 39(3/4):324– 345. Zeming Chen, Alejandro Hernández Cano, Angelika Romanou, Antoine Bonnet, Kyle Matoba, Francesco Salvi, Matteo Pagliardini, Simin Fan, Andreas Köpf, Amirkeivan Mohtashami, et al. 2023. Meditron-70b: Scaling medical pretraining for large language models. _arXiv preprint arXiv:2311.16079_ . Dimitrios Christofidellis, Giorgio Giannone, Jannis Born, Ole Winther, Teodoro Laino, and Matteo Manica. 2023. Unifying molecular and textual representations via multi-task language modelling. In _Inter-_ _national_ _Conference_ _on_ _Machine_ _Learning_, pages 6140–6157. PMLR. Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2024. Qlora: Efficient finetuning of quantized llms. _Advances in Neural Information_ _Processing Systems_, 36. Carl Edwards, Tuan Lai, Kevin Ros, Garrett Honke, Kyunghyun Cho, and Heng Ji. 2022. Translation between molecules and natural language. In _Proceed-_ _ings of the 2022 Conference on Empirical Methods_ _in Natural Language Processing_, pages 375–413. Carl Edwards, Qingyun Wang, Lawrence Zhao, and Heng Ji. 2024. L+m-24: Building a dataset for language+ molecules@ acl 2024. _arXiv_ _preprint_ _arXiv:2403.00791_ . Carl Edwards, ChengXiang Zhai, and Heng Ji. 2021. Text2mol: Cross-modal molecule retrieval with natural language queries. In _Proceedings_ _of_ _the_ _2021_ _Conference_ _on_ _Empirical_ _Methods_ _in_ _Natural_ _Lan-_ _guage Processing_, pages 595–607. Alexander Richard Fabbri, Chien-Sheng Wu, Wenhao Liu, and Caiming Xiong. 2022. Qafacteval: Improved qa-based factual consistency evaluation for summarization. In _Proceedings of the 2022 Confer-_ _ence of the North American Chapter of the Associ-_ _ation_ _for_ _Computational_ _Linguistics:_ _Human_ _Lan-_ _guage Technologies_, pages 2587–2601. Fleur M Ferguson and Nathanael S Gray. 2018. Kinase inhibitors: the road ahead. _Nature_ _reviews_ _Drug_ _discovery_, 17(5):353–377. Joey Hejna, Rafael Rafailov, Harshit Sikchi, Chelsea Finn, Scott Niekum, W Bradley Knox, and Dorsa Sadigh. 2023. Contrastive prefence learning: Learning from human feedback without rl. _arXiv preprint_ _arXiv:2310.13639_ . X Zhang, L Wang, J Helwig, Y Luo, C Fu, Y Xie, M Liu, Y Lin, Z Xu, K Yan, et al. 2023. Artificial intelligence for science in quantum, atomistic, and continuum systems. arxiv 2023. _arXiv preprint_ _arXiv:2307.08423_ . Sabrina Jaeger, Simone Fulle, and Samo Turk. 2018. Mol2vec: unsupervised machine learning approach with chemical intuition. _Journal of chemical infor-_ _mation and modeling_, 58(1):27–35. Bernard Kippelen and Jean-Luc Brédas. 2009. Organic photovoltaics. _Energy_ _&_ _Environmental_ _Science_, 2(3):251–261. Shengchao Liu, Weili Nie, Chengpeng Wang, Jiarui Lu, Zhuoran Qiao, Ling Liu, Jian Tang, Chaowei Xiao, and Animashree Anandkumar. 2023a. Multimodal molecule structure–text model for text-based retrieval and editing. _Nature Machine Intelligence_, 5(12):1447–1457. Zequn Liu, Wei Zhang, Yingce Xia, Lijun Wu, Shufang Xie, Tao Qin, Ming Zhang, and Tie-Yan Liu. 2023b. Molxpt: Wrapping molecules with text for generative pre-training. _arXiv preprint arXiv:2305.10688_ . Yizhen Luo, Kai Yang, Massimo Hong, Xingyi Liu, and Zaiqing Nie. 2023. Molfm: A multimodal molecular foundation model. _arXiv preprint arXiv:2307.09484_ . Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. _Advances in neural in-_ _formation processing systems_, 35:27730–27744. Maja Popovi´c. 2015. chrf: character n-gram f-score for automatic mt evaluation. In _Proceedings of the tenth_ _workshop on statistical machine translation_, pages 392–395. Rafael Rafailov, Archit Sharma, Eric Mitchell, Christo pher D Manning, Stefano Ermon, and Chelsea Finn. 2024. Direct preference optimization: Your language model is secretly a reward model. _Advances in Neu-_ _ral Information Processing Systems_, 36. Harald Steck, Chaitanya Ekanadham, and Nathan Kallus. 2024. Is cosine-similarity of embeddings really about similarity? _arXiv_ _preprint_ _arXiv:2403.05440_ . Haoran Xu, Amr Sharaf, Yunmo Chen, Weiting Tan, Lingfeng Shen, Benjamin Van Durme, Kenton Murray, and Young Jin Kim. 2024. Contrastive preference optimization: Pushing the boundaries of llm performance in machine translation. _arXiv preprint_ _arXiv:2401.08417_ . Di Zhang, Wei Liu, Qian Tan, Jingdan Chen, Hang Yan, Yuliang Yan, Jiatong Li, Weiran Huang, Xi angyu Yue, Dongzhan Zhou, et al. 2024. Chemllm: A chemical large language model. _arXiv_ _preprint_ _arXiv:2402.06852_ . 27 Chen Zheng, Ke Sun, Hang Wu, Chenguang Xi, and Xun Zhou. 2024. Balancing enhancement, harmlessness, and general capabilities: Enhancing conversational llms with direct rlhf. _arXiv_ _preprint_ _arXiv:2403.02513_ . Ming Zhong, Siru Ouyang, Yizhu Jiao, Priyanka Kar gupta, Leo Luo, Yanzhen Shen, Bobby Zhou, Xianrui Zhong, Xuan Liu, Hongxiang Li, et al. 2023. Reaction miner: An integrated system for chemical reaction extraction from textual data. In _Proceedings_ _of the 2023 Conference on Empirical Methods in Nat-_ _ural Language Processing:_ _System Demonstrations_, pages 389–402. A Language-molecule Translation Instructions Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: You are a researcher. You can come up captions based on your existing knowledge. Captions are given against the following input. You should be as detailed as possible. ### Input: Molecule: {source molecule} In that molecule, could you formulate a caption about? ### Response:{target caption} Figure 5: Instruction for molecule to language translation, i.e., _M_ _→_ _L_ Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. ### Instruction: You are a researcher. You can come up molecule smile strings based on your existing knowledge. Molecule smile strings are given against the following input. You should be as detailed as possible. ### Input: Caption: {source caption} In that caption, could you generate a molecule smile string? ### Response: {target molecule} Figure 6: Instruction for language to molecule translation, i.e., _L →_ _M_ B Training Effectiveness and Efficiency Figure 7: Training convergence Figure 8: Training efficiency Figure 9: Validation loss 28

섹션 본문 48문단 · 18,046자

(제목 없음)

1The field of chemistry and Artificial Intelligence (AI) intersection is an area of active research that aims to accelerate scientific discovery.The integration of large language models (LLMs) with scientific modalities has shown significant promise in this endeavour.However, challenges persist in effectively addressing training efficacy and the out-of-distribution problem, particularly as existing approaches rely on larger models and datasets.In this context, we focus on machine language-molecule translation and deploy a novel training approach called contrastive preference optimisation, which avoids generating translations that are merely adequate but not perfect.To ensure generalisability and mitigate memorisation effects, we conduct experiments using only 10% of the data.Our results demonstrate that our models achieve up to a 32% improvement compared to counterpart models.Finally, we introduce a fine-grained, domain-agnostic evaluation method to assess hallucination in LLMs and promote responsible use.

Introduction

2The world is facing unprecedented complexity in the form of global challenges such as climate change, healthcare, and pandemics.Innovative scientific solutions are urgently needed to address these challenges.Chemistry has been at the forefront of developing such solutions, pioneering new drugs (Ferguson and Gray, 2018), creating advanced materials (Kippelen and Brédas, 2009), or enhancing chemical processes (Zhong et al., 2023).However, these frontiers are vast and require the involvement of Artificial Intelligence (AI) technology to navigate them effectively.

3Large language models (LLMs) have shown promising potential for accelerating scientific discovery across various domains, including chemistry, biology, and materials science (Zhang et al., 2023;AI4Science and Quantum, 2023).Existing work has applied successful paradigms from natural language processing (NLP) and multimodal representation learning to the chemistry domain.One common approach involves converting the inherent three-dimensional structures of molecules into SMILES, which provide a mapping to symbolic character-level representations.Subsequently, researchers have explored learning language-molecule representations either in separate yet coordinated spaces (Edwards et al., 2022(Edwards et al., , 2021;;Liu et al., 2023a), in a joint space (Liu et al., 2023b), or through hybrid approaches (Luo et al., 2023;Christofidellis et al., 2023).In light of the recent significant advancements in the field, none of the above approaches effectively tackle the inherent challenges in training such models.Instead, they rely on sparse or noisy synthetic data, often necessitating exponentially more data than is typically used in NLP tasks (Edwards et al., 2024).

4However, training on larger models and datasets does not necessarily guarantee higher performance.A successful paradigm that augments the capabilities of LLMs across multiple NLP tasks is Reinforcement Learning with Human Feedback (RLHF) (Ouyang et al., 2022).Although initially challenged by issues of slowness and instability, recent research has addressed many of these challenges by shifting towards closed-form losses that operate directly on offline preference data (Rafailov et al., 2024).RLHF has demonstrated superior performance compared to standard minimising crossentropy optimisation approaches.

5In this context, we address challenges related to effectively training robust language models when integrated with scientific modalities.We deploy a novel way of training LLMs for language-molecule translation that avoids generating translations that are only adequate but not perfect, called contrastive preference optimisation (CTO) (Xu et al., 2024).CTO is based on offline preferences instead of su-pervised fine-tuning, mimicking reference translations.To ensure that our models can effectively generalise instead of memorising patterns, we conduct experiments using only 10% of the L+M-24 dataset (Edwards et al., 2024).Our contributions have as follows:

6• Our models achieve significant performance improvements across various evaluation metrics compared to models trained on extensive indistribution and out-of-distribution data ( § 4.4).• We showcase their robustness through experiments comparing pivot and minor cross-modals.

7Our empirical results demonstrate that our models consistently outperform the leading baseline, Meditron, which is trained on the entire dataset, even in agnostic cross-modal scenarios ( § 4.4).• We propose a fine-grained evaluation method that is domain-independent, assessing factual consistency in generated captions using a questionanswering evaluation metric and measuring overlaps of unigrams in generated molecules against references ( § 3.3).Our analysis shows that our models achieve improved factual consistency and character-level n-gram overlaps for caption and molecule generation ( § 4.5).

Background

8Reinforcement Learning with Human Feedback (RLHF) optimisation (Ouyang et al., 2022) operates with a triple dataset D = {x, y w , y l }, where y w and y l represent preferred and dis-preferred outputs, corresponding to input x, such that y w ≻ y l for x.The probability of y w over y l in pairwise comparisons is typically computed using the Bradley-Terry model (Bradley and Terry, 1952):

9where σ is the logistic function, and r * denotes the reward function that underlies the preferences.

10As obtaining the reward directly from a human would be prohibitively expensive, a reward model r ϕ is trained to act as a surrogate by minimising the negative log-likelihood of the preference data:

11(2) Additionally, the Kullback-Leibler (KL) divergence between the outputs generated by π ref and the parameterised π θ models serves as an additional reward signal, ensuring that the generated responses closely align with the reference model.Conse-quently, an optimal model π θ is one that maximises:

12(3) where β is the temperature parameter typically ∈ [0.1, 0.5].

13RLHF can present challenges due to its inherent slowness and instability, especially in distributed settings (Zheng et al., 2024).Recent work has shifted towards closed-form losses to align LLMs with human preferences.Here, we experiment with contrastive preference optimisation that adopts a closed-form loss for RLHF.

Task Formulation

14Let (x, y) be a pair of source and target sequences mapped to X and Y spaces, respectively.We cast the problem of language-molecule translation as a cross-modal translation task that operates on offline preference data D = {x (i) , y

15, where x is an input, y w are preferred (e.g.human gold standard) and y l dis-preferred outputs (typically synthetic, obtained from an appropriate translation model), and N is the total number of pairs.The goal is to learn an optimal function f : X ↔ Y through a model π θ parameterised by θ.We coordinate the two spaces through instructional modelling to regulate the translation process in both directions.Specifically, for LMolT, we use instructions for language-to-molecule and molecule-to-language translation (see Appx.A).

Contrastive Preference Optimisation

16Contrastive preference optimisation (CTO) (Xu et al., 2024) addresses challenges stemming from the inherent limitation in RLHF, as discussed in § 2, and from the necessity of high-quality data.CTO is a general approximation of Eq. 3 using a uniform reference model, which assumes equal likelihood for all possible generated outputs:

17where π θ is parameterised model by θ and β hyperparameter (please refer § 2).Eq. 4 implies that the loss is calculated based on how well the generated translations match this uniform distribution of possible translations, rather than being biased towards any particular translation.To maintain π θ close to the preferred data distribution, a behaviour cloning (BC) (Hejna et al., 2023) regulariser is introduced:

18Here, ϵ denotes a small positive constant, and KL signifies the Kullback-Leibler divergence.The regulariser is enhanced with an additional SFT term on the preferred data, bolstering the CPO loss as:

Proposed Evaluation Methodology

19Prior studies have utilised embedding representations, for assessing the semantics in chemicaldomain models (Jaeger et al., 2018;Edwards et al., 2021;Christofidellis et al., 2023).However, these approaches require domain adaptation for out-ofdistribution data (Edwards et al., 2024) and might lead to opaque and arbitrary outcomes (Steck et al., 2024).We address these limitations by introducing a scalable fine-grained evaluation methodology for assessing the presence of hallucinations1 in generated outputs.

Language

20Evaluation: For molecule-tolanguage translation, we deploy the QAFactEval (Fabbri et al., 2022) metric to evaluate the factual consistency of generated captions.QAFactEval first selects noun phrases and named entities (NER) from the generated outputs.A question generation (QG) model then formulates associated questions, which a question answering (QA) model addresses based on the reference text.QAFactEval measures the semantic overlap between the QA model's responses and the selected answers to produce the final metric score.An example is illustrated in Fig. 1.Here, we report the semantic overlap, the f 1 accuracy between the QA model and the selected answer, and answerability, which is the probability of the question being answered by the reference caption.

Reference Caption

21It belongs to the orexin receptor modulator class of molecules.

Generated Caption

22The molecule is an antiviral.

Generated Question

23What is the molecule?

24QA Output Orexin receptor modulator Scores Overlap: 0.5, f1: 0.0, Is answered: 0.5 Molecule Evaluation: For language-to-molecule translation, we employ the Chr-F metric, an F-score statistic, to evaluate character n-gram matches between prediction-reference pairs (Popović, 2015).This metric assesses the matches in generated molecules against their references by averaging the scores of unigram, bigram, and trigram matches.A higher Chr-F score indicates better performance.

25Bias Evaluation: We also calculate the character and token length bias in generated-reference pairs of molecules and captions, respectively, to investigate potential length bias in the evaluated LLMs.

Data

26We conduct experiments on the L+M-24 benchmark dataset, which encompasses both molecule and linguistic modalities (Edwards et al., 2024).It is divided into four categories, each with significant applications in small-molecule domain; biomedical; light and electricity; human interaction and organoleptics; and agriculture and industry.The training and validation subsets consist of approximately 127k and 34k language-molecule pairs, respectively.Here, we utilise 10% of these subsets for training and validation.To operationalise CTO, we recreate a triples dataset consisting of preferred and dis-preferred outputs (see § 2), where the former are the golden references and the latter are generated from MolT5 (Edwards et al., 2022).For evaluation, we randomly selected 3k unseen pairs from a distinct dataset provided by the research group of L+M-24. 2

Bechmark Models

27We compare our results with established languagemolecule models as captured in the literature: • TxtChem-T5 (Christofidellis et al., 2023) model fine-tuned on the entire L+M-24 for unidirectional language-molecule translation.• SFT-Meditron: We fine-tune Meditron-7B on a 10% subset of L+M-24 for bi-directional machine language-molecule translation.

Experimental Settings

28Here, we train Meditron with CTO on a 10% subset of L+M-24.We experiment with both language and molecule weight initialisation obtained from Meditron trained on the entire data (Edwards et al., 2024).We refer to them as CTO-Meditron−−→ Lan. and CTO-Meditron−−→ M ol., respectively.We train the models with QLoRA (Dettmers et al., 2024).For evaluation, we adopt established metrics in (Edwards et al., 2022).

Experiment Results

29Table 2 presents a summary of the moleculeto-language results.We observed a significant decrease in performance for benchmark models trained on extensive data with SFT when tested on out-of-distribution data.Among the baseline models, Meditron demonstrated the highest performance, likely due to its training on the entire L+M-24 dataset utilised in our experiments.Training Meditron with SFT for bi-directional languagemolecule translation has demonstrated neither effectiveness (see Table 1) nor efficiency (refer to Appx.B).This suggests that the performance in our experiments is not dependent on memorised patterns from Meditron trained on the entire dataset.

30In contrast, our models trained with the CTO objective on only 10% of L+M-24 achieved a remarkable 2 Sampling is conducted from a distinct subset.

31improvement in performance across diverse evaluation metrics, up to 32% compared to Meditron trained on the entire dataset.This improvement is consistent, as our model consistently enhances performance when initialised from agnostic crossmodals, i.e., CTO-Meditron− − → Lan in Table 1.We observed similar performance patterns for language-to-molecule translation as reported in Table 2.However, even though our model achieved better performance compared to Meditron when initialised from agnostic cross-modals, it struggled to learn molecular patterns (see CTO-Meditron−−→ M ol. in Table 2).This suggests that language plays a pivotal role in the molecule modality.In the future, we aim to explore more advanced initialised methods to address this challenge.For the language-to-molecule task, we observed that both Meditron−−→ Lan. and Meditron−−→ M ol.achieved similar performance in terms of uni-, bi-, and tri-gram overlaps between generated and reference pairs, outperforming Meditron (see Fig. 3).However, when the model was initialized with known cross-modal weights, i.e., Meditron−−→ Lan. , it achieved a slightly increased performance For the language-to-molecule task, we observed that Meditron and Meditron−−→ M ol.generated significantly shorter and longer outputs, respectively (see Fig. 4).In contrast, Meditron−−→ Lan. did not exhibit any length bias, producing outputs similar in length to the actual ones.Conversely, for the moleculeto-language task, our models did not show any significant length bias, while Meditron, trained on the entire dataset, generated significantly shorter answers against references.

Conclusion

32This work address training efficacy and the outof-distribution problem for automatic languagemolecule translation.We train models using only 10% of available data and deploying contrastive preference optimisation which avoids generating translations that are merely adequate but not perfect.We achieve significant improvement in performance when compared with models trained on extensive in and out-of-the-distribution data.Finally, we propose a fine-grained, domain-agnostic evaluation method to assess hallucination in LLMs.

33Our models show superior factual consistency for caption generation and character-level n-gram overlaps for molecule generation.

A Language-molecule Translation Instructions

34Below is an instruction that describes a task, paired with an input that provides further context.Write a response that appropriately completes the request.

Figure 1 :

35Figure 1: A toy example illustrating a factual inconsistency between a generated and a reference caption.The QAFactEval metric selects a noun-phrase answer from the generated caption.A QG model then generates an associated question that a QA model answers based on the reference caption.The scores measure the semantic overlap between the QA model's answer and the selected answer from the generated caption

Fig. 2

36Fig. 2 illustrates the evaluation results on the factual consistency of generated captions against references for the molecule-to-language task.CTO-Meditron−−→ M ol., trained on 10% of the available data, exhibited superior factual consistency, achieving a semantic overlap of 2.08, f 1 accuracy of 0.34, and answerability of 0.68, compared to 1.34, 0.20, and 0.51, respectively, for Meditron trained on the entire dataset.CTO-Meditron−−→ Lan. also outperformed Meditron but showed lower performance than CTO-Meditron−−→ M ol. .We attribute this to the model being initialised by agnostic cross-modals.

Figure 2 :

37Figure 2: Factual consistency in generated captions against references, assessed through (A) semantic overlap, (B) F1 accuracy, and (C) answerability using QAFactEval ( § 3.3) across various LLMs.

Figure 3 :

38Figure 3: Overlaps of n-gram matches between generated and reference molecules as captured by the char-F ( § 3.3) score across various LLMs.

39Character-level length deviation between generated and reference molecules.(B)Token-level length deviation between generated and reference captions.

Figure 4 :

40Figure 4: Length-bias across different LLMs.

41### Instruction: You are a researcher.You can come up captions based on your existing knowledge.Captions are given against the following input.You should be as detailed as possible.### Input: Molecule: {source molecule} In that molecule, could you formulate a caption about?### Response:{target caption}

Figure 5 :

42Figure 5: Instruction for molecule to language translation, i.e., M → L

Figure

43Figure 7: Training convergence

Figure 9 :

44Figure 9: Validation loss

Table 1 :

45Molecule-to-language translation results.Arrows next to metrics indicate the higher value the better performance.Numbers in parentheses show deviations from Meditron trained on the entire dataset.

Table 2 :

46Language-to-molecule translation results.Arrows next to metrics indicate whether higher or lower values denote better performance.Numbers in parentheses show deviations from Meditron trained on the entire dataset.

47Chen Zheng, Ke Sun, Hang Wu, Chenguang Xi, and Xun Zhou.2024.Balancing enhancement, harmlessness, and general capabilities: Enhancing conversational llms with direct rlhf.arXiv preprint arXiv:2403.02513.Ming Zhong, Siru Ouyang, Yizhu Jiao, Priyanka Kargupta, Leo Luo, Yanzhen Shen, Bobby Zhou, Xianrui Zhong, Xuan Liu, Hongxiang Li, et al. 2023.Reaction miner: An integrated system for chemical reaction extraction from textual data.In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 389-402.

48X Zhang, L Wang, J Helwig, Y Luo, C Fu, Y Xie, M Liu, Y Lin, Z Xu, K Yan, et al. 2023.Artificial intelligence for science in quantum, atomistic, and continuum systems.arxiv 2023.arXiv preprint arXiv:2307.08423.

참고문헌

참고문헌 정보가 없습니다.