Fraglingo: Molecular Design via Attachment-Aware Autoregressive Fragment Generation
Summary
Fraglingo introduces an attachment-aware autoregressive model for molecular design that generates molecules by jointly predicting fragment identity and attachment in a continuous latent space, enhancing property control and flexibility.
View Cached Full Text
Cached at: 09/15/26, 08:55 AM
# Fraglingo: Molecular Design via Attachment-Aware Autoregressive Fragment Generation
Source: [https://arxiv.org/html/2609.13519](https://arxiv.org/html/2609.13519)
Thao Nguyen & Jeonghwan Kim & Zhenhailong Wang & Heng JiAffiliation:Siebel School of Computing and Data ScienceAffiliation:University of Illinois Urbana\-ChampaignAffiliation:Urbana, IL 61801, USAEmail:[\{thaotn2,jk100,wangz3,hengji\}@illinois\.edu](mailto:)
###### Abstract
Molecular design is most effective when generation mirrors the edits chemists actually make: extending a scaffold, replacing a substituent, or decorating a scaffold at a specified attachment site while optimizing molecular properties\. Fragment\-based molecular design naturally aligns with this workflow, yet existing methods typically decompose generation into two separate steps: first selecting a fragment from a fixed vocabulary and then predicting how the selected fragment should be connected\. This formulation constrains generation to a fixed fragment vocabulary and makes attachment prediction unnecessarily indirect\. We introduceFraglingo, an autoregressive fragment\-based molecular generator that jointly predicts fragment identity and its attachment in a continuous latent space\. Specifically, Fraglingo predicts an*attachment\-aware fragment embedding*and retrieves the nearest fragment through latent\-space search\. To encode attachment context, we introduce a*wildcard\-anchored readout*that represents both the growing molecule and candidate fragments from the perspective of the active attachment site, enabling a single latent prediction to determine both which fragment to attach and where the new bond should form\. Because prediction is performed in a continuous embedding space rather than over fixed fragment identifiers, Fraglingo allows larger fragment libraries to be introduced at inference time without retraining\. This retrieval\-based formulation provides a unified generation primitive for molecule generation, scaffold generation, scaffold decoration, and molecule optimization\. On controlled property\-conditional benchmarks, Fraglingo achieves stronger joint property control than comparably trained baselines while maintaining competitive validity, uniqueness, and novelty\. Moreover, it generalizes to fragment libraries up to4×4\\timeslarger than those used during training without retraining\.
## 1Introduction
Designing molecules is a constrained structured\-generation problem: a useful model should propose valid chemistry, respect target properties, preserve scaffolds when requested, and make edits at a chemically meaningful level\. Recent molecular generators include sequence models over SMILES\([Weininger, 1988](https://arxiv.org/html/2609.13519#bib.bib8)\)or SELFIES\([Krenn et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib9)\)strings, graph generators over atoms and bonds, and diffusion or flow models over molecular graphs\([Segler et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib16);[Gómez\-Bombarelli et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib17);[Ross et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib18);[Shi et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib19);[Hoogeboom et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib20)\)\. These representations are expressive, but their decisions are often lower\-level than the operations used during medicinal\-chemistry design\. A single syntactic error can invalidate a SMILES sample, and atom\-by\-atom graph generation can require long trajectories before a recognizable motif appears\. Fragment\-based generation, in contrast, offers a more natural formulation\. Medicinal chemists reason through fragment\-level operations, adding, replacing, extending, or decorating motifs, rather than through isolated atoms or syntax tokens\([Hajduk and Greer, 2007](https://arxiv.org/html/2609.13519#bib.bib22);[Kirsch et al\., 2019](https://arxiv.org/html/2609.13519#bib.bib23)\), and fragments turn molecule construction into a sequence of larger, chemically interpretable edits\. However, the standard formulation of fragment generation leaves two unresolved problems\([Jin et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib2);[Kong et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib1);[Yue et al\., 2024](https://arxiv.org/html/2609.13519#bib.bib13)\)\. First, treating fragment selection as discrete classification ties the generation interface to a fixed fragment vocabulary: at inference time, the model can only directly select fragments represented in the output vocabulary used during training\. More critically, fragment selection must specify attachment geometry on both sides: which open site of the growing molecule is being extended, and which point of the retrieved fragment connects to it \(Figure[1](https://arxiv.org/html/2609.13519#S1.F1)\)\. A growing molecule often carries several open wildcards at once, and a fragment embedding conditioned on a global molecular state does not say which site the next fragment attaches to\. This ambiguity is not incidental; it is inherent to asymmetric partial structures, and it is exactly where a global condition fails\.
We proposeFraglingo, which addresses both challenges with a unified design\. It decomposes molecules into fragments and generates them through*next\-fragment prediction*, repeatedly attaching a fragment at an open attachment point\. The framework is agnostic to the fragmentation scheme; in this work, we use BRICS\([Degen et al\., 2008](https://arxiv.org/html/2609.13519#bib.bib11)\)as the primary fragmentation scheme, with an ablation using BFE\([Nguyen and Ji, 2026](https://arxiv.org/html/2609.13519#bib.bib7)\)to assess the effect of the fragmentation method\. Unlike prior fragment generators, Fraglingo replaces the classification head with*attachment\-aware continuous latent retrieval*: instead of predicting a fragment identifier, the model predicts an embedding of the next fragment conditioned on the active attachment site and decodes it by nearest\-neighbor lookup in a table of fragment embeddings produced by the same encoder\. Because prediction is performed in a continuous embedding space rather than over fixed classes, the fragment table can be expanded after training without retraining the model\. To resolve attachment ambiguity, Fraglingo introduces a*wildcard\-anchored readout*, which encodes both the growing molecule and each candidate fragment from the perspective of the active wildcard\. The predicted embedding therefore captures the growing molecule from the viewpoint of the attachment site, allowing retrieval to answer the local question of which fragment best fits a specific attachment point\. Property conditioning further steers generation toward desired molecular attributes\. Together, attachment\-aware continuous retrieval provides a smooth, open\-ended prediction space, while the wildcard\-anchored readout supplies the attachment specificity required for accurate fragment selection\.
A single retrieval primitive then unifies four molecular design tasks that are typically handled by separate models: molecule generation, molecule optimization, scaffold generation, and scaffold decoration\. Molecules and scaffolds are generated autoregressively through fragment assembly, scaffolds are decorated by retrieving branches for specified attachment sites, and molecules are optimized by replacing selected fragments conditioned on a reference molecule\. Across all tasks, generation operates at the fragment level while sharing the same continuous retrieval architecture\. Because the predictor never commits to a fixed set of output classes, it is decoupled from the size of the fragment library, allowing inference over libraries larger than those used during training\. In summary, our contributions are:
- •Wildcard\-anchored readout for attachment\-aware generation\.We introduce a graph readout anchored at the active attachment site, giving each wildcard a distinct, site\-specific representation\. This explicitly couples the growing molecule with the attachment point and resolves the ambiguity that arises when multiple open sites are present, enabling joint prediction of*what*fragment to add and*where*to attach it\.
- •Continuous latent retrieval for next\-fragment prediction\.We formulate fragment generation as retrieval in a learned embedding space\. At each step, the model predicts the embedding of the next fragment and decodes it by nearest\-neighbor search, allowing chemically similar fragments to share representations and enabling inference\-time expansion of the fragment library without retraining\.
- •One retrieval primitive for four molecular design tasks\.Fraglingo unifies four molecular design tasks, including molecule generation, scaffold generation, scaffold decoration, and molecule optimization, within a single fragment\-retrieval framework\.
Figure 1:Possible molecular assemblies from two fragments with ambiguous connectivity\.
## 2Related Work
Early molecular generators represent molecules either as SMILES strings or as molecular graphs\. SMILES\-based methods formulate molecular design as sequence generation using recurrent networks\([Segler et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib16)\), variational autoencoders\([Gómez\-Bombarelli et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib17)\), or Transformer language models\([Ross et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib18)\), while graph\-based methods generate atoms and bonds directly through autoregressive, flow, or diffusion processes\([Shi et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib19);[Hoogeboom et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib20)\)\. Although these approaches differ in representation and architecture, they share a common atom\-level generation paradigm, requiring models to discover chemically meaningful fragments only implicitly while generating atoms or bonds\. Fragment\-based methods move closer to medicinal chemistry by operating on larger chemical units\. HierVAE\([Jin et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib2)\), JT\-VAE\([Jin et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib3)\), PS\-VAE\([Kong et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib1)\), MoLeR\([Maziarz et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib4)\), and FragGPT\([Yue et al\., 2024](https://arxiv.org/html/2609.13519#bib.bib13)\)all rely on a fixed fragment vocabulary, predicting discrete fragment identities before assembling them into molecules\. More recent work has explored alternative fragment representations, including the hierarchical fragment language of t\-SMILES\([Wu et al\., 2024](https://arxiv.org/html/2609.13519#bib.bib14)\)and synthesis\-oriented building\-block representations in SynCoGen\([Rekesh et al\., 2025](https://arxiv.org/html/2609.13519#bib.bib15)\)\. However, these methods continue to generate discrete fragment or building\-block identities from a fixed vocabulary, limiting vocabulary expansion and generalization to unseen fragments\. Fraglingo instead replaces fragment classification with continuous latent retrieval, enabling inference\-time expansion of the fragment library while retrieving fragments from the perspective of the active wildcard, so that fragment selection is conditioned directly on the attachment site\.
## 3Molecular Design via Latent\-Space Autoregressive Fragment Generation
This section first introduces the common generation primitive used by Fraglingo, then explains how the same primitive is adapted to molecule generation, molecule optimization, scaffold generation, and scaffold decoration\. Detailed model design, training objectives, and configuration choices are provided in Appendix[E](https://arxiv.org/html/2609.13519#A5)\.
### 3\.1Molecule / Scaffold Generation
Figure 2:Overview of Fraglingo training and inference across four molecular design tasks\. The architecture shown illustrates unconditional generation, with the GNN encoder and query projector abbreviated for clarity; detailed architectures are provided in Figure[8](https://arxiv.org/html/2609.13519#A5.F8.fig1)\.We model molecule generation as a sequential fragment assembly process\. BRICS decomposition breaks synthetically meaningful bonds and marks each broken bond with wildcard attachment atoms, turning a molecule into fragments\{F1,…,FT\}\\\{F\_\{1\},\\ldots,F\_\{T\}\\\}\. Assembly starts from a cap fragment \(a fragment with only one wildcard\) and expands the fragment tree in breadth\-first order\. At each steptt, the model observes the partial assemblyGtG\_\{t\}with a designated active attachment point and predicts which fragmentFt\+1F\_\{t\+1\}should attach next\. Scaffold generation uses the same formulation, but the training molecules are Murcko scaffolds\([Bemis and Murcko, 1996](https://arxiv.org/html/2609.13519#bib.bib24)\)rather than full decorated molecules\.
The model consists of four components\.\(i\)A shared graph encoderϕ\\phi\(FragmentGPS\) maps both the current partial assembly and candidate fragments intod=256d=256\-dimensional embeddings\. FragmentGPS is a 6\-layer GPS network\([Rampášek et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib10)\), where each layer combines GINE\-style local message passing with global multi\-head self\-attention, followed by a feed\-forward block with residual connections and LayerNorm \(Figure[8](https://arxiv.org/html/2609.13519#A5.F8.fig1)\)\.
\(ii\)The*wildcard\-anchored readout*makes these representations specific to the attachment site\. After FragmentGPS computes hidden representations for the atoms in a graph, the hidden state of the designated wildcard is used as an attention query over the hidden states of the real atoms\. The resulting attention\-weighted summary is the graph embedding\. For the partial assemblyGtG\_\{t\}, letwtw\_\{t\}denote the active wildcard to be extended\. We definee1=ϕ\(Gt,wt\)e\_\{1\}=\\phi\(G\_\{t\},w\_\{t\}\), wheree1e\_\{1\}summarizes the molecular context from the perspective ofwtw\_\{t\}\. Intuitively,e1e\_\{1\}represents the question:which fragment is compatible with this specific attachment point?The same mechanism is used to encode a candidate fragmentft\+1f\_\{t\+1\}\. Letwt\+1w\_\{t\+1\}denote the wildcard through which the candidate would attach\. Its attachment\-conditioned embedding ise2=ϕ\(ft\+1,wt\+1\)e\_\{2\}=\\phi\(f\_\{t\+1\},w\_\{t\+1\}\)\. Thus, both the partial assembly and candidate fragment are represented from the perspective of the two sites that would form the new bond\. This distinction is important for asymmetric fragments with multiple wildcards\. The same fragment can produce*a different embedding for each designated attachment site*\. Retrieval therefore specifies both which fragment to select and which attachment site of that fragment should form the bond\. A single globally pooled embedding would collapse these alternatives into one representation and could not distinguish between them\.
\(iii\)Property conditioning steers this local context toward desired molecular attributes\. In our experiments, we condition on seven molecular properties \(logP, MW, QED, TPSA, HBD, HBA, and RotBonds\) computed using RDKit\([Landrum, 2006](https://arxiv.org/html/2609.13519#bib.bib12)\)\. Their values are projected into thedd\-dimensional embedding space and added to the context embedding:e1cond=e1\+Wp𝐩\+𝐛pe\_\{1\}^\{\\text\{cond\}\}=e\_\{1\}\+W\_\{p\}\\mathbf\{p\}\+\\mathbf\{b\}\_\{p\}\. During training, properties are zeroed with probability 0\.2, enabling classifier\-free guidance at inference\.
\(iv\)A two\-layer MLP projectorff\(MLPMapper\\mathrm\{MLP\}\_\{\\mathrm\{Mapper\}\},d→4d→dd\\rightarrow 4d\\rightarrow d, GELU\) mapse1conde\_\{1\}^\{\\mathrm\{cond\}\}toz^=f\(e1cond\)\\hat\{z\}=f\(e\_\{1\}^\{\\mathrm\{cond\}\}\)\. The model is trained to alignz^\\hat\{z\}with the embeddinge2=ϕ\(Ft\+1\)e\_\{2\}=\\phi\(F\_\{t\+1\}\)of the correct next fragment using InfoNCE\([Oord et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib29)\), while keeping different fragment embeddings discriminative through the classification loss\. A residual vector quantizer \(RVQ; 4 stages with 64 codes per stage\) is applied only during training via a commitment loss to further regularize the embedding space\. The model is trained with three jointly optimized losses:
ℒ=λNCEℒInfoNCE\(z^,e2\)\+λclsℒcls\(e2\)\+λcommitℒcommit\\mathcal\{L\}=\\lambda\_\{\\text\{NCE\}\}\\mathcal\{L\}\_\{\\text\{InfoNCE\}\}\(\\hat\{z\},\\,e\_\{2\}\)\+\\lambda\_\{\\text\{cls\}\}\\mathcal\{L\}\_\{\\text\{cls\}\}\(e\_\{2\}\)\+\\lambda\_\{\\text\{commit\}\}\\mathcal\{L\}\_\{\\text\{commit\}\}\(1\)Here,ℒInfoNCE\\mathcal\{L\}\_\{\\text\{InfoNCE\}\}alignsz^\\hat\{z\}with the correct next\-fragment embeddinge2e\_\{2\}while contrasting it against embeddings of other fragments in the batch\.ℒcls\\mathcal\{L\}\_\{\\text\{cls\}\}encourages the fragment embeddings to remain discriminative, preventing embedding collapse\. Finally,ℒcommit\\mathcal\{L\}\_\{\\text\{commit\}\}encouragesz^\\hat\{z\}to remain close to its RVQ reconstruction, regularizing the predicted embedding toward the quantized representation\. The loss weights are treated as hyperparameters; grid search selectedλNCE:λcls:λcommit=1:0\.5:0\.25\\lambda\_\{\\text\{NCE\}\}:\\lambda\_\{\\text\{cls\}\}:\\lambda\_\{\\text\{commit\}\}=1:0\.5:0\.25\.
After training, the classification head and RVQ are discarded\. We run the trained GNN encoder once over every fragment in the vocabulary and construct a lookup table containing\(F,ϕ\(F\)\)\(F,\\phi\(F\)\)pairs, where each fragment is associated with its learned embedding\. During generation, the MLP predicts the embeddingz^\\hat\{z\}of the next fragment, and Fraglingo retrieves the vocabulary entry whose embedding is nearest toz^\\hat\{z\}\. Specifically, weℓ2\\ell\_\{2\}\-normalize the embeddings and perform nearest\-neighbor search by inner product, which is equivalent to cosine\-similarity retrieval\. The retrieved fragment is then attached to the active wildcard \(Figure[2](https://arxiv.org/html/2609.13519#S3.F2)\)\. In this way, classification is used only to organize the latent space during training, while fragment selection at inference is performed directly through nearest\-neighbor retrieval in the learned embedding space\. That allows new fragments to be added to the inference\-time vocabulary without retraining the model, provided their embeddings can be computed by the trained GNN encoder\.
### 3\.2Molecule Optimization
Molecule optimization asks for local edits that improve target properties while preserving much of the starting molecule\. To condition generation on the molecule being optimized, we add a global reference encoder\. This encoder summarizes the starting molecule so that the model can choose edits that are compatible with the original structure\. Since a complete reference molecule has no open attachment point, we replace the wildcard\-anchored readout with a learned\-query attention pool \(GlobalPool\): a trainable query vector attends over all atoms of the reference molecule, yielding a global embeddingerefe\_\{\\text\{ref\}\}\. The predicted next\-fragment embedding becomes:z^=f\(e1\+Wp𝐩\+𝐛p\+Wreref\)\\hat\{z\}=f\\\!\\left\(e\_\{1\}\+W\_\{p\}\\mathbf\{p\}\+\\mathbf\{b\}\_\{p\}\+W\_\{r\}e\_\{\\text\{ref\}\}\\right\), so generation is jointly conditioned on the current partial assembly, target properties, and the reference structure\. During training,𝐩\\mathbf\{p\}anderefe\_\{\\text\{ref\}\}are each independently dropped out: droppingerefe\_\{\\text\{ref\}\}recovers plain conditional generation, while dropping𝐩\\mathbf\{p\}recovers reference\-anchored generation without a property target\. The optimized molecule is generated with the same fragment\-retrieval process as molecule generation\. Substitutions, insertions, and deletions all emerge naturally through the sequence of fragment predictions\. For example, a deletion corresponds to generating a fragment tree with fewer nodes than the reference molecule\. Similarity to the original molecule is not imposed by a hand\-coded constraint; instead, the model learns the expected degree of preservation from paired training examples through the reference\-conditioning signal\.
### 3\.3Scaffold Decoration
Scaffold decoration uses the same retrieval primitive in a different setting\. Given a fixed Murcko scaffold\([Bemis and Murcko, 1996](https://arxiv.org/html/2609.13519#bib.bib24)\), the task is to independently predict which branch fragment should attach at each growable site\. Unlike autoregressive generation, decoration is a per\-site retrieval problem; the scaffold never changes, and each site is filled in a single forward pass\. The only architectural change is the readout query\. Instead of treating a wildcard as the active attachment site, the query is centered on the scaffold atom at the growable site\. The attachment\-anchored readout \(Eq\.[3](https://arxiv.org/html/2609.13519#A5.E3)\) lets this atom attend to the full scaffold context, producing a representation that askswhich branch best fits this attachment site in this scaffold\. Candidate branches are drawn from a vocabulary of\*\-R fragments, where\*denotes the attachment atom, together with a learned\[NONE\]token that leaves the site undecorated\. Property conditioning and theMLPMapper\\mathrm\{MLP\}\_\{\\mathrm\{Mapper\}\}predictorffare identical to those used for molecule generation\. At inference,z^=f\(e1cond\)\\hat\{z\}=f\(e\_\{1\}^\{\\mathrm\{cond\}\}\)is predicted independently for each growable site from the fixed, undecorated scaffold, and the branch whose embedding is nearest toz^\\hat\{z\}is retrieved from the full branch vocabulary by cosine similarity\.
## 4Experiments
### 4\.1Training Data
We construct task\-specific grids of datasets to study how Fraglingo scales with both vocabulary size and corpus size\. Molecules are first decomposed into fragments using the BRICS algorithm\([Degen et al\., 2008](https://arxiv.org/html/2609.13519#bib.bib11)\), and the fragment vocabulary is defined as thekkmost frequent BRICS fragments in the training corpus\. Each grid is formed by choosing a vocabulary sizekk, retaining examples whose constituent fragments are fully covered by that vocabulary, and then subsampling a corpus of sizeNN\. The resultingk×Nk\\times Ndesign lets us separate the effect of a larger retrieval library from the effect of more training examples while keeping the data\-construction protocol consistent across tasks\. All datasets derive from a shared base corpus of 883M commercially available molecules from ZINC15\([Sterling and Irwin, 2015](https://arxiv.org/html/2609.13519#bib.bib25)\), filtered to molecular weight below 500 Da and retaining only molecules that decompose into at least two BRICS fragments\. Task\-specific datasets are constructed from this corpus as described below\. In all cases, seven molecular properties are computed per molecule using RDKit\([Landrum, 2006](https://arxiv.org/html/2609.13519#bib.bib12)\)for conditioning\. Some of these descriptors are approximately additive over fragments, such as MW and hydrogen\-bond counts, whereas others, such as logP, QED, TPSA, and RotBonds, depend more strongly on the assembled molecular structure and therefore provide complementary conditioning signals; Appendix[E\.4](https://arxiv.org/html/2609.13519#A5.SS4)summarizes each descriptor\. Datasets are divided into train, validation, and test scaffold splits with validation and test held out, using an 8:1:1 ratio\.
Molecule Generation\.The molecule\-generation datasets use fragment vocabularies of sizek∈\{100,500,1000,2000\}k\\in\\\{100,500,1000,2000\\\}and training corpus sizesN∈\{1k,10k,100k,1M\}N\\in\\\{1\\text\{k\},10\\text\{k\},100\\text\{k\},1\\text\{M\}\\\}\.Scaffold Generation\.We extract Murcko scaffolds from the base molecules, yielding approximately 71M unique scaffolds\. Following the protocol above, we use scaffold fragment vocabularies of sizek∈\{50,100,200,500\}k\\in\\\{50,100,200,500\\\}and training corpus sizesN∈\{10k,100k,1M\}N\\in\\\{10\\text\{k\},100\\text\{k\},1\\text\{M\}\\\}\. The smaller vocabulary range reflects the reduced fragment diversity in scaffold space\.Molecule Optimization\.We construct matched molecular pairs from the base corpus using Tanimoto similarity in the range\[0\.70,0\.95\]\[0\.70,0\.95\], ensuring that each pair shares a common scaffold while differing by a small structural modification\. Pairs are further filtered by aligning their BRICS fragment trees and requiring that the transformation corresponds to the insertion, deletion, or substitution of one or two fragments\. Following the construction protocol above, we use fragment vocabularies of sizek∈\{500,1000,2000\}k\\in\\\{500,1000,2000\\\}and training corpus sizesN∈\{10k,100k,1M\}N\\in\\\{10\\text\{k\},100\\text\{k\},1\\text\{M\}\\\}\.Scaffold Decoration\.For scaffold decoration, each molecule is decomposed into a Murcko scaffold and the branches attached to that scaffold\. We rank extracted branches by frequency and retain the top\-kkbranches as the decoration vocabulary, withk∈\{500,1000,2000\}k\\in\\\{500,1000,2000\\\}\. We keep only molecules whose attached branches are all covered by this vocabulary, subsampleN∈\{10k,100k,1M\}N\\in\\\{10\\text\{k\},100\\text\{k\},1\\text\{M\}\\\}molecules, and decompose the retained molecules into scaffold\-plus\-branch training examples: the scaffold provides the fixed core for decoration, and the attached branches serve as the ground\-truth retrieval targets\.
### 4\.2Benchmarking Setup
We choose baselines with publicly available implementations that can be trained under a unified experimental protocol\. Existing open\-source methods primarily target molecule generation and molecule optimization; to the best of our knowledge, no publicly available baselines support scaffold generation or scaffold decoration\. Accordingly, we benchmark Fraglingo against prior work on the two tasks where direct comparison is possible, while evaluating scaffold generation and scaffold decoration through comprehensive self\-evaluation, including generation quality and controlled studies of vocabulary size and training corpus size\. Every model is trained with three independent random seeds, and all reported results are the mean and standard deviation across seeds\. All evaluated models, including Fraglingo, contain between 1\.8M and 6\.4M trainable parameters\.
##### Property\-Conditional Molecule Generation\.
We compare against MolGPT\([Bagal et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib6)\), MolRWKV\([Li et al\., 2025](https://arxiv.org/html/2609.13519#bib.bib21)\), and PS\-VAE\([Kong et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib1)\)\. The selected baselines span complementary generation paradigms, including SMILES autoregression, graph\-enhanced sequence generation, and fragment or subgraph latent\-variable modeling\. To ensure a controlled comparison, all trainable models are retrained on the same 10k\-molecule training corpus used by Fraglingo\. Fragment\-based methods use a shared BRICS vocabulary of 500 fragments, while non\-fragment methods are trained on the corresponding molecular dataset under their native representation\. During evaluation, each model generates 20 molecules for each of 100 randomly sampled target\-property vectors, conditioning jointly on seven molecular properties \(Appendix[E\.4](https://arxiv.org/html/2609.13519#A5.SS4)\)\.
##### Molecule Optimization\.
We compare against MOLLEO\([Wang et al\., 2025](https://arxiv.org/html/2609.13519#bib.bib5)\), HierVAE\([Jin et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib2)\), and JT\-VAE\([Jin et al\., 2018](https://arxiv.org/html/2609.13519#bib.bib3)\), retraining all methods under the same experimental protocol\. All models are trained on the same 10k matched\-pair dataset using a BRICS fragment vocabulary of 500 fragments, with an 8:1:1 scaffold split and three random seeds\. Unlike unconditional property generation, optimization targets must remain chemically close to the reference molecule\. Randomly sampling target\-property vectors frequently produces unattainable objectives or requires large structural changes\. Thus, for each held\-out optimization pair, we use the original molecule together with the target properties of its paired optimized molecule as input\. This guarantees that a chemically plausible solution exists while preserving the intended optimization setting and avoiding unrealistic property shifts\.
### 4\.3Evaluation Metrics
##### Generation quality\.
We report four standard sanity\-check metrics that assess whether a model produces valid, varied, and non\-memorized molecules, independent of property control\.Validitymeasures the fraction of generated outputs that parse as valid RDKit\([Landrum, 2006](https://arxiv.org/html/2609.13519#bib.bib12)\)molecules\.Uniquenessis the fraction of valid molecules with distinct SMILES strings\.Noveltyis the fraction of unique molecules absent from the training set\.Diversityis defined as1−T¯1\-\\overline\{T\}, whereT¯\\overline\{T\}is the mean pairwise Tanimoto similarity over Morgan fingerprints \(radius 2, 2048 bits\), averaged within each condition batch and then across conditions\.
##### Property control\.
We assess property control at the per\-property, joint, and partial levels\.
Single\-property conditioning\.Each of the seven molecular properties is evaluated independently by conditioning the model on a single target property\. For each property, we measure the Spearman correlation between the requested target value and the value of the generated molecule computed using RDKit descriptors\.
Normalized Joint Distance \(NJD\)\.The primary multi\-property metric is the Normalized Joint Distance, defined per molecule as:
NJD=∑p\(y^p−ypσp\)2\\text\{NJD\}=\\sqrt\{\\sum\_\{p\}\\left\(\\frac\{\\hat\{y\}\_\{p\}\-y\_\{p\}\}\{\\sigma\_\{p\}\}\\right\)^\{2\}\}\(2\)wherey^p\\hat\{y\}\_\{p\}andypy\_\{p\}are the achieved and target values for propertypp, andσp\\sigma\_\{p\}is the training\-set standard deviation of propertypp\. Normalizing byσp\\sigma\_\{p\}prevents high\-magnitude properties \(e\.g\., MW in daltons\) from dominating over unit\-bounded ones \(e\.g\., QED∈\[0,1\]\\in\[0,1\]\)\. Lower NJD is better\.
Joint success rate\.We report the fraction of generated molecules where all seven properties simultaneously fall within per\-property absolute tolerances: logP±1\.0\\pm 1\.0, MW±50\\pm 50Da, QED±0\.15\\pm 0\.15, TPSA±20\\pm 20, HBD±1\\pm 1, HBA±2\\pm 2, RotBonds±2\\pm 2\. We evaluate at two tolerance multipliers \(1×,2×1\\times,2\\times\); Joint@1×1\\times\(unscaled\) is the stricter number\.
Partial satisfaction\.Because the all\-or\-nothing joint metric can obscure near\-misses, we also report the mean count of properties individually within their1×1\\timesthreshold \(out of 7\)\. This captures generations that are close but fail on a single property\.
### 4\.4Results
Section[4\.4\.1](https://arxiv.org/html/2609.13519#S4.SS4.SSS1)probes the learned representation and shows that Fraglingo captures an attachment\-aware view of the molecular context\. Section[4\.4\.2](https://arxiv.org/html/2609.13519#S4.SS4.SSS2)shows that Fraglingo achieves the strongest joint property control among comparably trained baselines\. Section[4\.4\.3](https://arxiv.org/html/2609.13519#S4.SS4.SSS3)then demonstrates inference\-time vocabulary expansion, the capability that continuous retrieval uniquely enables\. Appendix[A](https://arxiv.org/html/2609.13519#A1)isolates the contribution of the continuous\-retrieval objective\. Appendix[B](https://arxiv.org/html/2609.13519#A2),[C](https://arxiv.org/html/2609.13519#A3)and[D](https://arxiv.org/html/2609.13519#A4)show that the same primitive transfers to molecule optimization, scaffold generation, and scaffold decoration without modification\.
#### 4\.4\.1The Wildcard Anchor Learns a Attachment\-Aware Representation
The wildcard anchor is motivated by a simple hypothesis: for a fragment with multiple attachment sites, the readout should depend on the active site rather than only on the fragment identity\. We test this directly using 400 asymmetric fragments with exactly two wildcards, which account for 40\.5% of the 1000\-fragment vocabulary\. For each fragment, we compute two readouts, one using each wildcard as the query\. If the wildcard\-anchored readout ignores the choice of attachment site, the two embeddings should be identical\. If it captures attachment\-specific context, the embeddings should differ\. Figure[3](https://arxiv.org/html/2609.13519#S4.F3)\(a\) visualizes the readouts with t\-SNE, linking the two readouts of each fragment and coloring them alike\. Many paired readouts are well separated, indicating that changing the active wildcard substantially alters the embedding\. At the same time, the links are frequently near\-parallel, suggesting that switching the active wildcard induces a consistent transformation in the learned embedding space rather than an arbitrary perturbation\. Figure[3](https://arxiv.org/html/2609.13519#S4.F3)\(b\) makes this concrete: the fragments whose two readouts are most separated are those whose attachment sites sit in clearly different local environments, while the fragments whose readouts nearly coincide are close to symmetric\. The readout is therefore not a noisy copy of a global fragment embedding; it carries a site\-specific view of the same chemistry, separating attachment contexts precisely when the geometry warrants it and collapsing them when it does not\.
Figure 3:\(a\)tSNE visualization of wildcard\-anchored readouts\. Each fragment contributes two readouts, one per wildcard; paired readouts are linked and shown with the same color\.\(b\)fragments with the largest and smallest distances between their two wildcard\-anchored readouts\. Farthest pairs have distinct attachment environments, whereas closest pairs are nearly symmetric\.
#### 4\.4\.2Property\-Conditional Generation Performance
We first evaluate property\-conditional molecule generation against retrained baselines, then study how Fraglingo scales with training corpus and retrieval\-vocabulary size\.
Table 1:Property\-conditional molecule generation benchmarking results\. Each model is followed by a row reporting the standard deviation over 3 runs where available\. Best results are shown inbold; second\-best results areunderlined\.†Wildcard\-anchored readout ablated\.
The difficulty of seven\-way conditioning lies in satisfying all target properties simultaneously\. Table[1](https://arxiv.org/html/2609.13519#S4.T1)shows that Fraglingo with BFE fragmentation\([Nguyen and Ji, 2026](https://arxiv.org/html/2609.13519#bib.bib7)\)gives the strongest joint control, with the lowest NJD \(1\.49\), highest Joint@1×1\\times\(69\.65%\), highest Joint@2×2\\times\(97\.75%\), and highest average number of satisfied properties \(6\.56/7\)\. Among the plain\-BRICS settings, Fraglingo maintains 100% validity, 100% uniqueness, and 100% novelty while the wildcard\-anchored readout ablation degrades joint control \(NJD 2\.1256 and Joint@1×1\\times34\.66%\), supporting the role of the site\-specific readout\. MolGPT and MolRWKV are competitive on several aggregate metrics, whereas PS\-VAE performs substantially worse under this stringent seven\-property conditioning\. Figure[4](https://arxiv.org/html/2609.13519#S4.F4)gives representative conditional generation samples\. The examples illustrate the model can satisfy multiple property targets while producing chemically varied structures rather than repeatedly returning the same fragment pattern\.
Figure 4:Examples from property\-conditionalmolecule generation\. Green marks properties close to the requested target, and yellow marks properties within the acceptable tolerance range\.Table[2](https://arxiv.org/html/2609.13519#S4.T2)separates corpus scale from retrieval\-library size, and the two act differently\. At 1k molecules, the model remains data\-limited: the best setting reaches NJD 3\.93 and Joint@1×1\\times12\.24, while larger vocabularies mainly increase diversity\. Increasing the corpus to 10k sharply improves property control, with the 100\-fragment model reaching NJD 1\.85, Joint@1×1\\times45\.83, and Partial 5\.95/7\. At 100k molecules, the 1000\-fragment model gives the strongest joint control, with NJD 1\.52, Joint@1×1\\times58\.98, Joint@2×2\\times96\.45, and Partial 6\.29/7, while the 500\-fragment model achieves the highest average per\-property correlation \(0\.8052\)\. Scaling to 1M molecules does not uniformly improve over 100k; its best joint\-control setting uses 500 fragments and reaches NJD 1\.57 and Joint@1×1\\times57\.18\. Overall, larger vocabularies consistently increase diversity, but property control is strongest when corpus scale and retrieval\-library size are balanced\.
Table 2:Property\-conditional molecule generation under different vocabulary sizes and training dataset sizes\. Best results are shown inbold; second\-best results areunderlined\.
#### 4\.4\.3Continuous Retrieval Enables Vocabulary Expansion After Training
The continuous\-retrieval formulation enables a capability that classification\-based generators cannot naturally support: because decoding is performed by nearest\-neighbor search in a learned embedding space, the fragment library can be expanded after training without modifying or retraining the model\. We evaluate this capability directly by training with one fragment vocabulary and retrieving from progressively larger libraries at inference time\. Table[3](https://arxiv.org/html/2609.13519#S4.T3)demonstrates this capability\. Expanding the inference library causes the model to select many fragments that were never present in the training vocabulary, while preserving saturated validity, uniqueness, and novelty\. This expansion slightly increases molecular diversity, but it also weakens property control: NJD rises and the average number of satisfied property targets decreases as the retrieval library grows\. The same pattern appears for both the 500\-fragment and 1000\-fragment training settings\. These results show that inference\-time vocabulary expansion provides a practical, training\-free mechanism for exploring a larger chemical space\. The strongest property control is achieved when the retrieval library matches the training distribution, allowing practitioners to trade a modest loss in accuracy for greater chemical coverage without retraining\.
Table 3:Inference\-time vocabulary expansion\.Models are trained with a fixed BFE fragment vocabulary but retrieve against a larger inference library at test time\. OOV Frag\.% is the fraction of selected fragments absent from the training vocabulary\.Inference VocabularyGeneration QualityJoint ControlPer\-Property SpearmanAvg\.OOV Frag\.ValidityUniquenessNoveltyDiversityNJDPartial \(/7\)logPMWQEDTPSAHBDHBARotBonds\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↓\\downarrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)\(↑\\uparrow\)Training \(500\-frags\)100\.099\.9100\.00\.82181\.49286\.560\.87100\.77460\.63730\.82960\.82840\.81900\.79930\.79420\.00%Inference \(1000\-frags\)100\.0100\.0100\.00\.83131\.60286\.400\.86000\.74960\.63230\.84760\.85340\.82800\.79030\.794529\.11%Inference \(2000\-frags\)100\.0100\.0100\.00\.83821\.86286\.160\.86200\.72860\.59530\.82260\.83340\.81500\.77730\.776348\.76%Training \(1000\-frags\)100\.0100\.0100\.00\.83131\.23186\.830\.77400\.88960\.60430\.84560\.73540\.78900\.75230\.77020\.00%Inference \(2000\-frags\)100\.0100\.0100\.00\.83621\.50186\.540\.75600\.86760\.60430\.83760\.73740\.78550\.76530\.764828\.32%
## 5Conclusion, Limitations, and Future Work
Fraglingo introduces a retrieval\-based formulation for fragment\-level molecular design\. Instead of classifying over fixed fragment identifiers, the model predicts a continuous fragment embedding and decodes it by nearest\-neighbor retrieval\. Combined with a wildcard\-anchored readout that conditions retrieval on the active attachment site, this formulation jointly determines fragment identity and attachment while enabling inference\-time expansion of the fragment vocabulary without retraining\. Across molecule generation, scaffold generation, scaffold decoration, and molecule optimization, the same latent retrieval architecture is reused by changing only the retrieval query and conditioning signal\. Fraglingo remains limited by the chosen fragmentation scheme and vocabulary\. Future work includes richer fragmentation strategies, stronger conditioning mechanisms, and scaling retrieval to substantially larger fragment libraries\.
#### Acknowledgments
This work was supported by the NSF Molecule Maker Lab Institute \(MMLI\), an AI Institute for Molecular Discovery, Synthesis Strategy, and Manufacturing, funded by the U\.S\. National Science Foundation under Awards No\. 2019897 and 2505932\.
## References
- V\. Bagal, R\. Aggarwal, P\. Vinod, and U\. D\. PriyakumarMolGPT: molecular generation using a transformer\-decoder model\.Journal of chemical information and modeling62\(9\),pp\. 2064–2076\.Cited by:[§F\.1](https://arxiv.org/html/2609.13519#A6.SS1.p1.1),[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px1.p1.1)\.
- Bemis and Murcko \(1996\)G\. W\. Bemis and M\. A\. MurckoThe properties of known drugs\. 1\. molecular frameworks\.Journal of medicinal chemistry39\(15\),pp\. 2887–2893\.Cited by:[§3\.1](https://arxiv.org/html/2609.13519#S3.SS1.p1.1),[§3\.3](https://arxiv.org/html/2609.13519#S3.SS3.p1.1)\.
- Degenet al\.\(2008\)J\. Degen, C\. Wegscheid\-Gerlach, A\. Zaliani, and M\. RareyOn the art of compiling and using’drug\-like’chemical fragment spaces\.ChemMedChem3\(10\),pp\. 1503–1507\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p2.1),[§4\.1](https://arxiv.org/html/2609.13519#S4.SS1.p1.1)\.
- Freyet al\.\(2023\)N\. C\. Frey, R\. Soklaski, S\. Axelrod, S\. Samsi, R\. Gomez\-Bombarelli, C\. W\. Coley, and V\. GadepallyNeural scaling of deep chemical models\.Nature Machine Intelligence5\(11\),pp\. 1297–1305\.Cited by:[Appendix F](https://arxiv.org/html/2609.13519#A6.p2.1)\.
- Gómez\-Bombarelliet al\.\(2018\)R\. Gómez\-Bombarelli, J\. N\. Wei, D\. Duvenaud, J\. M\. Hernández\-Lobato, B\. Sánchez\-Lengeling, D\. Sheberla, J\. Aguilera\-Iparraguirre, T\. D\. Hirzel, R\. P\. Adams, and A\. Aspuru\-GuzikAutomatic chemical design using a data\-driven continuous representation of molecules\.ACS central science4\(2\),pp\. 268–276\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Hajduk and Greer \(2007\)P\. J\. Hajduk and J\. GreerA decade of fragment\-based drug design: strategic advances and lessons learned\.Nature reviews Drug discovery6\(3\),pp\. 211–219\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1)\.
- Hoogeboomet al\.\(2022\)E\. Hoogeboom, V\. G\. Satorras, C\. Vignac, and M\. WellingEquivariant diffusion for molecule generation in 3d\.InInternational conference on machine learning,pp\. 8867–8887\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Irwinet al\.\(2022\)R\. Irwin, S\. Dimitriadis, J\. He, and E\. J\. BjerrumChemformer: a pre\-trained transformer for computational chemistry\.Machine Learning: Science and Technology3\(1\),pp\. 015022\.Cited by:[Appendix F](https://arxiv.org/html/2609.13519#A6.p2.1)\.
- Jinet al\.\(2018\)W\. Jin, R\. Barzilay, and T\. JaakkolaJunction tree variational autoencoder for molecular graph generation\.InInternational conference on machine learning,pp\. 2323–2332\.Cited by:[§2](https://arxiv.org/html/2609.13519#S2.p1.1),[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px2.p1.1)\.
- Jinet al\.\(2020\)W\. Jin, R\. Barzilay, and T\. JaakkolaHierarchical generation of molecular graphs using structural motifs\.InInternational conference on machine learning,pp\. 4839–4848\.Cited by:[§F\.2](https://arxiv.org/html/2609.13519#A6.SS2.p1.1),[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1),[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px2.p1.1)\.
- Kirschet al\.\(2019\)P\. Kirsch, A\. M\. Hartman, A\. K\. Hirsch, and M\. EmptingConcepts and core principles of fragment\-based drug design\.Molecules24\(23\),pp\. 4309\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1)\.
- Konget al\.\(2022\)X\. Kong, W\. Huang, Z\. Tan, and Y\. LiuMolecule generation by principal subgraph mining and assembling\.Advances in Neural Information Processing Systems35,pp\. 2550–2563\.Cited by:[§F\.1](https://arxiv.org/html/2609.13519#A6.SS1.p3.1),[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1),[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px1.p1.1)\.
- Krennet al\.\(2020\)M\. Krenn, F\. Häse, A\. Nigam, P\. Friederich, and A\. Aspuru\-GuzikSelf\-referencing embedded strings \(selfies\): a 100% robust molecular string representation\.Machine Learning: Science and Technology1\(4\),pp\. 045024\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1)\.
- Landrum \(2006\)G\. LandrumRDKit: open\-source cheminformatics\.Note:[https://www\.rdkit\.org](https://www.rdkit.org/)Cited by:[§3\.1](https://arxiv.org/html/2609.13519#S3.SS1.p4.1),[§4\.1](https://arxiv.org/html/2609.13519#S4.SS1.p1.1),[§4\.3](https://arxiv.org/html/2609.13519#S4.SS3.SSS0.Px1.p1.1)\.
- Laneet al\.\(2025\)T\. R\. Lane, P\. A\. Vignaux, J\. S\. Harris, S\. H\. Snyder, F\. Urbina, and S\. EkinsMachine learning and large language models for modeling complex toxicity pathways and predicting steroidogenesis\.Environmental science & technology59\(27\),pp\. 13844–13856\.Cited by:[Appendix F](https://arxiv.org/html/2609.13519#A6.p2.1)\.
- Liet al\.\(2025\)X\. Li, K\. Gong, Y\. Jiang, Y\. Yang, and T\. LiMolRWKV: conditional molecular generation model using local enhancement and graph enhancement\.Journal of Computational Chemistry46\(10\),pp\. e70100\.Cited by:[§F\.1](https://arxiv.org/html/2609.13519#A6.SS1.p2.1),[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px1.p1.1)\.
- Maziarzet al\.\(2022\)K\. Maziarz, H\. Jackson\-Flux, P\. Cameron, F\. Sirockin, N\. Schneider, N\. Stiefl, M\. Segler, and M\. BrockschmidtLearning to extend molecular scaffolds with structural motifs\.InInternational Conference on Learning Representations \(ICLR\),Note:arXiv:2103\.03864Cited by:[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Nguyen and Ji \(2026\)T\. Nguyen and H\. JiMolLingo: molecule\-native representations for llm\-powered scientific agents\.arXiv preprint arXiv:2605\.27853\.Cited by:[§E\.9](https://arxiv.org/html/2609.13519#A5.SS9.p2.1),[§1](https://arxiv.org/html/2609.13519#S1.p2.1),[§4\.4\.2](https://arxiv.org/html/2609.13519#S4.SS4.SSS2.p2.1)\.
- Oordet al\.\(2018\)A\. v\. d\. Oord, Y\. Li, and O\. VinyalsRepresentation learning with contrastive predictive coding\.arXiv preprint arXiv:1807\.03748\.Cited by:[§3\.1](https://arxiv.org/html/2609.13519#S3.SS1.p5.1)\.
- Rampášeket al\.\(2022\)L\. Rampášek, M\. Galkin, V\. P\. Dwivedi, A\. T\. Luu, G\. Wolf, and D\. BeainiRecipe for a general, powerful, scalable graph transformer\.Advances in Neural Information Processing Systems35,pp\. 14501–14515\.Cited by:[§3\.1](https://arxiv.org/html/2609.13519#S3.SS1.p2.1)\.
- Rekeshet al\.\(2025\)A\. Rekesh, M\. Cretu, D\. Shevchuk, V\. R\. Somnath, P\. Liò, R\. A\. Batey, M\. Tyers, M\. Koziarski, and C\. LiuSyncogen: synthesizable 3d molecule generation via joint reaction and coordinate modeling\.arXiv preprint arXiv:2507\.11818\.Cited by:[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Rosset al\.\(2022\)J\. Ross, B\. Belgodere, V\. Chenthamarakshan, I\. Padhi, Y\. Mroueh, and P\. DasLarge\-scale chemical language representations capture molecular structure and properties\.Nature Machine Intelligence4\(12\),pp\. 1256–1264\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Segleret al\.\(2018\)M\. H\. Segler, T\. Kogej, C\. Tyrchan, and M\. P\. WallerGenerating focused molecule libraries for drug discovery with recurrent neural networks\.ACS central science4\(1\),pp\. 120–131\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Shiet al\.\(2020\)C\. Shi, M\. Xu, Z\. Zhu, W\. Zhang, M\. Zhang, and J\. TangGraphaf: a flow\-based autoregressive model for molecular graph generation\.arXiv preprint arXiv:2001\.09382\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Sterling and Irwin \(2015\)T\. Sterling and J\. J\. IrwinZINC 15–ligand discovery for everyone\.Journal of chemical information and modeling55\(11\),pp\. 2324–2337\.Cited by:[§4\.1](https://arxiv.org/html/2609.13519#S4.SS1.p1.1)\.
- Thomaset al\.\(2024\)M\. Thomas, M\. Ahmad, G\. Tresadern, and G\. De FabritiisPromptSMILES: prompting for scaffold decoration and fragment linking in chemical language models\.Journal of Cheminformatics16\(1\),pp\. 77\.Cited by:[Appendix D](https://arxiv.org/html/2609.13519#A4.p1.1)\.
- Wanget al\.\(2025\)H\. Wang, M\. Skreta, C\. Ser, W\. Gao, L\. Kong, F\. Strieth\-Kalthoff, C\. Duan, Y\. Zhuang, Y\. Yu, Y\. Zhu,et al\.Efficient evolutionary search over chemical space with large language models\.InInternational Conference on Learning Representations,Vol\.2025,pp\. 51694–51727\.Cited by:[§4\.2](https://arxiv.org/html/2609.13519#S4.SS2.SSS0.Px2.p1.1)\.
- Weininger \(1988\)D\. WeiningerSMILES, a chemical language and information system\. 1\. introduction to methodology and encoding rules\.Journal of chemical information and computer sciences28\(1\),pp\. 31–36\.Cited by:[§1](https://arxiv.org/html/2609.13519#S1.p1.1)\.
- Wuet al\.\(2024\)J\. Wu, T\. Wang, Y\. Chen, L\. Tang, H\. Wu, and R\. YuT\-smiles: a fragment\-based molecular representation framework for de novo ligand design\.Nature Communications15\(1\),pp\. 4993\.Cited by:[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
- Yueet al\.\(2024\)J\. Yue, B\. Peng, Y\. Chen, J\. Jin, X\. Zhao, C\. Shen, X\. Ji, C\. Hsieh, J\. Song, T\. Hou,et al\.Unlocking comprehensive molecular design across all scenarios with large language model and unordered chemical language\.Chemical Science15\(34\),pp\. 13727–13740\.Cited by:[Appendix F](https://arxiv.org/html/2609.13519#A6.p2.1),[§1](https://arxiv.org/html/2609.13519#S1.p1.1),[§2](https://arxiv.org/html/2609.13519#S2.p1.1)\.
## Appendix AAblations Attribute the Gains to Continuous Retrieval
Section[4\.4\.2](https://arxiv.org/html/2609.13519#S4.SS4.SSS2)shows that Fraglingo achieves strong property control\. Here, we isolate the contribution of each design component by holding the setting fixed \(10k corpus, 500 fragments, 6\.4M parameters\) and changing one component at a time:
- •Contrastive vs\. regression objective\.Replace InfoNCE with a plain regression loss \(‖z^−e2‖2\\\|\\hat\{z\}\-e\_\{2\}\\\|^\{2\}\) to the true fragment embedding, keeping nearest\-neighbor decoding\. This asks whether the retrieval geometry needs in\-batch negatives or only a target direction\.
- •Classification loss\.Removeℒcls\\mathcal\{L\}\_\{\\text\{cls\}\}to test the embedding\-collapse hypothesis of Section[3\.1](https://arxiv.org/html/2609.13519#S3.SS1): without a discriminative pressure on fragment embeddings, InfoNCE alone may map distinct fragments to overlapping regions\.
- •RVQ regularizer\.Removeℒcommit\\mathcal\{L\}\_\{\\text\{commit\}\}and the codebook to test whether RVQ further organizes the latent space beyond the classification objective, encouraging compact and retrievable fragment embeddings\.
Table 4:Component ablation on the shared 10k\-molecule, 500\-fragment setting\. Each row removes or replaces exactly one component relative to the full model \(top row\); rows are ordered by severity of the resulting drop in joint control\.The ablation cleanly attributes the model’s control to the continuous\-retrieval objective\. Replacing InfoNCE with direct MSE regression is catastrophic: NJD rises from 1\.4928 to 4\.2248, Joint@1×1\\timesdrops from 69\.65% to 26\.85%, and average per\-property correlation falls from 0\.7942 to 0\.1772, essentially destroying property control while generation quality stays intact\. Regressing to a target point is not enough; the contrastive objective, with its in\-batch negatives, is what organizes the embedding space into a geometry where nearest\-neighbor retrieval selects the right fragment\. This is the core mechanism behind the first contribution, and the ablation shows it is not optional but load\-bearing\.
The two regularizers play supporting roles consistent with their design intent\. Removing the classification loss degrades control \(NJD 1\.7878, Joint@1×1\\times56\.52%, Avg\. 0\.7032\), confirming the embedding\-collapse hypothesis: without a discriminative pressure, distinct fragments blur together and retrieval loses precision\. Removing RVQ has the mildest effect \(NJD 1\.5268, Joint@1×1\\times67\.75%\), so RVQ is a light stabilizer rather than a primary signal; we keep it because it costs little and slightly improves control, but the method does not depend on it\.
## Appendix BOne Primitive Transfers to Molecule Optimization
The next three sections evaluate Fraglingo beyond molecule generation, showing how the retrieval mechanism extends to molecule optimization, scaffold generation, and scaffold decoration by changing only the query and conditioning signals\. We begin with molecule optimization\.
Table 5:Molecule optimization against fragment\-based baselines on the shared 10k matched\-pair dataset\. Tanimoto and Sim≥\\geq0\.6 measure preservation of the starting molecule\.We benchmark our Fraglingo’s molecule optimization model against HierVAE and JT\-VAE under the shared matched\-pair optimization protocol\. All optimization models are trained on the same 10k matched\-pair dataset; fragment\-based models use a vocabulary of 500 fragments\. As described in Section[3\.2](https://arxiv.org/html/2609.13519#S3.SS2), reference\-molecule conditioning turns Fraglingo’s attachment\-conditioned retrieval mechanism into a molecule optimizer; here it gives the strongest target matching among the compared fragment\-based methods\. Table[5](https://arxiv.org/html/2609.13519#A2.T5)shows Fraglingo attains the lowest final NJD \(1\.6244\), preserves the starting molecule best among the compared methods \(Tanimoto 0\.7952 and 95\.72% above 0\.6 similarity\), and gives the best average distributional similarity\. Fraglingo makes similarity\-constrained edits when needed to hit multi\-property targets, which is the intended behavior for property\-directed optimization\.
Figure[5](https://arxiv.org/html/2609.13519#A2.F5)shows representative optimization examples produced by Fraglingo\. The examples highlight the intended edit behavior: Fraglingo changes local fragments to move properties toward the target while preserving much of the starting molecule\.
Figure 5:Qualitativemolecule optimizationexamples\. Green marks properties close to target, yellow marks properties within tolerance, and red marks properties outside the target range\.Table 6:Ablation on training corpus size and vocabulary size for molecule optimization\. Tanimoto and Sim≥\\geq0\.6 measure preservation of the starting molecule\.Table[6](https://arxiv.org/html/2609.13519#A2.T6)shows that increasing the matched\-pair training corpus consistently improves target matching, whereas the effect of vocabulary size is more nuanced\. The 1M\-pair, 500\-fragment model achieves the lowest NJD \(1\.2037\), while the 1M\-pair, 1000\-fragment model gives the highest average property\-distribution similarity \(0\.8501\)\. Larger vocabularies can improve preservation for smaller training sets—the 10k\-pair, 2000\-fragment model attains the highest Tanimoto similarity \(0\.7980\)—but do not consistently improve target matching as the corpus grows\. All configurations maintain 100% validity, indicating that training\-set coverage is the primary driver of optimization performance once the vocabulary provides sufficient edit diversity\.
## Appendix C…to Scaffold Generation
We evaluate scaffold generation through controlled self\-evaluation because, to the best of our knowledge, no available scaffold\-generation baseline can be retrained under the same protocol\. The evaluation therefore focuses on whether Fraglingo, when retargeted to scaffold fragments, produces valid ring systems and diverse core topologies \(Figure[6](https://arxiv.org/html/2609.13519#A3.F6)\), and on how property control varies with vocabulary and corpus size \(Table[7](https://arxiv.org/html/2609.13519#A3.T7)\)\. Scaffold generation can be viewed as a constrained version of full\-molecule generation, with retrieval limited to scaffold fragments\.
Figure 6:Qualitativescaffold generationexamples\. Fraglingo assembles scaffold\-level BRICS fragments into valid core structures before side\-chain decoration, producing diverse ring systems and attachment\-ready topologies rather than complete decorated molecules\.Table 7:Scaffold generation under different vocabulary sizes and training dataset sizes\.Table[7](https://arxiv.org/html/2609.13519#A3.T7)shows a stronger vocabulary\-size tradeoff for scaffold\-only generation than for full\-molecule generation, and this pattern remains visible at the 1M training\-corpus scale\. Small vocabularies, especially 100 fragments, give the best joint\-control metrics because they concentrate probability mass on common scaffold motifs and make the retrieval problem easier\. Larger vocabularies increase uniqueness, novelty, and diversity, but the additional rare fragments worsen NJD and joint satisfaction performance\. This behavior is expected for scaffolds: the model must control global core topology with fewer substituent degrees of freedom, so an overly broad scaffold vocabulary can make property\-conditioned retrieval less reliable\.
## Appendix D…and to Scaffold Decoration
Scaffold decoration is again evaluated by self\-comparison across settings rather than against external systems, for the same protocol\-compatibility reason\. Prompt\-based decoration methods such as PromptSMILES\([Thomas et al\., 2024](https://arxiv.org/html/2609.13519#bib.bib30)\)use different conditioning interfaces, while scaffold\-extension methods such as MoLeR are primarily optimized for structural plausibility rather than explicit multi\-property control\. The question here is whether site\-conditioned retrieval chooses chemically plausible branches for a fixed core while keeping scaffold atom indices stable across sites\.
Figure 7:Qualitativescaffold decorationexamples\. For each fixed scaffold, Fraglingo predicts branch fragments at the growable sites under the specified property targets\. The tables report molecular\-property values and signed errors before and after decoration, illustrating how site\-conditioned retrieval can move decorated molecules toward the requested property profile while preserving the scaffold core\.Figure[7](https://arxiv.org/html/2609.13519#A4.F7)illustrates the behavior of the decoration model on fixed scaffolds with explicit property targets\. Because each attachment site is encoded from the viewpoint of the corresponding scaffold atom, the model selects different branch fragments for different local environments while leaving the core unchanged\. Retrieved decorations reduce errors on targeted properties such as TPSA and molecular weight, though improving one property can trade off against weakly constrained descriptors\. This matches the intended use of decoration as a controlled local edit: the scaffold fixes the conserved core, and Fraglingo searches the branch\-embedding space for site\-compatible substituents aligned with the requested profile\.
Table[8](https://arxiv.org/html/2609.13519#A4.T8)quantifies this over the held\-out decoration set\. We report the same generation\-quality and joint\-control metrics as for molecule generation, computed on decorated molecules while the scaffold is held fixed\.
Table 8:Scaffold decorationunder different vocabulary and corpus sizes\. Metrics are computed on decorated molecules with the scaffold held fixed\.Table[8](https://arxiv.org/html/2609.13519#A4.T8)shows that decoration remains a highly controlled local\-edit task\. Increasing the corpus from 10k to 100k consistently improves the aggregate metrics: NJD decreases, Tanimoto similarity increases, partial satisfaction stays near or above 6\.7 out of 7, and the average per\-property correlation rises for every vocabulary size\. The best overall setting is 100k training molecules with a 2000\-fragment vocabulary, which gives the lowest NJD \(0\.71\), highest Tanimoto similarity \(0\.3565\), highest partial satisfaction \(6\.82/7\), and highest average correlation \(0\.9250\)\. A larger 1M corpus remains competitive but does not improve the best aggregate result, indicating that more data is not the main bottleneck once the decoration model has enough matched scaffold–branch coverage\. Vocabulary size has a milder effect than corpus scale: larger vocabularies help most at 100k, but the trend is not monotonic at 10k or 1M\. Across settings, high correlations for TPSA, HBA, HBD, and rotatable bonds indicate that site\-conditioned retrieval can steer decorated molecules toward the requested property profile while preserving the fixed scaffold core\.
## Appendix EDetailed Fraglingo Model Design
The appendix expands the concise method description in Section[3](https://arxiv.org/html/2609.13519#S3)\. We first specify the autoregressive training examples, then detail the encoder, readout, conditioning, predictor, RVQ regularizer, losses, metrics, and model scale\.
### E\.1Generation Framing
We decompose each molecule into fragments using BRICS bond\-breaking rules, yielding a fragment tree with associated attachment\-point wildcards\. For each molecule, we identify the main chain as the longest path in this fragment tree and create two next\-fragment prediction trajectories, one starting from each end of the chain\. Within each trajectory, autoregressive training examples are ordered by a breadth\-first traversal that starts from the selected terminal cap fragment, defined as a fragment with exactly one wildcard\.
At step
tt, the model receives the partial assembly
GtG\_\{t\}with one designated active wildcard atom and must predict the embedding of the fragment that attaches at that site\. A terminal expansion is represented by attaching a cap fragment with a single wildcard, which consumes the active wildcard without introducing another growable site\. Molecule growth stops when the assembly has no remaining wildcard atoms available for expansion\.
### E\.2Graph Encoder: FragmentGPS
All graph\-structured inputs, including both partial assemblies and individual fragments, are encoded by a single shared encoder
ϕ\\phi, FragmentGPS\. FragmentGPS is a 6\-layer GPS \(Graph \+ Transformer hybrid\) network with hidden dimension
d=256d=256\.
Each GPSLayer contains three sub\-modules applied sequentially with residual connections and LayerNorm:
Figure 8:Detailed architecture of Fraglingo’s next\-fragment generation module\.1. 1\.Local message passingvia GINE \(GIN with edge features\): each atom aggregates messages from its bonded neighbors, where bond\-type features are incorporated into the aggregation\.
2. 2\.Global self\-attention: multi\-head self\-attention \(h=8h=8heads\) over all atoms in the graph, giving each atom access to global context regardless of graph distance\.
3. 3\.Feed\-forward block: a position\-wise MLP \(d→4d→dd\\to 4d\\to d, GELU activation\)\.
Dropout of 0\.1 is applied throughout\.
##### Attachment\-anchored readout\.
Standard graph\-level pooling \(mean or sum over atoms\) is replaced by an attachment\-anchored readout: the graph embedding is computed as the attention\-weighted sum of context\-atom representations, where the query vector comes from the active attachment atom\. For autoregressive generation this query atom is the open wildcard; for scaffold decoration it is the active scaffold atom\. Formally, lethqh\_\{q\}denote the active query atom’s final\-layer hidden state andH=\[h1,…,hn\]H=\[h\_\{1\},\\ldots,h\_\{n\}\]the matrix of context\-atom hidden states\. The graph embedding is:
e=softmax\(hqH⊤d\)He=\\operatorname\{softmax\}\\\!\\left\(\\frac\{h\_\{q\}H^\{\\top\}\}\{\\sqrt\{d\}\}\\right\)H\(3\)This anchors the assembly representation to the current attachment point rather than averaging over the whole molecule\. For terminal cap\-fragment prediction, the active wildcard atom’s embedding is used directly as the query\.
### E\.3Property Conditioning
Seven molecular property descriptors are computed per molecule: logP, molecular weight \(MW\), QED, topological polar surface area \(TPSA\), hydrogen bond donors \(HBD\), hydrogen bond acceptors \(HBA\), and the count of rotatable bonds\. Each is z\-scored using per\-dataset statistics computed over the training set\.
The property vector𝐩∈ℝ7\\mathbf\{p\}\\in\\mathbb\{R\}^\{7\}is linearly projected toℝd\\mathbb\{R\}^\{d\}and added to the partial\-assembly embedding before the predictor MLP:
e1cond=e1\+Wp𝐩\+𝐛pe\_\{1\}^\{\\text\{cond\}\}=e\_\{1\}\+W\_\{p\}\\mathbf\{p\}\+\\mathbf\{b\}\_\{p\}\(4\)This is an additive conditioning injection\. During training,𝐩\\mathbf\{p\}is zeroed with probabilitypdrop=0\.2p\_\{\\text\{drop\}\}=0\.2independently per training example, jointly training a conditional and an unconditional model in a single pass\. This enables classifier\-free guidance at sampling time, where the final predicted embedding is interpolated as:
z^guided=\(1\+w\)z^cond−wz^uncond\\hat\{z\}\_\{\\text\{guided\}\}=\(1\+w\)\\,\\hat\{z\}\_\{\\text\{cond\}\}\-w\\,\\hat\{z\}\_\{\\text\{uncond\}\}\(5\)for guidance scalew≥0w\\geq 0\.
### E\.4Conditioning Property Descriptors
We condition on seven RDKit descriptors that cover complementary aspects of molecular design:
- •logPestimates octanol–water partitioning and serves as a proxy for hydrophobicity and membrane permeability\.
- •MWis molecular weight, controlling overall molecule size and often changing approximately additively with fragment additions\.
- •QEDsummarizes drug\-likeness by combining several physicochemical preferences into a single score\.
- •TPSAmeasures topological polar surface area, reflecting polar atom exposure and transport\-related behavior\.
- •HBDandHBAcount hydrogen\-bond donors and acceptors, which affect polarity and binding interactions\.
- •RotBondscounts rotatable bonds and acts as a compact measure of molecular flexibility\.
MW, HBD, and HBA are largely determined by the fragments present, whereas logP, QED, TPSA, and RotBonds also depend strongly on how fragments are assembled\. Together, these descriptors test whether the model can control both fragment\-compositional and structure\-dependent properties\.
### E\.5Predictor:MLPMapper\\text\{MLP\}\_\{\\text\{Mapper\}\}
The conditioned context embeddinge1conde\_\{1\}^\{\\text\{cond\}\}is passed throughMLPMapper\\text\{MLP\}\_\{\\text\{Mapper\}\}, a two\-layer MLP:
z^=W2⋅GELU\(W1e1cond\+b1\)\+b2\\hat\{z\}=W\_\{2\}\\cdot\\operatorname\{GELU\}\(W\_\{1\}\\,e\_\{1\}^\{\\text\{cond\}\}\+b\_\{1\}\)\+b\_\{2\}\(6\)with hidden dimension4d=10244d=1024\. The outputz^∈ℝd\\hat\{z\}\\in\\mathbb\{R\}^\{d\}is the predicted embedding of the next fragment, in the same space as fragment embeddings produced byϕ\\phi\.
### E\.6Discrete Bottleneck: RVQCodebook
A 4\-stage residual vector quantizer \(RVQ\) operates on the predicted embeddingz^\\hat\{z\}during training\. Each stage maintains a codebook of 64 vectors updated via exponential moving averages \(EMA\), with dead\-code reset when a code goes unused for too many steps\. Givenz^\\hat\{z\}, stage 1 finds the nearest codebook vectorc1c\_\{1\}and passes the residualz^−c1\\hat\{z\}\-c\_\{1\}to stage 2; after stagemm, the residual isz^−∑ℓ=1mcℓ\\hat\{z\}\-\\sum\_\{\\ell=1\}^\{m\}c\_\{\\ell\}\. The resulting 4\-tuple of code indices\(k1,k2,k3,k4\)\(k\_\{1\},k\_\{2\},k\_\{3\},k\_\{4\}\)spans644≈16M64^\{4\}\\approx 16\\text\{M\}possible combinations\.
The RVQ is a training\-time regularizer only and plays no role in decoding\. At inference, the normalized predicted embeddingz^\\hat\{z\}is compared directly against a precomputed table of normalized fragment embeddings\{ϕ\(f\)\}f∈𝒱\\\{\\phi\(f\)\\\}\_\{f\\in\\mathcal\{V\}\}via inner product, which is equivalent to cosine similarity, and the fragment with the highest similarity is selected\. The table can be recomputed for a larger inference vocabulary than the one used to form training targets, allowing vocabulary expansion without changing the predictor or adding a new output head\.
### E\.7Training Objective
The model is trained end\-to\-end with three losses, weighted by hyperparameters:
ℒ=λNCEℒInfoNCE\+λclsℒcls\+λcommitℒcommit\\mathcal\{L\}=\\lambda\_\{\\text\{NCE\}\}\\mathcal\{L\}\_\{\\text\{InfoNCE\}\}\+\\lambda\_\{\\text\{cls\}\}\\mathcal\{L\}\_\{\\text\{cls\}\}\+\\lambda\_\{\\text\{commit\}\}\\mathcal\{L\}\_\{\\text\{commit\}\}\(7\)We select these weights by grid search and useλNCE:λcls:λcommit=1:0\.5:0\.25\\lambda\_\{\\text\{NCE\}\}:\\lambda\_\{\\text\{cls\}\}:\\lambda\_\{\\text\{commit\}\}=1:0\.5:0\.25in the reported experiments\.
##### InfoNCE loss\.
For a batch ofBBtraining steps withℓ2\\ell\_\{2\}\-normalized predicted embeddings\{z^i\}\\\{\\hat\{z\}\_\{i\}\\\}andℓ2\\ell\_\{2\}\-normalized true next\-fragment embeddings\{e2,i\}\\\{e\_\{2,i\}\\\}, the InfoNCE loss is:
ℒInfoNCE=−1B∑i=1Blogexp\(z^i⋅e2,i/τ\)∑j=1Bexp\(z^i⋅e2,j/τ\)\\mathcal\{L\}\_\{\\text\{InfoNCE\}\}=\-\\frac\{1\}\{B\}\\sum\_\{i=1\}^\{B\}\\log\\frac\{\\exp\(\\hat\{z\}\_\{i\}\\cdot e\_\{2,i\}/\\tau\)\}\{\\sum\_\{j=1\}^\{B\}\\exp\(\\hat\{z\}\_\{i\}\\cdot e\_\{2,j\}/\\tau\)\}\(8\)using in\-batch negatives\. This is the primary signal driving the predictor to point toward the correct fragment in embedding space\.
##### Fragment classification loss\.
A linear classification head is applied to the true fragment embeddinge2=ϕ\(ft\+1\)e\_\{2\}=\\phi\(f\_\{t\+1\}\)and trained with cross\-entropy over the vocabulary\. This auxiliary loss discourages embedding collapse: without it, InfoNCE alone may not keep fragment embeddings sufficiently discriminative, and the encoder can map multiple fragments to the same region of embedding space\.
##### VQ commit loss\.
The commit loss pulls the continuous predictionz^\\hat\{z\}toward its nearest codebook vector:
ℒcommit=‖z^−sg\(z^quantized\)‖2\\mathcal\{L\}\_\{\\text\{commit\}\}=\\bigl\\\|\\hat\{z\}\-\\operatorname\{sg\}\(\\hat\{z\}\_\{\\text\{quantized\}\}\)\\bigr\\\|^\{2\}\(9\)wheresg\(⋅\)\\operatorname\{sg\}\(\\cdot\)denotes the stop\-gradient operator\. Codebook vectors are updated via EMA rather than backpropagation\.
### E\.8Evaluation Metrics
Three metrics are tracked during training:
- •acc\(e2e\_\{2\}\): fragment classifier accuracy on the true next\-fragment embeddinge2e\_\{2\}, serving as a sanity check that the encoder produces discriminative representations across the vocabulary\.
- •acc\(z^\\hat\{z\}@1\): top\-1 accuracy of the predicted embeddingz^\\hat\{z\}under the fragment classifier, measuring whether the prediction lands on the correct next fragment\. This is the primary generation accuracy metric compared across ablation arms\.
- •acc\(z^\\hat\{z\}@5\): top\-5 accuracy ofz^\\hat\{z\}under the same classifier\.
### E\.9Model Scale
The full model has approximately 6\.4M trainable parameters\. The dominant components are the 6\-layer FragmentGPS encoder \(shared across partial assemblies and fragments\), theMLPMapper\\text\{MLP\}\_\{\\text\{Mapper\}\}predictor head, and the RVQ codebook parameters\. Table[9](https://arxiv.org/html/2609.13519#A5.T9)summarizes the small, baseline, and large model configurations used to assess the effect of model scale\.
Table 9:Model configurations and parameter counts\.Table[10](https://arxiv.org/html/2609.13519#A5.T10)reports property\-conditional generation across model sizes and fragmentation methods\. Scaling from 1\.2M to 6\.4M parameters yields modest improvements in joint control \(NJD2\.011→1\.9812\.011\\to 1\.981, Joint@1×1\\times38\.9→40\.8838\.9\\to 40\.88, Joint@2×2\\times84\.9→85\.9084\.9\\to 85\.90\), while generation quality remains saturated\. Further scaling to 32\.9M does not improve joint control \(NJD2\.0172\.017, Joint@1×1\\times39\.0539\.05, Joint@2×2\\times83\.7083\.70, Avg\.0\.7330\.733\), suggesting that this 10k\-molecule, 500\-fragment benchmark is not primarily capacity\-limited\. We also report a variant \(6\.4M∗\) that keeps the architecture fixed but applies BPE on BRICS fragments, called BFE \(BRICS\-based Fragment Enumeration\) in MolLingo\([Nguyen and Ji, 2026](https://arxiv.org/html/2609.13519#bib.bib7)\), coarsening the fragment vocabulary into fewer, larger composite units\. This variant substantially improves joint control \(NJD1\.4931\.493, Joint@1×1\\times69\.6569\.65, Joint@2×2\\times97\.7597\.75, Partial6\.566\.56\) and achieves the highest average per\-property Spearman correlation \(0\.7940\.794\), showing that Fraglingo can benefit substantially from coarser fragmentation schemes\. Thus, the plain\-BRICS results reported in this work should not be interpreted as an upper bound on the retrieval framework\. We keep plain BRICS fragments as the default because they are well\-established and widely used; MolLingo\-style BFE \(BPE\-on\-BRICS\) is an orthogonal tokenization change that composes with the same retrieval primitive, and we report it as evidence that the method can benefit from coarser vocabularies rather than as a separate model\.
Table 10:Effect of model size on property\-conditional molecule generation \(10k corpus, 500 fragments\)\. Scaling parameters improves joint control at saturated generation quality\. The 6\.4M∗row applies BPE on BRICS fragments, called BFE \(BRICS\-based Fragment Enumeration\) in MolLingo, coarsening the vocabulary\.∗Same architecture as 6\.4M, but tokenization applies BPE on BRICS fragments, called BFE \(BRICS\-based Fragment Enumeration\) in MolLingo, rather than using BRICS fragments alone\.
## Appendix FBaseline Experimental Setup
Shared property protocol\.All baselines use the same 7\-property target vector as Fraglingo: logP, molecular weight, QED, TPSA, HBD, HBA, and rotatable bond count, with all labels computed by RDKit\. Unless a baseline required a different data interface, we trained it from scratch on the same approximately 10k\-molecule corpus used for the Fraglingo conditional generator, using a 90/10 train/validation split\. Conditional\-generation methods were evaluated on the same 100 held\-out property targets, with 20 samples drawn for each target\. Optimization methods were evaluated on 200 held\-out source molecules paired with target 7\-property vectors and scored using the same normalized joint\-distance protocol as Fraglingo\.
We selected baselines according to two criteria: \(1\) the official implementation provides a reproducible training and evaluation pipeline, and \(2\) the method addresses at least one of the four molecular design tasks considered in this work, namely property\-conditional generation, molecule optimization, scaffold generation, or scaffold decoration\. Methods whose official implementations do not support end\-to\-end reproduction were excluded\. For example, although FragGPT\([Yue et al\., 2024](https://arxiv.org/html/2609.13519#bib.bib13)\)is closely aligned with the tasks studied here, its public repository does not provide a complete training pipeline, preventing a fair comparison\. We likewise excluded methods designed solely for unconditional molecular generation \(such as ChemGPT\([Frey et al\., 2023](https://arxiv.org/html/2609.13519#bib.bib26)\), MolBART\([Lane et al\., 2025](https://arxiv.org/html/2609.13519#bib.bib27)\), and Chemformer\([Irwin et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib28)\)\), as they cannot be directly adapted to our task formulations\.
##### Fraglingo\.
All Fraglingo variants share the same backbone architecture\. The model uses a shared FragmentGPS graph encoder with a residual vector\-quantized \(RVQ\) codebook consisting of 4 stages with 64 codes each, a commitment weight ofβ=0\.25\\beta=0\.25, and a classification loss weight of 0\.5\. Unless otherwise specified, architecture hyperparameters are fixed atdmodel=256d\_\{\\mathrm\{model\}\}=256, 6 GNN layers, 8 attention heads, and a dropout rate of 0\.1\. Models are trained using AdamW \(learning rate3×10−43\\times 10^\{\-4\}, weight decay10−210^\{\-2\}\) with cosine annealing, gradient clipping at 1\.0, and a batch size of 32\. Training runs for up to 50 epochs with early stopping \(patience \(S\)= 3, activated after the first epoch\) based on validation top\-1 acc\(z@1\)\.
### F\.1Conditional generation baselines\.
MolGPT\.We used MolGPT\([Bagal et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib6)\), a GPT\-style autoregressive SMILES transformer, from the authors’ official implementation111[https://github\.com/devalab/molgpt](https://github.com/devalab/molgpt)without architectural changes\. The model is a decoder\-only causal transformer with 8 layers, 8 attention heads, and embedding dimension 256\. Following the original conditioning scheme, the 7\-property vector is linearly projected to a single embedding token and prepended to the SMILES sequence before the causal self\-attention blocks\. We trained MolGPT with AdamW, cosine learning\-rate decay, and batch size 256\. At inference, SMILES were sampled autoregressively with ancestral sampling at temperature 1\.0 and no top\-kkfiltering until an end\-of\-sequence token was emitted\.
MolRWKV\.We used MolRWKV\([Li et al\., 2025](https://arxiv.org/html/2609.13519#bib.bib21)\), a SMILES language model based on the linear\-attention RWKV\-6 architecture, from the authors’ official implementation222[https://github\.com/bigwestHan/MolRWKV](https://github.com/bigwestHan/MolRWKV)without architectural changes\. The only local change was a path\-resolution fix for locating custom CUDA kernel sources at build time\. The model uses a 6\-layer RWKV decoder with embedding dimension 256 over a 25\-symbol character\-level SMILES vocabulary\. Conditioning is handled by a 2\-layer RWKV property encoder: each scalar property is projected to the model dimension, producing 7 property\-token embeddings that are encoded and injected into every decoder block\. We trained MolRWKV with Adam, learning rate5×10−45\\times 10^\{\-4\}, batch size 128, and early stopping with patience 5 for up to 50 epochs\. At inference, SMILES were sampled autoregressively until an end\-of\-sequence token was emitted\.
PS\-VAE\.We used PS\-VAE\([Kong et al\., 2022](https://arxiv.org/html/2609.13519#bib.bib1)\), a principal\-subgraph variational autoencoder that assembles molecules from automatically mined fragment pieces, from the authors’ official implementation333[https://github\.com/THUNLP\-MT/PS\-VAE](https://github.com/THUNLP-MT/PS-VAE)\. Local changes were limited to PyTorch Lightning API\-compatibility updates and property\-scoring utilities\. The released code supports QED, synthetic accessibility, and penalized logP; we added RDKit scoring and normalization ranges for molecular weight, TPSA, HBD, HBA, and rotatable bond count, and replaced penalized logP with plain RDKit logP\. The encoder, piece\-based VAE decoder, and property\-predictor MLP were otherwise unchanged\. The model used latent dimension 56 and a 500\-piece vocabulary mined from the training corpus\. We jointly trained the property predictor to regress all 7 properties with Adam, learning rate10−310^\{\-3\}, batch size 32, and early stopping with patience 3 for up to 8 epochs\. Because PS\-VAE is not end\-to\-end conditional, inference used post\-hoc latent optimization\. For each target, we sampled 40 prior latents, optimized each for up to 50 Adam steps at learning rate 0\.05 against the min\-max\-normalized property target with patience 10, and decoded optimized latents until 20 valid candidates were collected\.
### F\.2Optimization baselines\.
HierVAE\.We used the HierVAE\([Jin et al\., 2020](https://arxiv.org/html/2609.13519#bib.bib2)\)hierarchical graph\-to\-graph translation model \(HierVGNN\), which encodes and decodes molecular graphs over automatically extracted structural motifs, using the authors’ official implementation444[https://github\.com/wengong\-jin/hgraph2graph](https://github.com/wengong-jin/hgraph2graph)\. Local changes were limited to robustness fixes: a guard against division\-by\-zero when preprocessing small datasets and numpy/tensor\-to\-float coercions for logging\. We trained the translator variant with hidden and embedding size 270, latent size 4, and graph/tree message\-passing depth 20\. Training used the same matched\-molecule\-pair corpus as Fraglingo optimization: 10k source\-target pairs from the full matched\-pairs dataset\. Molecules incompatible with the codebase’s motif extraction were filtered out\. We trained with Adam, learning rate10−310^\{\-3\}, batch size 32, 20 epochs, and KL weight 0\.3 annealed at rate 0\.9\. At inference, each held\-out source used 20 stochastic translations over multiple motif attachment roots\.Similar Articles
Generating Developable 3D Molecules via Pocket-Conditioned Diffusion and Property-Aware Optimization
This paper introduces a novel diffusion-based generative model for structure-based drug design that decouples pocket and ligand representation learning and incorporates multi-scale interaction signals and property-aware optimization to generate developable 3D molecules with improved binding affinity and ADMET properties.
Controllable Molecular Generative Foundation Models
Proposes CoMole, a controllable molecular generative foundation model using motif-aware graph diffusion and reinforcement learning, achieving superior controllability across materials and drug discovery benchmarks.
Defragmenting Language Models: An Interpretability-based Approach for Vocabulary Expansion
Researchers from University of Utah and CMU propose FragMend, an interpretability-based approach for vocabulary expansion in LLMs that addresses token over-fragmentation in non-Latin script languages. Their method outperforms frequency-based vocabulary selection and baseline embedding initialization by ~20 points for several underrepresented languages.
Sesame: Structure-Aware Molecular Generation via Spatial Density-Map Conditioning
This paper introduces Sesame, a diffusion-based molecular generation model that conditions on partial molecular structure and protein pocket via spatial density maps, enabling both de novo generation and fragment-conditioned lead optimization for drug design.
MDForge: Agentic Molecular Dynamics Pipeline Design under Sparse Simulator Feedback
MDForge is an LLM agent that automates the design of molecular dynamics pipelines for host-guest binding free-energy calculations, achieving human-expert competitive results and discovering a novel high-affinity binder.