# MoleCode

An LLM-native molecular representation that writes molecules as an explicit, typed graph of atoms and bonds instead of a linear SMILES string, so a language model can read, write and edit chemical structure directly.

MoleCode is an LLM-native, graph-explicit molecular language. Where SMILES encodes a molecule's graph implicitly in a linear string that a model must first reconstruct before it can reason about chemistry, MoleCode writes every atom and bond as a typed declaration with a persistent identifier, serialized as a graph the model can read, write and edit directly.

It converts deterministically and losslessly to and from SMILES and MOL formats through RDKit, with no learned model and no information loss, and the same node-and-edge grammar covers small molecules, polymers, Markush structures, reaction mechanisms and multimodal document parsing.

In the project's benchmarks, SMILES-based accuracy collapses from about 42% on familiar molecules to about 20% on novel ones, while MoleCode holds around 76-80% across all familiarity levels, and its chain-of-thought length grows sub-linearly with molecule size rather than the super-linear growth seen with SMILES.

Website: https://arxiv.org/pdf/2605.16480
