Source-linked AI summary
Fraglingo: Molecular Design via Attachment-Aware Autoregressive Fragment Generation
Thao Nguyen, Jeonghwan Kim, Zhenhailong Wang, Heng Ji
TL;DR
Fragment-based generation faces fixed-vocabulary limits and must distinguish among possible attachment sites. Fraglingo predicts attachment-aware fragment embeddings for retrieval, and the paper reports stronger joint property control than comparably trained baselines; its framework is limited by the chosen fragmentation scheme and vocabulary.
Problem
Fixed fragment-class vocabularies limit inference to represented fragments, while fragment-based generation must also resolve which attachment sites to connect.
Source: §1 · p. 2Method
Fraglingo predicts continuous fragment embeddings and uses wildcard-anchored representations to retrieve a fragment together with its attachment configuration.
Source: §1 · p. 2, §2.1 · p. 3Results
Fraglingo achieves the strongest joint property control among comparably trained baselines.
Source: §3.4 · p. 7Takeaways & Limitations
The same latent retrieval architecture supports molecule generation, scaffold generation, scaffold decoration, and molecule optimization by changing the retrieval query and conditioning signal.
Source: §5 · p. 10Fraglingo remains limited by the chosen fragmentation scheme and vocabulary.
Source: §5 · p. 10
Abstract
from arXiv · showhide
We introduce Fraglingo, an autoregressive molecular generator that constructs molecules step by step from chemically meaningful fragments connected through predefined attachment sites. At each generation step, Fraglingo jointly predicts which fragment to add and how it should attach by producing an attachment-aware fragment embedding and retrieving the nearest fragment through latent-space search. A wildcard-anchored readout represents both the growing molecule and candidate fragments relative to their attachment sites, enabling a single latent prediction to determine both fragment identity and attachment configuration. Because prediction operates in a continuous embedding space rather than over fixed fragment identifiers, larger fragment libraries can 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. Fraglingo also supports property-conditional generation, allowing desired molecular properties to guide the generation process. On controlled property-conditional benchmarks, Fraglingo achieves stronger joint property control than comparably trained baselines while maintaining competitive validity, uniqueness, and novelty. It also generalizes to fragment libraries up to four times larger than those used during training without retraining. Code is available at: https://anonymous.4open.science/r/FragLingo-3551.
1 INTRODUCTION
Molecular design needs generation units that align with medicinal-chemistry changes, but fixed fragment vocabularies and ambiguous attachment sites limit fragment-based approaches. Fraglingo combines continuous fragment retrieval with attachment-aware representations and reuses this primitive across molecular design tasks.
1 INTRODUCTION
- Fraglingo replaces fixed fragment classification with continuous embedding retrieval and a wildcard-anchored readout that jointly selects a fragment and its attachment site.The retrieval library can be expanded at inference time without retraining, while the readout represents the growing molecule and candidates relative to their attachment sites.Source: §1 · pp. 2–3
2.1 MOLECULE / SCAFFOLD GENERATION
- Molecule and scaffold generation proceed by autoregressively assembling chemically meaningful fragments at active wildcard attachment sites.Training molecules are decomposed into fragments, and assembly proceeds from a cap fragment in breadth-first order.Source: §1 · p. 2, §2.1 · p. 3
2.2 MOLECULE OPTIMIZATION
- Molecule optimization conditions fragment retrieval on both target properties and a global representation of the reference molecule.The reference-conditioning signal lets the model learn the expected degree of structure preservation from paired training examples; substitutions, insertions, and deletions emerge through fragment predictions.Source: §2.2 · pp. 4–5
2.3 SCAFFOLD DECORATION
- Scaffold decoration retrieves a branch independently for each growable site while keeping the undecorated scaffold fixed.The readout query is centered on the scaffold atom at each site, and the branch vocabulary includes a [NONE] token for leaving a site undecorated.Source: §2.3 · p. 5
3 EXPERIMENTS
The experiments assess Fraglingo across controlled property generation, representation behavior, and scaling, using datasets and evaluations that vary both corpus and fragment-vocabulary size. Results show strong joint property control and that inference-time vocabulary expansion trades some control for greater chemical coverage.
3.1 TRAINING DATA
- The k×N datasets varied fragment-vocabulary size and corpus size using BRICS fragments from a filtered ZINC15 base corpus, with scaffold-held-out 8:1:1 splits.The base corpus contained 883M molecules below 500 Da that decomposed into at least two BRICS fragments; task-specific datasets included scaffold, optimization, and decoration settings.Source: §3.1 · pp. 5–6
3.2 BENCHMARKING SETUP
- Fraglingo was benchmarked against prior work for tasks where direct comparison was possible; because no public baselines supported scaffold generation or decoration, those tasks were assessed through comprehensive self-evaluation.All evaluated models had 1.8M–6.4M trainable parameters; results were means and standard deviations across three independent random seeds. For property-conditional generation, trainable models shared a 10k-molecule corpus, but only fragment-based methods used a shared 500-fragment BRICS vocabulary; non-fragment methods used native representations.Source: §3.2 · p. 6
3.3 EVALUATION METRICS
- Generation quality was assessed with validity, uniqueness, novelty, and fingerprint-based diversity, separate from property control.Source: §3.3 · p. 6
- Property control used per-property Spearman correlation, normalized joint distance, joint success within two tolerance levels, and mean partial satisfaction across seven properties.NJD normalizes each achieved-versus-target error by that property's training-set standard deviation; lower NJD is better.Source: §3.3 · pp. 6–7
3.4.1 THE WILDCARD ANCHOR LEARNS A ATTACHMENT-AWARE REPRESENTATION
- Across 400 asymmetric two-wildcard fragments, readouts often separated by attachment site, with larger distances for distinct environments and smaller distances for near-symmetric fragments.The t-SNE visualization links the two readouts for each fragment; changing the active wildcard often induced a consistent transformation in the embedding space.Source: §3.4.1 · p. 7, Figure 3 · p. 7
3.4.2 PROPERTY-CONDITIONAL GENERATION PERFORMANCE
- BFE-Fraglingo achieved the strongest joint control: NJD 1.49, Joint@1× 69.65%, Joint@2× 97.75%, and 6.56/7 satisfied properties.In plain-BRICS settings, the wildcard-readout ablation had NJD 2.1256 and Joint@1× 34.66%, while Fraglingo maintained 100% validity, uniqueness, and novelty.Source: §3.4.2 · p. 8, Table 2 · p. 8
3.4.3 CONTINUOUS RETRIEVAL ENABLES VOCABULARY EXPANSION AFTER TRAINING
- Expanding the inference library selected unseen fragments and increased diversity while preserving saturated validity, uniqueness, and novelty, but weakened property control.The strongest property control occurred when the retrieval library matched the training distribution, allowing a trade-off between accuracy and chemical coverage without retraining.Source: §3.4.3 · p. 9, Table 4 · p. 9
4 RELATED WORK
Earlier molecular generators largely operate at the atom or token level, while fragment-based methods use chemically larger units but commonly rely on fixed vocabularies. Fraglingo instead uses attachment-aware continuous retrieval, allowing inference-time library expansion.
- SMILES and graph-based generators operate mainly at the atom or token level, leaving chemically meaningful substructures to be learned implicitly.Source: §4 · p. 9
- Fragment methods including HierVAE, JT-VAE, PS-VAE, MoLeR, and FragGPT generate from discrete vocabularies, while t-SMILES and SynCoGen explore hierarchical or synthesis-oriented representations.Source: §4 · p. 9
- Fraglingo uses attachment-aware continuous latent retrieval, enabling fragment-library expansion at inference time rather than relying on a fixed fragment vocabulary.Source: §4 · p. 9
5 CONCLUSION, LIMITATIONS, AND FUTURE WORK
Fraglingo uses continuous latent retrieval with an attachment-aware readout to jointly determine fragment identity and attachment. The framework reuses this operation across four design tasks, while remaining constrained by its fragmentation scheme and vocabulary.
5 CONCLUSION, LIMITATIONS, AND FUTURE WORK
- The model predicts a continuous fragment embedding for nearest-neighbor retrieval, rather than classifying over fixed fragment identifiers.A wildcard-anchored readout conditions retrieval on the active attachment site, jointly determining fragment identity and attachment.Source: §5 · p. 9
- The same latent-retrieval architecture supports molecule generation, scaffold generation, scaffold decoration, and molecule optimization by changing the retrieval query and conditioning signal.These tasks use autoregressive assembly, branch retrieval at specified sites, or conditioned fragment replacement.Source: §5 · p. 10
- Fraglingo remains limited by the chosen fragmentation scheme and vocabulary; future work includes richer fragmentation, stronger conditioning, and scaling retrieval to larger libraries.Source: §5 · p. 10
A ABLATIONS ATTRIBUTE THE GAINS TO CONTINUOUS RETRIEVAL
Ablations compare the full model with variants that change one component at a time. Replacing InfoNCE with direct regression sharply degrades property control, while removing classification loss also hurts and removing RVQ has a milder effect.
A ABLATIONS ATTRIBUTE THE GAINS TO CONTINUOUS RETRIEVAL
- The ablation holds the 10k corpus and 500-fragment setting fixed while changing one component at a time.The variants replace InfoNCE with regression or remove the classification loss, RVQ regularizer, or codebook.Source: A ABLATIONS ATTRIBUTE THE GAINS TO… · p. 13
- Replacing InfoNCE with direct MSE regression raises NJD from 1.4928 to 4.2248 and drops Joint@1× from 69.65% to 26.85%, while generation quality stays intact.Average per-property correlation falls from 0.7942 to 0.1772; the passage attributes the control loss to the contrastive objective's in-batch negatives.Source: A ABLATIONS ATTRIBUTE THE GAINS TO… · p. 13, Table 5 · p. 13
- Removing the classification loss degrades control to NJD 1.7878, Joint@1× 56.52%, and average per-property correlation 0.7032.The passage says this confirms the embedding-collapse hypothesis: without discriminative pressure, distinct fragments blur together and retrieval loses precision.Source: A ABLATIONS ATTRIBUTE THE GAINS TO… · p. 13, Table 5 · p. 13
- Removing RVQ has a milder effect, with NJD 1.5268 and Joint@1× 67.75%, so the authors retain it as a low-cost light stabilizer.The passage says the method does not depend on RVQ.Source: A ABLATIONS ATTRIBUTE THE GAINS TO… · p. 13, Table 5 · p. 13
B ONE PRIMITIVE TRANSFERS TO MOLECULE OPTIMIZATION
Fraglingo applies its retrieval mechanism to molecule optimization and scaffold generation. Optimization comparisons favor Fraglingo among the compared fragment-based methods, while scaffold results show a tradeoff between joint control and vocabulary size.
B ONE PRIMITIVE TRANSFERS TO MOLECULE OPTIMIZATION
- Fraglingo achieves the lowest final NJD (1.6244), best preservation among compared methods (Tanimoto 0.7952; 95.72% above 0.6 similarity), and best average distributional similarity.The comparison uses HierVAE and JT-VAE under a shared 10k matched-pair protocol; the passage describes similarity-constrained edits to meet multi-property targets.Source: B ONE PRIMITIVE TRANSFERS TO MOLECULE… · p. 13, Table 6 · p. 14
- Figure 5 examples show local fragment changes moving properties toward targets while preserving much of the starting molecule.Green marks properties close to target, yellow within tolerance, and red outside the target range.Source: B ONE PRIMITIVE TRANSFERS TO MOLECULE… · p. 14, Figure 5 · p. 14
- Increasing the matched-pair training corpus consistently improves target matching, but vocabulary-size effects are more nuanced.The 1M-pair, 500-fragment model has the lowest NJD (1.2037); the 1M-pair, 1000-fragment model has the highest average property-distribution similarity (0.8501). The 10k-pair, 2000-fragment model has the highest Tanimoto similarity (0.7980), and all configurations maintain 100% validity.Source: B ONE PRIMITIVE TRANSFERS TO MOLECULE… · p. 14, Table 7 · p. 14
C . . . TO SCAFFOLD GENERATION
- Scaffold generation is evaluated by controlled self-evaluation because no available baseline can be retrained under the same protocol.The evaluation examines valid ring systems, diverse core topologies, and property control across vocabulary and corpus sizes.Source: C . . . TO SCAFFOLD GENERATION · p. 15
- For scaffold generation, smaller vocabularies, especially 100 fragments, give better joint-control metrics, while larger vocabularies increase uniqueness, novelty, and diversity.The passage reports this tradeoff at the 1M training-corpus scale as well; larger vocabularies worsen NJD and joint satisfaction performance.Source: C . . . TO SCAFFOLD GENERATION · p. 15, Table 8 · p. 15
D . . . AND TO SCAFFOLD DECORATION
Scaffold decoration uses site-conditioned retrieval to choose branches for fixed cores, and larger training corpora improve aggregate results across tested settings. The appendix details the model and its autoregressive training examples.
D . . . AND TO SCAFFOLD DECORATION
- Decoration is evaluated by self-comparison across settings because the cited alternatives use incompatible conditioning interfaces or are optimized for structural plausibility rather than explicit multi-property control.The question is whether site-conditioned retrieval chooses plausible branches for a fixed core while keeping scaffold atom indices stable across sites.Source: D . . . AND TO SCAFFOLD DECORATION · p. 15
- Site-conditioned retrieval selects different branch fragments for different local environments while leaving the scaffold core unchanged.The examples show reduced errors on targeted properties such as TPSA and molecular weight, although improving one property can trade off against weakly constrained descriptors.Source: D . . . AND TO SCAFFOLD DECORATION · p. 16, Figure 7 · p. 16
- At 100k training molecules with a 2000-fragment vocabulary, decoration achieves its best overall setting: NJD 0.71, Tanimoto 0.3565, partial satisfaction 6.82/7, and average correlation 0.9250.Increasing the corpus from 10k to 100k consistently improves aggregate metrics; a 1M corpus remains competitive but does not improve the best aggregate result.Source: D . . . AND TO SCAFFOLD DECORATION · p. 16, Table 9 · p. 16
E DETAILED FRAGLINGO MODEL DESIGN
- The appendix details the encoder, readout, conditioning, predictor, RVQ regularizer, losses, metrics, and model scale after introducing autoregressive training examples.Source: E DETAILED FRAGLINGO MODEL DESIGN · p. 17
E.1 GENERATION FRAMING
- Training decomposes molecules with BRICS, identifies the fragment-tree main chain, and creates two prediction trajectories starting from opposite ends.Examples follow breadth-first traversal from a terminal cap; at each step the model predicts the fragment embedding for an active wildcard, and growth ends when no wildcards remain.Source: §E.1 · p. 17
E.2 GRAPH ENCODER: FRAGMENTGPS
The appendix describes Fraglingo’s shared graph encoder and attachment-anchored readout, then specifies property conditioning, its predictor, and inference-time fragment retrieval.
E.2 GRAPH ENCODER: FRAGMENTGPS
- The shared 6-layer FragmentGPS uses sequential GINE message passing and global self-attention; its readout queries context atoms from the active attachment atom.The encoder has hidden dimension 256; terminal cap-fragment prediction uses the active wildcard embedding directly as the query.Source: §E.2 · pp. 17–18
E.3 PROPERTY CONDITIONING
- A seven-descriptor property vector is projected and added to the partial-assembly embedding; zeroing it with probability 0.2 during training supports classifier-free guidance at sampling.The descriptors are z-scored with per-dataset training-set statistics, and guidance uses scale w ≥ 0.Source: §E.3 · p. 18
E.4 CONDITIONING PROPERTY DESCRIPTORS
- The conditioning descriptors span molecular composition and structure: MW, HBD, and HBA are largely fragment-determined, while four others also depend strongly on assembly.The seven descriptors are logP, MW, QED, TPSA, HBD, HBA, and rotatable-bond count.Source: §E.4 · p. 18
E.5 PREDICTOR: MLPMAPPER
- MLPMapper is a two-layer predictor with hidden dimension 1024 that maps the conditioned context embedding to a next-fragment embedding in the encoder’s space.Its output embedding has dimension d.Source: §E.5 · p. 18
E.6 DISCRETE BOTTLENECK: RVQCODEBOOK
- The 4-stage RVQ regularizes predictions during training, but inference retrieves fragments directly by cosine similarity, allowing a larger lookup vocabulary without changing the predictor.Each RVQ stage uses a 64-vector codebook; the quantizer is discarded at inference.Source: §E.6 · p. 19
E.7 TRAINING OBJECTIVE
The training objective combines embedding alignment, auxiliary fragment classification, and vector-quantization commitment, with selected weights for the reported experiments.
E.7 TRAINING OBJECTIVE
- The three training losses use weights 1:0.5:0.25 for InfoNCE, fragment classification, and VQ commitment, respectively.The weights were selected by grid search.Source: §E.7 · p. 19
- InfoNCE uses in-batch negatives to drive predicted embeddings toward the true next-fragment embedding.The loss is computed over batches of normalized predicted and true embeddings.Source: §E.7 · p. 19
- The auxiliary fragment-classification loss discourages embedding collapse by promoting discriminative fragment representations.A linear head classifies the true fragment embedding over the vocabulary.Source: §E.7 · p. 19
- The VQ commitment loss pulls the continuous prediction toward its nearest codebook vector, whose parameters are updated by EMA.The loss uses a stop-gradient operator.Source: §E.7 · p. 19
E.8 EVALUATION METRICS
The evaluation tracks fragment-representation accuracy and predicted-embedding accuracy at top one and top five.
E.8 EVALUATION METRICS
- acc(e2) measures fragment-classifier accuracy on the true next-fragment embedding as a check of representation discriminability across the vocabulary.Source: §E.8 · p. 19
- acc(ẑ@1) is top-1 accuracy of the predicted embedding under the fragment classifier and is the primary generation-accuracy metric compared across ablations.Source: §E.8 · p. 19
- acc(ẑ@5) is top-5 accuracy of the predicted embedding under the same fragment classifier.Source: §E.8 · p. 19
E.9 MODEL SCALE
The scale study compares model sizes and fragmentation methods for property-conditional generation, finding that coarser fragmentation can substantially improve joint control.
E.9 MODEL SCALE
- Scaling from 1.2M to 6.4M parameters modestly improves joint control: NJD 2.011 → 1.981, Joint@1× 38.9 → 40.88, and Joint@2× 84.9 → 85.90.Generation quality remains saturated across this scaling.Source: §E.9 · p. 20, Table 11 · p. 20
- Scaling further to 32.9M does not improve joint control, and the authors treat BFE as an orthogonal tokenization change rather than a separate model.The plain-BRICS results are not presented as an upper bound on the retrieval framework.Source: §E.9 · p. 20
- BFE at 6.4M* achieves NJD 1.493, Joint@1× 69.65, Joint@2× 97.75, and average per-property Spearman correlation 0.794.The BFE variant applies BPE on BRICS fragments, coarsening the vocabulary.Source: Table 11 · p. 20, §E.9 · p. 20
F BASELINE EXPERIMENTAL SETUP
The baselines were selected for reproducible training and compatibility with at least one molecular-design task, then evaluated under shared property-control protocols. Conditional-generation and optimization baselines used task-specific implementations and inference procedures.
F BASELINE EXPERIMENTAL SETUP
- Conditional generation used seven RDKit-scored properties, 100 held-out targets with 20 samples each, and a shared training corpus and split where interfaces allowed.Optimization used 200 held-out source molecules paired with target property vectors and the same normalized joint-distance protocol as Fraglingo.Source: F BASELINE EXPERIMENTAL SETUP · p. 20
- Baselines required reproducible official pipelines and coverage of at least one design task; FragGPT was excluded because its repository lacked complete training.Methods designed only for unconditional generation were also excluded as they could not be directly adapted to the task formulations.Source: F BASELINE EXPERIMENTAL SETUP · pp. 20–21
F.1 CONDITIONAL GENERATION BASELINES.
- MolGPT (Bagal et al., 2022) prepended a projected seven-property token to SMILES, while MolRWKV encoded seven property tokens for injection into decoder blocks.PS-VAE used post-hoc latent optimization because its released model was not end-to-end conditional.Source: §F.1 · p. 21
F.2 OPTIMIZATION BASELINES.
- HierVAE was trained as a graph-to-graph translator on 10k matched source-target pairs, filtering molecules incompatible with its motif extraction.At inference, each held-out source used 20 stochastic translations over multiple motif attachment roots.Source: §F.2 · pp. 21–22