SMILES Codes: The text behind molecules
SMILES strings encode molecular structures as text, but tokenization issues make images a clearer medium.
The Simplified Molecular-Input Line-Entry System (SMILES) expresses a molecule as a line of text. Each letter and symbol maps to atoms and bonds, giving chemists a compact way to store and share structures.
Major databases like PubChem and ChEMBL index compounds by their SMILES strings, letting researchers search huge libraries with a simple query. Drawing tools such as OpenChemLib and RDKit use these strings to reconstruct 2D or 3D diagrams for editing and analysis.
AI models in ChemIllusion interpret SMILES or chemical names by converting the strings into image and text data. The system can validate input, generate visualizations, and make choices based on molecule complexity.
Where Text Falls Short
Despite their precision, SMILES codes are not natural text. They look like short strings of characters, but they’re structured sequences where meaning comes from placement, parentheses, ring closures, and unusual tokens like Cl, Br, or c1ccccc1.
This structure poses a serious problem for language models, which rely on tokenizers designed for human language:
Token fragmentation – Most tokenizers split text into chunks that “look” like words. A fragment like C=CC(=O)O might be broken into tokens such as "C", "=", "CC", "(", "=O", "O". The chemical meaning is lost because bonds and atoms are pulled apart arbitrarily.
Overlapping patterns – Elements like Cl or Br are often split into "C" + "l" or "B" + "r", so the tokenizer doesn’t recognize them as halogens.
Ring closures and branches – Digits (1, 2, etc.) and parentheses in SMILES encode structural loops and branches. To a text model, they look like random punctuation or numbers.
Chemical names fare no better. A name like “2,4-dinitrophenylhydrazine” gets shredded into dozens of unrelated subwords, destroying the relationship between its functional groups.
This makes finding patterns much harder for AI models.
Why Images Help
Images bypass the tokenizer bottleneck. Instead of forcing a model to interpret fragile symbol strings, images preserve the entire molecular structure in one view. Some common molecules might exist in the model's training data, but not all. For your molecule to look good, we give the AI all the help we can. By providing images:
Atoms and bonds stay intact – A benzene ring or carboxyl group is seen as a whole, not broken into mismatched tokens.
Spatial context is clear – Branching, rings, and stereochemistry are instantly visible in 2D drawings.
Consistency across representations – While there are multiple valid SMILES strings for a single molecule, a 2D diagram provides a single, unambiguous representation.
Intuitive human alignment – Chemists read images far faster than text. Pairing SMILES with visualizations makes the system accessible to both AI and researchers.
In ChemIllusion, this dual approach—accepting SMILES input but enriching it with automated molecular diagrams—bridges the gap. Together, they unlock accurate generative chemistry art, and human–AI collaboration.