Functional-Group Knowledge Is Structured in Language Models Before It Is Spoken
Tran Nhat Khang Nguyen, Anh Nguyen, Obed Issakah, Janghoon Ock
Abstract
Language models serve as the reasoning core of agents for chemistry and materials science, where they must interpret molecular structure before planning syntheses or proposing materials. Yet their outputs show only what they say, not what they know. Given a prompt such as ``The primary functional group in 1-Fluorobutane (CCCCF) is'', a small general-purpose model may answer ``the alkyne group'' instead of an alkyl fluoride. The output alone cannot tell whether the model failed to recognize the fluorine or recognized it and failed to say so. We address this by reading the internal representations of five open-source models on prompts covering 92 molecules and 20 functional groups. Even without chemistry training, the models organize functional groups by chemical family, and they encode chemical differences as consistent directions. The shift from thioether (\mathrm{R{-}S{-}R'}) to thiol (), added to ether (\mathrm{R{-}O{-}R'}), lands nearest alcohol (). This structure emerges abruptly in the middle layers, where representations shift from tracking the wording of the prompt to tracking the functional group. The base model names the correct functional group in only 58.5\% of prompts, the lowest of the five, yet it encodes functional-group families and preserves chemically meaningful patterns. Its errors are mostly failures to answer rather than wrong answers. Functional-group knowledge is structured in the model before it is spoken. Chemistry fine-tuning reorganizes it, making functional groups rather than prompt wording dominate the representation. These results suggest that evaluating chemical language models through outputs alone can underestimate the chemical information they encode. Representation analysis can distinguish a lack of knowledge from a failure to express it, which matters when choosing or adapting models for chemical agents.
Create a lesson
Metadata
- Categories
- cs.AI, cs.CL
- Comments
- 14 pages, 5 figures
Related papers
Specialized Large Language Models for Markovian Reasoning: Structural Cache Compression, Transition Pretraining, and Dual-Loop Transformers
Shared title terminologycs.AIHaibin Tong, Liangliang Xin, Yamei Zhu et al.
DocTalk: Enhancing Medical Knowledge Retrieval via Fine-tuned Large Language Models with Chain-of-Thought Reasoning for Robust Clinical Decision Support
Shared title terminologycs.AIAsad Gohar, Md Ariful Islam Mozumder, Moon-Il Joo et al.
Beyond Static Structures: Linking Protein Dynamics to Function via DynaReason-Pro
Shared title terminologycs.AIZhaokang Liang, Mingze Yuan, Quanzheng Li et al.
Do Language Models Trust Their Own Justifications? A Study on Functional Consistency
Shared title terminologycs.AIAlisson Rosa Pereira, Bruno Iochins Grisci
RxnExBench: Benchmarking Vision-Language Models for Structured Chemical Reaction Extraction from Scientific Literature
Shared title terminologycs.AIJiaxing Sun, Junyuan Gao, Ruikang Zhang et al.
Trion-1: Unifying Language, Protein Sequence, and Structure with Diffusion Language Models
Shared title terminologycs.AITianyu Lu, Kaicheng Yang, Jiangtao Feng et al.