Fraglingo: Molecular Design via Attachment-Aware Autoregressive Fragment Generation
Organizations: Siebel School of Computing and Data Science University of Illinois Urbana-Champaign Urbana, IL 61801, USA
Abstract
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.
Figures & tables
| Term | Definition |
|---|---|
| Fragment | A chemically meaningful molecular substructure used as a generation unit. |
| Attachment site | A position on a fragment where a bond to another fragment can be formed, represented by a wildcard atom (*). |
| Active attachment site | The open attachment site of the growing molecule from which the next generation step proceeds. |
| Growing molecule | The partially assembled molecule at the current generation step. |
| Attachment-aware | A representation conditioned on the specific attachment site through which a fragment participates in assembly. |
| Wildcard-anchored readout | A graph readout that represents a molecule relative to a selected wildcard attachment site. |
| Model | Generation Quality | Joint Control | Per-Property Spearman | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Uniqueness | Novelty | Diversity | NJD | Joint@1 | Joint@2 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| MolGPT | 25.7 | 100.0 | 100.0 | 0.3099 | 1.7339 | 53.97 | 95.02 | 6.32 | 0.8072 | 0.9442 | 0.6659 | 0.8537 | 0.7340 | 0.8242 | 0.6421 | 0.7816 |
| (Std) | (1.9) | (0) | (0) | (0.026) | (0.113) | (1.362) | (3.945) | (0.190) | (0.038) | (0.031) | (0.074) | (0.037) | (0.057) | (0.039) | (0.056) | (0.012) |
| MolRWKV | 90.9 | 100.0 | 100.0 | 0.8261 | 1.6090 | 43.77 | 90.46 | 6.17 | 0.8606 | 0.4830 | 0.7070 | 0.6449 | 0.8839 | 0.8572 | 0.8232 | 0.7514 |
| (Std) | (2.2) | (0) | (0) | (0.027) | (0.103) | (4.851) | (4.196) | (0.161) | (0.032) | (0.044) | (0.075) | (0.040) | (0.041) | (0.030) | (0.023) | (0.027) |
| Train | Vocab | Generation Quality | Joint Control | Per-Property Spearman | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Uniqueness | Novelty | Diversity | NJD | Joint@1 | Joint@2 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| 1K | 100 | 97.8 | 98.7 | 100.0 | 0.8344 | 3.9288 | 12.24 | 42.58 | 3.99 | 0.5940 | 0.2953 | 0.2920 | 0.3903 | 0.5228 | 0.3101 | 0.4275 | 0.4045 |
| 500 | 97.8 | 99.0 | 100.0 | 0.8631 | 4.2554 | 11.84 | 39.05 | 3.82 | 0.6623 | 0.1473 | 0.3138 | 0.4428 | 0.4705 | 0.3381 | 0.4717 | 0.4066 | |
| 1000 | 99.6 | 99.3 | 100.0 | 0.8748 | 4.1446 | 10.10 | 36.15 | 3.78 | 0.4501 | 0.1098 | 0.2547 | 0.4414 | 0.4598 | 0.3536 | 0.1643 | 0.3190 | |
| 2000 | 99.8 | 99.6 | 100.0 | 0.8775 | 4.3054 | 11.25 | 35.18 | 3.78 | 0.5069 | 0.1394 | 0.2646 | 0.3582 | 0.4166 | 0.2783 | 0.4005 | 0.3377 | |
| Inference Vocabulary | Generation Quality | Joint Control | Per-Property Spearman | Avg. | OOV Frag. | ||||||||||
| Validity | Uniqueness | Novelty | Diversity | NJD | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | |||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Training (500-frags) | 100.0 | 99.9 | 100.0 | 0.8218 | 1.4928 | 6.56 | 0.8710 | 0.7746 | 0.6373 | 0.8296 | 0.8284 | 0.8190 | 0.7993 | 0.7942 | 0.00% |
| Inference (1000-frags) | 100.0 | 100.0 | 100.0 | 0.8313 | 1.6028 | 6.40 | 0.8600 | 0.7496 | 0.6323 | 0.8476 | 0.8534 | 0.8280 | 0.7903 | 0.7945 | 29.11% |
| Inference (2000-frags) | 100.0 | 100.0 | 100.0 | 0.8382 | 1.8628 | 6.16 | 0.8620 | 0.7286 | 0.5953 | 0.8226 | 0.8334 | 0.8150 | 0.7773 | 0.7763 | 48.76% |
| Training (1000-frags) | 100.0 | 100.0 | 100.0 | 0.8313 | 1.2318 | 6.83 | 0.7740 | 0.8896 | 0.6043 | 0.8456 | 0.7354 | 0.7890 | 0.7523 | 0.7702 | 0.00% |
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | Generation Quality | Joint Control | Per-Property Spearman | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Uniqueness | Novelty | Diversity | NJD | Joint@1 | Joint@2 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| Full model (Fraglingo) | 100.0 | 99.9 | 100.0 | 0.8218 | 1.4928 | 69.65 | 97.75 | 6.56 | 0.8710 | 0.7746 | 0.6373 | 0.8296 | 0.8284 | 0.8190 | 0.7993 | 0.7942 |
| InfoNCE ( MSE regression) | 99.8 | 100.0 | 100.0 | 0.8238 | 4.2248 | 26.85 | 24.94 | 3.73 | 0.1010 | 0.3146 | 0.0033 | 0.3636 | 0.1674 | 0.1470 | 0.1453 | 0.1772 |
| Classification loss | 100.0 | 100.0 | 100.0 | 0.8228 | 1.7878 | 56.52 | 88.14 | 5.95 | 0.7570 | 0.6966 | 0.4823 | 0.7756 | 0.7434 | 0.7520 | 0.7193 | 0.7032 |
| RVQ regularizer | 100.0 | 100.0 | 100.0 | 0.8268 | 1.5268 | 67.75 | 95.76 | 6.29 | 0.7780 | 0.8536 | 0.6053 | 0.8046 | 0.7344 | 0.7980 | 0.7243 | 0.7562 |
| Model | Generation Quality | Optimization Performance | Property Distribution Similarity | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Novelty | NJD | Tanimoto | Sim 0.6 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| HierVAE | 100.0% | 100.0% | 1.7717 | 0.6746 | 66.14% | 6.17 | 0.821 | 0.723 | 0.727 | 0.719 | 0.817 | 0.809 | 0.719 | 0.762 |
| (Std) | (0) | (0) | (0.011) | (0.014) | (2.6) | (0.006) | (0.010) | (0.012) | (0.009) | (0.010) | (0.014) | (0.004) | (0.004) | (0.011) |
| JT-VAE | 100.0% | 99.9% | 2.6481 | 0.2940 | 4.12% | 5.19 | 0.509 | 0.329 | 0.373 | 0.277 | 0.537 | 0.421 | 0.515 | 0.423 |
| (Std) | (0) | (0) | (0.093) | (0.027) | (0.74) | (0.60) | (0.078) | (0.069) | (0.090) | (0.063) | (0.093) | (0.071) | (0.102) | (0.098) |
| Train | Vocab | Generation | Optimization Performance | Property Distribution Similarity | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | NJD | Tanimoto | Sim 0.6 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| 10k | 500 | 100.0% | 1.6244 | 0.7952 | 95.72% | 6.17 | 0.8390 | 0.7440 | 0.7130 | 0.7720 | 0.8690 | 0.8400 | 0.7880 | 0.7950 |
| 100k | 100.0% | 1.4031 | 0.7903 | 95.82% | 6.34 | 0.8709 | 0.7712 | 0.7681 | 0.8327 | 0.8753 | 0.8593 | 0.8103 | 0.8269 | |
| 1M | 100.0% | 1.2037 | 0.7853 | 94.62% | 6.39 | 0.8617 | 0.7830 | 0.7981 | 0.8351 | 0.8941 | 0.8927 | 0.8791 | 0.8491 | |
| 10k | 1000 | 100.0% | 1.6477 | 0.7896 | 94.72% | 6.12 | 0.8414 | 0.6757 | 0.7280 | 0.7772 | 0.8656 | 0.8328 | 0.7924 | 0.7876 |
| Train | Vocab | Generation Quality | Joint Control | Per-Property Spearman | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Uniqueness | Novelty | Diversity | NJD | Joint@1 | Joint@2 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| 10k | 50 | 100.0 | 96.8 | 88.2 | 0.8059 | 2.5943 | 41.67 | 84.64 | 5.68 | 0.6169 | 0.7711 | 0.4029 | 0.5954 | 0.6196 | 0.5987 | 0.6701 | 0.6107 |
| 100 | 100.0 | 97.0 | 89.4 | 0.8262 | 2.5278 | 44.22 | 84.99 | 5.77 | 0.7397 | 0.7302 | 0.3994 | 0.6019 | 0.5859 | 0.6052 | 0.7786 | 0.6344 | |
| 200 | 100.0 | 99.0 | 95.2 | 0.8363 | 3.1045 | 32.05 | 74.45 | 5.28 | 0.7253 | 0.6606 | 0.2815 | 0.5352 | 0.6709 | 0.4859 | 0.5754 | 0.5621 | |
| 500 | 99.9 | 99.2 | 97.0 | 0.8397 | 3.9841 | 25.28 | 63.91 | 4.74 | 0.6526 | 0.4954 | 0.1639 | 0.4121 | 0.6040 | 0.2993 | 0.6391 | 0.4666 | |
| Train | Vocab | Joint Control | Per-Property Spearman | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NJD | Tanimoto | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | ||
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| 10k | 500 | 1.08 | 0.3165 | 6.62 | 0.9126 | 0.7919 | 0.8381 | 0.8632 | 0.8996 | 0.8538 | 0.8032 | 0.8518 |
| 1000 | 0.95 | 0.3338 | 6.75 | 0.9115 | 0.8711 | 0.8852 | 0.9194 | 0.8839 | 0.9225 | 0.8891 | 0.8975 | |
| 2000 | 1.00 | 0.3206 | 6.70 | 0.9030 | 0.8290 | 0.8287 | 0.8965 | 0.8770 | 0.9069 | 0.8870 | 0.8755 | |
| 100k | 500 | 0.80 | 0.3349 | 6.75 | 0.9412 | 0.8488 | 0.9086 | 0.9469 | 0.8826 | 0.9324 | 0.8958 | 0.9080 |
| Model | Dim. | Layers | Heads | Params |
|---|---|---|---|---|
| Small | 128 | 4 | 4 | 1.2M |
| Baseline | 256 | 6 | 8 | 6.4M |
| Large | 512 | 8 | 8 | 32.9M |
| Model size | Generation Quality | Joint Control | Per-Property Spearman | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Validity | Uniqueness | Novelty | Diversity | NJD | Joint@1 | Joint@2 | Partial (/7) | logP | MW | QED | TPSA | HBD | HBA | RotBonds | Avg. | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| 1.2M | 100% | 100% | 100% | 0.843 | 2.011 | 38.9% | 84.9% | 5.80 | 0.823 | 0.611 | 0.568 | 0.756 | 0.821 | 0.776 | 0.756 | 0.730 |
| 6.4M | 100% | 100% | 100% | 0.8444 | 1.9808 | 40.88% | 85.90% | 5.80 | 0.8373 | 0.6423 | 0.5632 | 0.7605 | 0.8161 | 0.7800 | 0.7760 | 0.7393 |
| 32.9M | 100% | 100% | 100% | 0.8443 | 2.017 | 39.05% | 83.70% | 5.73 | 0.793 | 0.621 | 0.603 | 0.754 | 0.825 | 0.782 | 0.750 | 0.733 |
| 6.4M ∗ | 100% | 99.9% | 100% | 0.8218 | 1.4928 | 69.65% | 97.75% | 6.56 | 0.8710 | 0.7746 | 0.6373 | 0.8296 | 0.8284 | 0.8190 | 0.7993 | 0.7942 |