Group SELFIES: A Robust Fragment-Based Molecular String Representation

Austin Cheng, Andy Cai, Santiago Miret, Gustavo Malkomes, Mariano Phielipp, Alán Aspuru-Guzik · DOI · OpenReview

Abstract

Group SELFIES is a novel molecular string representation that combines the 100% chemical robustness of the SELFIES framework with the intuitive power of fragment-based design. By utilizing tokens that represent entire functional groups rather than individual atoms, Group SELFIES creates more compact strings that better preserve essential chemical motifs during AI-driven molecular generation and optimization. We demonstrate that this representation significantly improves structural integrity in generative tasks while maintaining chemical validity.

Introduction

In the field of "chemical language models," molecules are typically represented as strings. The most common format, SMILES (Simplified Molecular Input Line Entry System), is notoriously fragile: minor changes to a string often result in chemically "illegal" molecules, such as carbons with five bonds. While SELFIES (Self-Referencing Embedded Strings) addressed this by ensuring 100% robustness—where every possible string decodes to a valid molecule—it operates primarily at the atom-and-bond level.

Human chemists, however, conceptualize molecules through functional groups (e.g., benzene rings, sulfonamides). When AI models mutate atom-level strings, they frequently "shatter" these meaningful motifs. Group SELFIES addresses this gap by allowing models to work with larger, chemically significant building blocks without sacrificing the unbreakable nature of the underlying representation.

Methods

Group SELFIES extends the SELFIES framework by introducing "group tokens" into the alphabet. Instead of basic atomic tokens like [C] or [N], the representation includes tokens such as [:0toluene] or [:0pyrazole], which represent entire substructures.

Figure 3: Detailed breakdown of a Group SELFIES string, illustrating the use of group tokens, attachment indices, and navigation logic.

To manage these complex blocks, the system employs a navigation mechanism involving attachment indices and a [pop] token. This allows the decoder to enter a group at a specific point, navigate its internal structure, and then "pop" back to the main molecular chain. Like its predecessor, Group SELFIES uses a state-machine-based decoder that tracks available valency. If a proposed bond violates chemical laws, the decoder automatically adjusts the bond order or ignores the instruction, ensuring the output is always a valid molecule.

Key Insights and Results

The inclusion of functional groups provides a powerful inductive bias. Models do not need to relearn how to construct common motifs like benzene rings from scratch. This leads to several key advantages:

  • Compactness: Group SELFIES strings are significantly shorter than SMILES or SELFIES. On the ZINC-250k dataset, Group SELFIES achieved the highest information density, with a compressed file size of 3.61 MB compared to 3.70 MB for SMILES.
  • Structural Integrity: Random sampling tests on the NFA (Nonfullerene Acceptors) dataset revealed that Group SELFIES preserved aromatic rings in ~49% of generated molecules, whereas regular SELFIES only preserved them in ~2% of cases.
  • Distribution Learning: In Variational Autoencoder (VAE) experiments using the MOSES framework, Group SELFIES outperformed regular SELFIES on the Fréchet ChemNet Distance (FCD), indicating that generated molecules more closely match the training set's properties.
Figure 1: Comparison of SELFIES and Group SELFIES under token shuffling. Group SELFIES preserves complex motifs (like rings) that are typically destroyed in atom-level representations.

Limitations and Future Work

While Group SELFIES offers significant advantages, it introduces a computational overhead; encoding is approximately 65x slower than regular SELFIES due to the requirement for substructure matching. Additionally, the current implementation does not support overlapping groups, requiring the encoder to prioritize one group over another. Future work will focus on optimizing encoding speed, implementing robust global chirality support, and developing automated methods for optimal group set selection.

Summary updated

BibTeX
@inproceedings{cheng2023group,
  author = {Austin Cheng and Andy Cai and Santiago Miret and Gustavo Malkomes and Mariano Phielipp and Alán Aspuru-Guzik},
  title = {{Group SELFIES: A Robust Fragment-Based Molecular String Representation}},
  booktitle = {Digital},
  year = {2023},
  doi = {10.1039/d3dd00012e},
}
Figure