Source-linked AI summary
SELFIES and the future of molecular string representations
Mario Krenn, Qianxiang Ai, Senja Barthel, Nessa Carson, Angelo Frei, Nathan C. Frey, Pascal Friederich, Théophile Gaudin, Alberto Alexander Gayle, Kevin Maik Jablonka, Rafael F. Lameiro, Dominik Lemm, Alston Lo, Seyed Mohamad Moosavi, José Manuel Nápoles-Duarte, AkshatKumar Nigam, Robert Pollice, Kohulan Rajan, Ulrich Schatzschneider, Philippe Schwaller, Marta Skreta, Berend Smit, Felix Strieth-Kalthoff, Chong Sun, Gary Tom, Guido Falk von Rudorff, Andrew Wang, Andrew White, Adamo Young, Rose Yu, Alán Aspuru-Guzik
TL;DR
AI-driven chemistry needs molecular string representations that support valid machine generation, because SMILES can produce syntactic and semantic errors. The paper reviews modern alternatives, presents SELFIES as a robust formal-grammar approach, and proposes 16 future projects spanning chemical domains, AI, and interpretability. SELFIES has improved, simplified, or enabled applications including genetic algorithms, curiosity-based exploration, and efficient combinatorial methods.
Problem
SMILES-based generative models can produce strings with syntactic or semantic errors, while complex bonding domains lack unambiguous bonding definitions and standard valences.
Method
The paper reviews molecular string representations and proposes robust-language extensions, applications, and interpretability projects, including formal-grammar approaches based on stateful derivation rules.
Results
SELFIES has been shown to improve, simplify, or enable AI-driven cheminformatics applications, including genetic algorithms, curiosity-based exploration, and efficient combinatorial methods.
Takeaways & Limitations
The proposed challenges could advance AI applicability across chemistry and support understanding of the principles machines use in complex chemical tasks.
Abstract
from arXiv · showhide
Artificial intelligence (AI) and machine learning (ML) are expanding in popularity for broad applications to challenging tasks in chemistry and materials science. Examples include the prediction of properties, the discovery of new reaction pathways, or the design of new molecules. The machine needs to read and write fluently in a chemical language for each of these tasks. Strings are a common tool to represent molecular graphs, and the most popular molecular string representation, SMILES, has powered cheminformatics since the late 1980s. However, in the context of AI and ML in chemistry, SMILES has several shortcomings -- most pertinently, most combinations of symbols lead to invalid results with no valid chemical interpretation. To overcome this issue, a new language for molecules was introduced in 2020 that guarantees 100\% robustness: SELFIES (SELF-referencIng Embedded Strings). SELFIES has since simplified and enabled numerous new applications in chemistry. In this manuscript, we look to the future and discuss molecular string representations, along with their respective opportunities and challenges. We propose 16 concrete Future Projects for robust molecular representations. These involve the extension toward new chemical domains, exciting questions at the interface of AI and robust languages and interpretability for both humans and machines. We hope that these proposals will inspire several follow-up works exploiting the full potential of molecular string representations for the future of AI in chemistry and materials science.
I. INTRODUCTION
Chemical representations evolved from specialized nomenclature and notation systems toward computer-readable molecular strings, while AI and ML have expanded the need for effective chemical languages. This motivates robust representations such as SELFIES and the paper’s proposed future projects.
- AI and ML now support quantum chemistry, molecular dynamics, property and reactivity prediction, and artificial molecular design.
- SMILES became a prominent computational-chemistry representation, but generative models can produce strings that do not represent valid molecular graphs.Many efforts addressed this through model-dependent solutions that fix robustness inside ML algorithms.
- SELFIES defines a formal grammar that always leads to a valid molecular graph, simplifying applications and enabling new ones in cheminformatics.The paper reviews progress and formulates 16 concrete projects and challenging ideas for future work.
- Earlier chemical notation progressed from specialized elemental symbols and nomenclature systems to ASCII-compatible line notations for computer storage and processing.Historical developments included Dalton’s symbols, Berzelius’s terminology, IUPAC standardization, Dyson’s notation, and later computer-oriented systems.
- Dalton’s highly specialized symbols were difficult to learn and incompatible with contemporary printing methods, limiting circulation of his work.
- The 1949–1951 notation proposals emphasized simplicity, printing, and typewriting, while later efforts targeted large-scale data storage and machine readability.The Army Chemical Typewriter exemplified hardware designed to codify molecules.
III. MODERN MOLECULAR STRING REPRESENTATIONS
Modern molecular string representations encode molecular graphs through different syntaxes, but they differ in uniqueness, robustness, expressiveness, and suitability for generative models. SMILES motivated alternatives including INCHI, DEEPSMILES, and the fully robust SELFIES grammar.
- SMILES: SMILES represents molecules as atom chains, using parentheses for branches and matching numbers for ring closures, while supporting stereochemistry, aromatic bonds, chirality, ions, and isotopes.
- SMILES: Multiple SMILES strings can represent the same molecule, complicating databases that require each structure to map to a unique label and vice versa.
- SMILES: SMILES lacks mechanisms ensuring syntactic and semantic validity, allowing malformed strings and graphs that violate chemical constraints.Examples include unmatched parentheses and neutral oxygen assigned three bonds.
- SELFIES: SELFIES uses a stateful formal automaton in which derivation rules encode physical constraints and every string execution produces a valid molecular graph.
- INCHI: INCHI uses layered syntax to encode chemical formula, atomic connections, charges, and stereochemistry, providing canonical molecular representations for database linking.
- INCHI: INCHI encodes hierarchical and additional molecular information, including mobile hydrogens, while its complex syntax can be difficult for humans to read.
- DEEPSMILES: DEEPSMILES changes ring-closure and branching syntax to resolve most syntactical mistakes in deep generative models, but semantic errors remain possible.Its remaining semantic limitations motivate an even more robust molecular grammar.
D. SELFIES
SELFIES guarantees that every symbol combination maps to a chemically valid molecular graph, addressing invalid outputs from SMILES-based generative models. Its formal grammar and state-based automaton support robust generation and have simplified or enabled AI applications in cheminformatics.
- Robustness: SELFIES is 100% robust because every combination of symbols maps to a chemically valid graph.This robustness is designed to eliminate syntactically and semantically invalid molecules in generative tasks.
- Syntax design: SMILES can generate invalid strings through unmatched parentheses or ring-closure symbols because branches and rings are defined non-locally.SELFIES instead starts branches and rings with special symbols and encodes their lengths through subsequent tokens.
- Formal grammar: SELFIES uses a formal grammar with minimal state memory to enforce physical constraints during molecular derivation.The automaton updates its state at each derivation step, using that state to determine which rules can be applied next.
- Latent-space behavior: In a VAE latent space, SMILES produces scattered valid regions within invalid areas, whereas SELFIES makes every decoded point physically meaningful.The SELFIES latent space supports continuous gradient-descent optimization because the optimizer always produces meaningful structures.
- Applications: SELFIES has improved, simplified, or enabled AI applications including genetic algorithms, curiosity-based exploration, and efficient combinatorial methods.The SELFIES library also provides core functions for translating between SMILES and SELFIES representations.
1. Current capabilities of SELFIES
SELFIES robustly maps strings to molecular graphs and currently covers ordinary organic molecules, while proposed extensions target broader graph domains and macromolecules. These extensions use domain constraints, data-derived rules, and new syntax to preserve validity across more complex structures.
- SELFIES currently represents ordinary organic molecules, including isotopes, charged and radical species, chirality, and stereochemistry.
- SELFIES is a surjective mapping from strings to molecular graphs, whereas SMILES and DEEPSMILES also admit invalid or non-molecular structures.
- metaSELFIES: SELFIES uses domain-dependent vertex-degree constraints, but its robust grammar could serve as a domain-independent graph representation when those constraints vary by scientific domain.
- metaSELFIES: metaSELFIES could derive domain-specific rules directly from data, generate 100% robust samples without hand-crafted language design, and support design models across diverse domains.The proposed approach includes use with VAEs or GANs, although quality depends significantly on dataset size and diversity.
- metaSELFIES: A standardized SELFIES registry could share domain-specific derivation rules and facilitate their reuse by the community.
- Macromolecules: Future macromolecular representations would combine BigSMILES-style stochastic repeating patterns with Helm-style amino-acid symbols, extending valid string generation to polymers and biomolecules.Helm-SELFIES may require complex derivation states for monomer entry and exit rules, while BigSELFIES would support stochastic derivation from predefined monomer lists.
V. CRYSTALS
The paper proposes extending SELFIES to robustly represent crystal bond topology through finite labeled quotient graphs, while noting unresolved links between nets and physical properties.
- Crystal-SELFIES: An augmented SELFIES could encode crystal connectivity explicitly, enabling generative and supervised learning on sequences rather than crystal structures or graphs.The representation is intended to inherit the usability and tooling advantages of molecular strings.
- Crystal nets: Crystals can be abstracted as periodic nets whose vertices represent atoms and edges represent bonds, separating connectivity from spatial coordinates.Different faithful embeddings can represent the same underlying net.
- Quotient graphs: Labeled quotient graphs provide finite representations of infinite nets and uniquely determine crystallographic nets up to isomorphism.Unlabeled quotient graphs preserve local neighborhoods but cannot alone distinguish all non-isomorphic nets.
- LQG construction: The proposed quotient-graph construction embeds a net, defines periodic coordinates, groups translationally invariant edges, and assigns directed cell-displacement labels.For 2D and 3D embeddings, the coordinate system uses two or three basis vectors, respectively.
- Open design requirements: Crystal-SELFIES must accommodate quotient-graph self-loops, parallel edges, edge directions, labels, and grammar restrictions on permitted labelings.Suggested treatments include interpreting self-loops and parallel edges as size 1 and size 2 rings.
- Limitations: A central limitation is that net-based representations have obscure connections to crystal physical and chemical properties, which are currently calculated from embeddings.Crystal dimensionality can be derived from an LQG, but broader property calculators remain needed.
VI. BEYOND ORGANIC CHEMISTRY: COMPLICATED BONDS
Extending molecular representations beyond organic chemistry is difficult because inorganic and metal compounds combine unusual bonding, intricate 3D structures, and historical technical limitations. A general representation must address these issues to cover the periodic table’s chemical space.
- Scope of the challenge: Transition-metal, lanthanide, actinide, and main-group metal compounds are difficult for current digital representations because of special bonding situations and intricate 3D structures.The paper also attributes difficulties to technical limitations that evolved for historical reasons.
- Scope of the challenge: A representation covering all elements will fail if it cannot handle these bonding and structural issues, leaving a major part of chemical space inaccessible to cheminformatics and AI.
A. Complex, “fuzzy” bonding situations vs. valence bond theory
The paper examines how ambiguous, multicenter, and delocalized bonding challenges the atom-node, bond-edge model of valence bond representations. Diborane and ferrocene illustrate competing structural descriptions that preserve different chemical facts.
- Role of connectivity: Connectivity information can simplify structural descriptions and may provide an inductive bias that helps machine-learning models generalize.
- Ambiguous bonding: Bonding becomes technically problematic when interactions lack an algorithmically unambiguous definition or vary widely in strength and origin.Standard organic 2c-2e bonds fit molecular graphs better than many inorganic bonding situations.
- Diborane: Diborane representations trade off symmetry, valence-electron counting, and faithful depiction of its three-center two-electron bonding.Standard molecular graphs cannot represent bonds connecting more than two atomic nodes.
- Ferrocene: Ferrocene representations expose conflicts among ionic assumptions, molecular symmetry, spectroscopic equivalence, and electron counting.Only the fully delocalized depiction aligns with crystallographic and spectroscopic data, but it makes electron counting impossible.
- Representation boundary: The examples make the boundary between bonded and non-bonded interactions partly arbitrary when digital representations must encode complex chemical interactions.
B. No “standard” valences
Molecular representations based on standard valences and localized two-center, two-electron bonds struggle with stereochemistry, coordination geometry, and delocalized bonding beyond conventional organic chemistry. Alternative representations address some of these features but introduce complexity and unresolved limitations.
- B. No “standard” valences: Standard valences and the octet rule are unreliable for many main-group, d-block, and f-block compounds.Delocalized metal–ligand bonding and stable hypervalent compounds cannot be captured consistently by fixed valence assignments.
- B. No “standard” valences: Complex organic molecules can exhibit planar, axial, helical, and other stereochemical elements beyond point chirality and alkene cis/trans isomerism.Helicenes and metal complexes exemplify stereochemical behavior that extends beyond the most common carbon-centered cases.
- B. No “standard” valences: Metal complexes span coordination numbers from 2–16 and can adopt geometries such as tetrahedral or square-planar arrangements.Electronic ligand-field effects, rather than only steric repulsion, often determine the coordination geometry.
- B. No “standard” valences: Alternative molecular representations have sought greater fidelity for multicenter bonds and stereochemistry, but no generally applicable solution has emerged.The difficulty reflects the limited applicability of standard valences, two-center bonds, and unambiguous bond-order assignments outside classic organic chemistry.
- B. No “standard” valences: Multicenter and delocalized bonding can be represented with specialized bond types or hypergraphs, but these approaches are difficult to interpret and use.sXBE encodes systems such as benzene, boranes, diborane, and ferrocene; Dietz’s hypergraph approach permits edges containing more than two nodes.
3. “Zero-order” bonds
“Zero-order” bonds offer a backward-compatible way to encode interactions that do not fit conventional bond orders while explicitly representing connected hydrogens. More broadly, the proposed layered architecture separates domain-independent structure from domain-dependent chemical and learned information.
- 3. “Zero-order” bonds: In 2011, Clark proposed zero-order bonds for unconventional interactions and explicit connected-hydrogen counts for connection-table representations.The modifications were designed to address multicenter bonding, unspecified bond orders, and problems caused by implicit hydrogens.
- 3. “Zero-order” bonds: Assigning bond orders is often impossible in d- and f-block chemistry and main-group organometallic compounds without high-level quantum chemical calculations.Electrons may be delocalized across the metal, coordinated atoms, and additional ligand groups.
- 3. “Zero-order” bonds: The paper proposes a domain-independent base layer containing atomic numbers, isotope distributions, and strong pair-wise attractive interactions.The scope of interactions to include in the base layer remains to be defined.
- 3. “Zero-order” bonds: Domain-dependent layers can add stereochemistry, charge, bond order, bond type, ML-derived information, experimental data, and task-specific strategic bonds.Examples include NMR chemical shifts and bonds useful for retrosynthesis or reactivity prediction.
- 3. “Zero-order” bonds: A generally applicable representation must balance coverage of chemical space against strong valence and connectivity rules.Additional property layers may be generated by ML models to provide more nuanced information than binary assignments.
1. Reaction completion
Reaction-completion methods include template-based, graph-based, and text-based approaches, each relying on molecular and reaction representations with distinct requirements. The paper highlights balanced, less redundant representations and robust reaction SELFIES as future directions, while noting major atom-mapping and scalability challenges.
- 1. Reaction completion: Reaction completion is especially representation-sensitive because models must both consume molecular inputs and produce molecular outputs.The relevant tasks include forward reaction prediction, retrosynthesis, and condition or agent completion.
- 1. Reaction completion: Reaction-completion methods fall into template-based, graph-based, and text-based categories.Template methods apply encoded reaction changes, graph methods localize and edit graph changes, and text methods use sequence-to-sequence models.
- 1. Reaction completion: Current reaction datasets are rarely balanced, so representing reactants together with reaction changes could enforce atom counts and remove redundancy.Condensed graphs of reaction encode bond changes rather than repeating major unchanged molecular parts.
- 1. Reaction completion: Atom-mapping quality constrains template extraction, graph edits, and condensed-graph construction, while human labeling is prohibitively time-consuming for large databases.Automated atom mapping can be learned from reactions represented as SMILES, but experimentally observed mappings are typically unavailable directly.
- 1. Reaction completion: A syntactically robust reaction representation could prevent invalid graph edits, whereas a semantically robust one would require a much larger rule system.The paper estimates that a semantically robust reaction SELFIES approach could require over 50,000 rules and would not be scalable if handled conventionally.
VIII. STRINGS AS PROGRAMMING LANGUAGES
The paper reframes molecular strings as programs interpreted into graphs, suggesting that future representations could be substantially more expressive than SMILES or SELFIES. It proposes robust, programmable extensions incorporating three-dimensional structure, loops, and logic for complex molecules.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: Strings, matrices, and images can all represent molecular graphs, so graph representations are not inherently limited to graph-specific formats.The distinction between string-based and graph-based representations partly reflects how the graph is encoded rather than the underlying object represented.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: A molecular string can be viewed as a program whose interpreter produces a graph.SMILES and SELFIES function as simple programming languages in this conceptual framing.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: More powerful molecular programming languages could be Turing-complete and encode arbitrary molecular properties representable in a computer.The paper presents this as a direction for future research rather than an established capability of current representations.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: Proposed SELFIES extensions include three-dimensional information such as bond and dihedral angles to map directly to specific molecular conformers.Such representations could support structure generation and embedding while reducing the need for extensive conformer searches.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: Meta-characters for loops and logic could repeat substructures or create symmetric branches for larger molecules such as polymers and crystals.The proposal extends SELFIES toward programmable construction of complex molecular structures.
- VIII. STRINGS AS PROGRAMMING LANGUAGES: The paper raises the possibility of a 100% robust, Turing-complete language in which every instruction-string combination produces a valid program.It connects this idea to robust programming-language questions studied in artificial life and artificial evolution.
IX. COMPARING STRINGS, ADJACENCY MATRICES AND IMAGES AS MOLECULAR GRAPH REPRESENTATIONS FOR ML
The paper proposes benchmarking image, adjacency-matrix, and string representations under matched ML tasks and data regimes. The comparison should assess prediction quality alongside training, model-size, data-size, and molecular-size factors.
- Strings are generally expressive and easy to generate, whereas adjacency matrices offer permutation invariance and images can exploit pretrained CNNs.
- Strings, matrices, and images support different model families: language models, GNNs, and CNNs, respectively.
- Representation choice may alter memory burden, optimization difficulty, and computational efficiency even when representations encode the same molecular graphs.The proposed analysis connects compression, loss-landscape effects, training dynamics, sequential or parallel processing, and sparsity structures.
- The proposed benchmark compares image, adjacency-matrix, and string representations for graph-based discriminative tasks across varied data regimes.PCQM4M-LSC offers approximately 3.8 million molecules with DFT-estimated HOMO-LUMO gaps for a demanding regression task.
- The evaluation should measure prediction quality against training epochs, parameter counts, training-example counts, and largest-molecule sizes.
- The experiments are intended to provide evidence about which representation-model combinations suit particular practical ML situations.
X. INTERPRETABILITY AND USABILITY OF STRING-BASED REPRESENTATIONS
The paper frames molecular string representations as an interpretability and usability problem for both humans and machines. It proposes experiments spanning human readability, generative-model understanding, and translation across molecular representations.
- For humans: String representations are harder for humans to interpret than molecular images, motivating experimental evaluation of readability.The proposed study measures accuracy, speed, and participant preferences across representations.
- For humans: Future Project 12 compares SMILES, DeepSMILES, SELFIES, and adjacency matrices with at least 50 participants unfamiliar with the representations.
- For humans: Participants would perform substructure-identification and graph-translation tasks, then choose preferred representations.
- For machines: SELFIES-based latent spaces make every point correspond to a valid molecular structure, enabling continuous gradient-descent optimization without invalid valleys.
- For machines: Pasithea’s two-step DeepDreaming procedure changes molecules in discrete steps while adjusting a target logP property almost steadily.The reported behavior is interpreted as evidence that the model captures part of the structure-property relation rather than exploiting robustness alone.
- For machines: DECIMER and STOUT experiments report improved results when SELFIES is used internally, although how robustness produces the improvement remains unclear.STOUT converts SMILES to SELFIES before processing and decodes predicted SELFIES back to SMILES.
- For machines: An RNN trained on SELFIES is reported to be more resistant to overfitting than one trained on SMILES, with greater novelty at similar distribution quality.
- For machines: Future projects propose translating among strings, adjacency matrices, and molecular images to study shared internal representations and combine different ML approaches.Additional regression experiments would compare representations on endpoints including boiling point, logP, pKa, and 3D-sensitive properties.
XI. CONCLUSION
The paper concludes that resolving its 16 proposed challenges could advance AI applications across chemistry and clarify how machines represent and solve complex chemical tasks.
- Resolving the 16 proposed challenges could significantly advance AI applicability across diverse chemical fields and beyond.
- Studying machine interpretability could help human scientists learn which principles or concepts AI uses in complex chemistry tasks.