Functional-Group Knowledge Is Structured in Language Models Before It Is Spoken

Language models increasingly 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 (a general-purpose base, three chemistry-trained models, and a reasoning-distilled model) 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 (R−S−R′) to thiol (R−SH), added to ether (R−O−R′), lands nearest alcohol (R−OH). 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 acts less by adding this knowledge than by reorganizing 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.

Authors

Institutions

Publication Details

Journal
ChemRxiv
Published
2026-11-02
DOI
https://doi.org/10.26434/chemrxiv.15011552/v1
Primary Topic
Machine Learning in Materials Science
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

Functional-Group Knowledge Is Structured in Language Models Before It Is Spoken

Janghoon Ock, Obed Issakah, Anh Nguyen, Tran Nhat Khang Nguyen
ChemRxiv
Machine Learning in Materials Science
preprint

Functional-Group Knowledge Is Structured in Language Models Before It Is Spoken

Janghoon Ock, Obed Issakah, Anh Nguyen, Tran Nhat Khang Nguyen
preprint en

Abstract

Language models increasingly 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 (a general-purpose base, three chemistry-trained models, and a reasoning-distilled model) 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 (R−S−R′) to thiol (R−SH), added to ether (R−O−R′), lands nearest alcohol (R−OH). 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 acts less by adding this knowledge than by reorganizing 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.

ChemRxiv
University of Nebraska–Lincoln (US)
Machine Learning in Materials Science
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon