Constraint-Aware Corrective Memory for Language-Based Drug Discovery Agents
Organizations: Institute of Automation, Chinese Academy of Sciences, China · School of Advanced Interdisciplinary Sciences, University of Chinese Academy of Sciences, China · Centre for Artificial Intelligence and Robotics, Hong Kong Institute of Science & Innovation, Chinese Academy of Sciences, China
Abstract
Large language models are making autonomous drug discovery agents increasingly feasible, but reliable success in this setting is not determined by any single action or molecule. It is determined by whether the final returned set jointly satisfies protocol-level requirements such as set size, diversity, binding quality, and developability. This creates a fundamental control problem: the agent plans step by step, while task validity is decided at the level of the whole candidate set. Existing language-based drug discovery systems therefore tend to rely on long raw history and under-specified self-reflection, making failure localization imprecise and planner-facing agent states increasingly noisy. We present CACM (Constraint-Aware Corrective Memory), a language-based drug discovery framework built around precise set-level diagnosis and a concise memory write-back mechanism. CACM introduces protocol auditing and a grounded diagnostician, which jointly analyze multimodal evidence spanning task requirements, pocket context, and candidate-set evidence to localize protocol violations, generate actionable remediation hints, and bias the next action toward the most relevant correction. To keep planning context compact, CACM organizes memory into static, dynamic, and corrective channels and compresses them before write-back, thereby preserving persistent task information while exposing only the most decision-relevant failures. Our experimental results show that CACM improves the target-level success rate by 36.4% over the state-of-the-art baseline. The results show that reliable language-based drug discovery benefits not only from more powerful molecular tools, but also from more precise diagnosis and more economical agent states.
Figures & tables
| Metric | Pocket2Mol | DiffSMOL | Claude | GPT-4o | o1-mini | o1 | LIDDiA (DeepSeek) | CACM (ours) | ||||||||
| %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | %m/t or %t | #m/t or #t | |
| Generated molecules | ||||||||||||||||
| Generated | – | 100.0 | – | 100.0 | – | 5.0 | – | 5.0 | – | 5.0 | – | 5.0 | – | 21.0 | – | 5.0 |
| Valid | 100.0 | 100.0 | 99.9 | 99.9 | 98.7 | 4.9 | 97.3 | 4.9 | 91.3 | 4.6 | 95.3 | 4.8 | 100.0 | 21.0 | 100.0 | 5.0 |
| QED | 53.4 | 53.4 | 60.0 | 60.0 | 96.7 | 4.8 | 88.2 | 4.4 | 90.1 | 4.5 | 88.3 | 4.4 | 96.6 | 20.2 | 100.0 | 5.0 |
| LRF | 99.7 | 99.7 | 72.1 | 72.1 | 98.7 | 4.9 | 95.9 | 4.8 | 90.7 | 4.5 | 95.3 | 4.8 | 97.0 | 20.2 | 100.0 | 5.0 |
| Variant | Repair Signal | Structured Memory | Dynamic Compression | Corrective Selection | TSR (% / #) | DVS & HQ (% / #) | Avg. Pool Size | Avg. Term. Iters |
| LIDDiA baseline | ✗ | ✗ | ✗ | ✗ | 73.3 / 22 | 80.0 / 24 | 21.0 | 4.40 |
| Set-level Repair Signal | ✓ | ✗ | ✗ | ✗ | 86.7 / 26 | 86.7 / 26 | 6.7 | 4.07 |
| CACM w/o Corrective Selection | ✓ | ✓ | ✓ | ✗ | 83.3 / 25 | 83.3 / 25 | 8.0 | 4.27 |
| CACM w/o Dynamic Compression | ✓ | ✓ | ✗ | ✓ | 96.7 / 29 | 96.7 / 29 | 8.6 | 3.40 |
| CACM | ✓ | ✓ | ✓ | ✓ | 100.0 / 30 | 100.0 / 30 | 5.0 | 3.07 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Metric | Aggregation | Ref. |
| Pool size | benchmark | |
| Diversity | set-level diversity functional | benchmark |
| Novelty | set-level novelty functional | benchmark |
| QED | ( Bickerton et al., 2012 ) | |
| SAS | ( Ertl and Schuffenhauer, 2009 ) | |
| Lipinski check | worst-case pool aggregation | ( Lipinski et al., 2001 ) |
| Symbol | Meaning |
| Maximum number of selected pool summaries retained in dynamic descriptive memory. | |
| Maximum number of retained recent actions in dynamic descriptive memory. | |
| Maximum number of selected corrective entries retained in corrective memory. | |
| Character budget for static memory after deterministic template formatting. | |
| Character budget for dynamic descriptive memory after deterministic template formatting. | |
| Character budget for corrective memory after deterministic template formatting. |
| Variable | Value |
| 4 | |
| 3 | |
| 3 | |
| 1400 | |
| 1800 | |
| 1200 |
| Setting | ||
| default | ||
| tight_chars | ||
| compact_counts | ||
| wide_counts | ||
| rebalanced_chars |
| Setting | TSR (% / #) | Avg. Pool Size | Avg. Term. Iters | Avg. State Chars |
| default | 100.0 / 30 | 5.00 | 3.07 | 1572.2 |
| tight_chars | 96.7 / 29 | 8.17 | 3.47 | 1318.0 |
| compact_counts | 96.7 / 29 | 8.90 | 3.50 | 1613.4 |
| wide_counts | 100.0 / 30 | 5.53 | 3.17 | 1580.0 |
| rebalanced_chars | 96.7 / 29 | 8.17 | 3.43 | 1498.4 |
| Setting | Static | Dynamic | Corrective |
| default | 601.2 | 241.2 | 729.8 |
| tight_chars | 601.2 | 264.8 | 451.9 |
| compact_counts | 601.2 | 233.0 | 779.3 |
| wide_counts | 601.2 | 256.9 | 721.9 |
| rebalanced_chars | 601.2 | 262.8 | 634.4 |
| Target | Returned molecules |
|---|---|
| ADRB1 | 1. Cn1ccc(-c2cc(C(=O)N3CCN(Cc4ccccn4)CC3)c3ccccc3n2)n1 2. O=C(/C=C/c1ccccc1N+[O-])Nc1cccc(Cl)c1 3. Cc1nc(C)c(C@HNC(=O)CCC(=O)c2ccc(Cl)cc2)s1 4. COC(=O)N1CCC@@HC1 5. CCn1c(CCC@@HC=O)nc2ccccc21 |
| ADRB2 | 1. O=C(CCn1cnc2ccccc2c1=O)OCc1ccc(-c2ccccc2)cc1 2. CC1(c2ccc(OS(=O)(=O)c3ccc(Cl)cc3)cc2)SCCS1 3. Cc1occc1C@HCc1c(F)cccc1F 4. Cc1ccc(C(=O)N[C@H]2CCC(=O)NC2=O)c(N)c1 5. Cc1cc(C(=O)N2CCN(Cc3ccsc3)CC2)no1 |
| AR/NR3C4 | 1. Cc1ccc(CC@HNC(=O)Nc2ccccc2CC(=O)N(C)C)c(C)c1 2. Fc1cccc(F)c1N[C@@H]1CCOC2(CCCC2)C1 3. Cn1c(Cl)cnc1CS@CCCc1ccc(Cl)cc1 4. CCc1nc(N2CCOCC2)c2onc(-c3ccc(C)cc3)c2n1 5. O=C(NCCOc1ccc(Br)cc1)[C@H]1CCS(=O)(=O)C1 |
| BCHE | 1. O=C(NCC(=O)N1CCOc2ccccc21)NC1CCCCC1 2. Cc1ccc(S(=O)(=O)CC@HCOc2ccc(F)cc2Cl)cc1 3. Cc1sc(NC(=O)c2ccon2)nc1-c1ccc2c(c1)CCC2 4. CNC(=O)c1c(C)cccc1NC(=O)Cc1cccc(OCC#N)c1 5. O=S(=O)(NCCCn1cncn1)c1cc(Cl)cc(Cl)c1 |
| CDK5 | 1. COc1ccc(N2CC@@HCC2=O)cc1 2. N#Cc1ccc(-c2cc(F)cc(C(=O)[O-])c2)cc1O 3. COc1cc(C)c(-c2nc(C3CCCCC3)no2)cc1OC 4. CSc1ccc(Cl)c(C(=O)Nc2cc(C(=O)N(C)C)ccc2Cl)c1 5. CC@@Hc1cccc(-n2cccn2)c1 |
| CHK2 | 1. Cc1ccc(NS(=O)(=O)c2cc(C(=O)Nc3ccccc3C(=O)[O-])ccc2Br)cc1 2. c1ccc(SCc2noc(-c3ccco3)n2)nc1 3. O=C(c1ccc(OCC2CC2)nc1)N1CCc2[nH]c(=O)sc2C1 4. COc1cc(Br)c(/C=C2\SC(=N)NC2=O)cc1OC 5. COc1ccc(CCNC(=O)[C@H]2CC(=O)N(c3cccc(C(F)(F)F)c3)C2)cc1 |
| Method | Iter | Generated | Valid | QED | LRF | SAS | VNA | NVT | HQ | DVS | &DVS | &HQ | DVS&HQ | TSR |
| CACM (full) | 2 | 26.1 | 100.0 / 26.1 | 95.9 / 22.0 | 98.6 / 24.7 | 86.3 / 12.9 | 79.6 / 13.7 | 93.9 / 20.0 | 70.6 / 5.0 | 30/30 | 30/30 | 20/30 | 29/30 | 18/30 |
| 4 | 8.2 | 100.0 / 8.2 | 99.8 / 7.9 | 99.8 / 7.9 | 96.3 / 7.0 | 92.9 / 5.5 | 99.1 / 7.3 | 91.5 / 4.7 | 30/30 | 30/30 | 27/30 | 29/30 | 27/30 | |
| 6 | 11.3 | 100.0 / 11.3 | 98.2 / 9.5 | 99.8 / 11.2 | 98.2 / 9.6 | 95.6 / 7.0 | 96.8 / 8.2 | 93.7 / 5.0 | 30/30 | 30/30 | 29/30 | 29/30 | 28/30 | |
| 8 | 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 30/30 | 30/30 | 30/30 | 30/30 | 30/30 | |
| 10 | 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 100.0 / 5.0 | 30/30 | 30/30 | 30/30 | 30/30 | 30/30 | |
| CACM w/o dynamic compression | 2 | 18.4 | 100.0 / 18.4 | 94.8 / 13.3 | 99.0 / 17.5 | 95.0 / 13.4 | 88.3 / 10.6 | 95.2 / 13.7 | 83.3 / 5.6 | 30/30 | 30/30 | 27/30 | 29/30 | 24/30 |
| Method | Planner / target | Extra / target | Extra share | Total / target | Planner / iter | Extra / iter | Total / iter |
| LIDDiA baseline | 24,799.0 | 8,719.3 | 26.0% | 33,518.3 | 5,510.9 | 1,937.6 | 7,448.5 |
| CACM | 9,927.9 | 13,114.4 | 56.9% | 23,042.2 | 3,423.4 | 4,522.2 | 7,945.6 |
| Method | Avg. cutoff iterations | Minutes / iter | Minutes / target |
| LIDDiA baseline | 4.40 | 10.11 | 45.49 |
| CACM | 3.07 | 15.14 | 43.91 |
Drug Discovery
Drug discovery identifies, designs, and tests molecules that can safely affect disease biology.
See all 164 papers