MoleCode unlocks structural intelligence in large language models
Zhiyuan Yan, Chen Liu, Boxuan Zhao, Kaiqing Lin, Jixiang Zhao, Yimi Wang, Liuzhenghao Lv, Hao Li, Shanzhuo Zhang, Li Yuan, Fanyang Mo · 2026
Read MoleCode unlocks structural intelligence in large language models by Zhiyuan Yan, Chen Liu, Boxuan Zhao, Kaiqing Lin, Jixiang Zhao, Yimi Wang, Liuzhenghao Lv, Hao Li, Shanzhuo Zhang, Li Yuan, Fanyang Mo (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-16480.txt.
Introduction
Yan and ten others present MoleCode, an LLM-native, training-free, graph-explicit molecular language with typed items, lasting IDs, and stated relations. Molecules are graphs, but language models usually reason about them through linear strings, and SMILES compresses atoms, bonds, branches, and rings into a compact sequence with implicit topology. MoleCode makes its topology directly readable, editable, and auditable, letting models operate on structure rather than recover it from syntax. Across reasoning, editing, generation, and analysis tasks, the shift helps frontier models most when structural access limits performance.
Catalog record
| CREATOR | Zhiyuan Yan, Chen Liu, Boxuan Zhao, Kaiqing Lin, Jixiang Zhao, Yimi Wang, Liuzhenghao Lv, Hao Li, Shanzhuo Zhang, Li Yuan, Fanyang Mo |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 68322 |
| LICENSE | http://creativecommons.org/publicdomain/zero/1.0/ |
| RIGHTS | CC0 |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2605.16480
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MoleCode unlocks structural intelligence in large language models Zhiyuan Yan, Chen Liu, Boxuan Zhao, Kaiqing Lin, Jixiang Zhao, Yimi Wang, Liuzhenghao Lv, Hao Li, Shanzhuo Zhang, Li Yuan, Fanyang Mo Abstract Molecules are graphs, but large language models (LLMs) are usually asked to reason about them through linear strings. The most popular molecular representation, SMILES, compresses atoms, bonds, branches and rings into a compact sequence in which topology is implicit, forcing LLMs to reconstruct molecular structure before performing the requested chemical operation. Here we introduce MoleCode , an LLM-native, training-free, graph-explicit molecular language in which all molecular components are represented as typed entities with persistent identifiers and explicit relations. MoleCode makes molecular topology directly readable, editable and auditable within the language context, allowing an LLM to operate on structure rather than recover it from syntax. Across molecular reasoning, editing, generation and analysis tasks, this representational shift improves frontier LLMs most strongly when structural access is limiting: unfamiliar molecules, topology-sensitive operations, larger structures and repetitive polymers. It also changes how inference is allocated, replacing long reasoning traces devoted to implicit structural reconstruction with shorter, more chemically directed reasoning over explicit atoms and bonds. In molecular optimization, this enables localized, property-aligned edits that preserve structural similarity to the starting compounds. The same Subgraph–Node–Edge grammar extends beyond small molecules to polymers, Markush structures, mechanism-style transformations and interleaved scientific documents, including research articles and patent disclosures in which chemical information is distributed across text and images. These results suggest that the interface between scientific objects and LLMs should not treat structure as something to be decoded from text. When the object of reasoning is relational, the structure itself should be part of the language. 1]Peking University Shenzhen Graduage School 2]AtomFlow *]Equal Contribution {\dagger} ]Correspondence: [email protected] , [email protected] \checkdata [Project Page] https://atomflow-ai.com Figure 1 : MoleCode makes structure explicit, editable, and operable for LLMs. a , Implicit and explicit representations of the same molecule. Conventional molecular strings such as SMILES flatten molecular graphs into semantically arbitrary token sequences in which topology is implicit and must be reconstructed during reasoning. MoleCode instead encodes atoms and bonds as explicit graph representations with persistent identifiers and readable structural semantics. b , MoleCode abstract grammar. MoleCode is built mainly from three primitives: Subgraph , Node , and Edge . Subgraphs define structural scopes, nodes encode typed entities with persistent identifiers, and edges encode explicit relations between nodes. c , Implementation examples of MoleCode. A complex molecule can be represented either as a single graph or as multiple subgraphs while preserving exact topology and deterministic equivalence. d , Deterministic bidirectional conversion between domain formats and MoleCode. Existing molecular representations, including MOL files and SMILES, can be converted to and from MoleCode in a deterministic manner without loss of structural information. e , Structure-aware molecular manipulation through explicit graph operations. A frontier LLM edits a molecule directly in MoleCode space by performing localized graph modifications. f , Standardized LLM workflows using MoleCode. MoleCode supports molecular editing, generation, understanding, and analysis within a unified graph-language interface, enabling frontier LLMs to operate over explicit topology. g , Agentic long-task workflow enabled by MoleCode. For multi-step molecular tasks, an LLM-based coding agent can iteratively reason over a MoleCode graph and perform explicit graph-level actions. Main Large language models (LLMs) are emerging as general-purpose interfaces for molecular science [ 1 , 2 , 39 ] . Beyond predicting molecular properties, they can interpret natural-language instructions, answer chemical questions, propose molecular edits, reason over design constraints and coordinate external tools in multi-step workflows [ 37 , 8 , 40 , 36 , 35 , 10 , 4 , 44 , 29 , 55 ] . This shift changes the role of molecular representation: a molecule is no longer only an input to a specialized predictor [ 13 ] , but rather becomes an object that the model must read, inspect, modify and communicate about through language [ 10 , 4 ] . This creates a fundamental interface problem. Molecules are graphs: atoms are nodes, bonds are edges, and chemical behaviour depends on topology [ 41 , 46 ] . However, the dominant text-based molecular representation, Simplified Molecular Input Line Entry System (SMILES) [ 51 ] , presents this graph as a one-dimensional string [ 19 ] . In SMILES, connectivity is implicit, branches are encoded through syntax and ring closures are represented by positional indices [ 15 , 37 , 18 , 17 ] . Thus, when an LLM is asked to predict the molecular formula, recognize a functional group, make a local edit or satisfy a structural constraint, it must first internally reconstruct the molecular graph before it can reason about the requested operation [ 33 , 53 , 34 , 59 ] . This bottleneck reflects a broader principle: representations shape what kinds of reasoning are easy [ 57 , 58 ] . Arabic numerals with positional notation made arithmetic scalable by turning magnitude and place into explicit symbols [ 47 ] . The structural formulas transformed chemistry by making explicit representations of the molecular composition and connectivity [ 38 , 49 ] . For LLM-based molecular science, the analogous question is whether molecular topology is directly available as part of the language interface, or hidden behind syntax that the model must decode [ 19 , 37 ] . Existing molecular representations and models only partially address this issue. SELFIES [ 24 ] and T-SMILES [ 52 ] improve syntactic validity and robustness, but still present molecules as sequential strings rather than explicit node-edge declarations. Graph neural networks [ 12 , 23 , 43 , 41 ] operate directly on molecular topology and have achieved strong performance in property prediction and molecular representation learning [ 60 , 16 , 31 ] . However, they are typically specialized predictors rather than general interfaces for open-ended molecular reasoning, natural-language constraints and iterative editing [ 41 , 3 , 32 , 56 , 11 ] . Hybrid graph-language systems attempt to connect these regimes by projecting molecular graphs into vectors or textual sequences [ 8 , 35 , 48 , 21 ] , but this compression weakens locality, editability and traceability. Thus, current approaches separate two capabilities that should ideally coexist: accurate structural perception and flexible language-based reasoning. To address these challenges, we introduce MoleCode, an LLM-native, training-free, graph-explicit molecular language designed to make molecular topology directly operable by LLMs without modifying model weights. In MoleCode, atoms and bonds are written as typed declarations with persistent identifiers, so connectivity is stated directly rather than inferred from sequential syntax (Fig. 1 a). MoleCode is built from a simple Subgraph–Node–Edge grammar that supports both single graph serializations and hierarchical graph decompositions (Fig. 1 b-c). Standard molecular formats, including MOL files and SMILES, can be converted into MoleCode and reconstructed through deterministic bidirectional pipelines (Fig. 1 d). Because atoms and bonds are explicit textual objects, chemically meaningful edits become localized graph operations, such as adding a methyl group through the addition of one node and one edge (Fig. 1 e). The same interface supports molecular editing, generation, understanding and analysis (Fig. 1 f), and naturally integrates into multi-step agentic workflows in which a coding agent iteratively reasons over, edits and