TL;DR
Large Language Model (LLM) agents are transforming autonomous drug discovery, but they struggle to balance step-by-step planning with global, "set-level" constraints like molecular diversity and developability. This paper introduces CACM (Constraint-Aware Corrective Memory), a framework that pairs deterministic protocol auditing with structured, compressed memory channels to give agents precise, parsimonious feedback. By replacing bloated raw histories with targeted diagnostic hints, CACM boosts target success rates by 36.4% over state-of-the-art baselines while drastically reducing token costs.
What Problem Does This Paper Address?
Building closed-loop AI agents for de novo small-molecule drug discovery is a major goal in computational chemistry. An LLM agent typically coordinates tools for molecular generation, optimization, and screening. However, drug discovery is fundamentally a set-level problem. A run doesn't succeed just because one molecule looks good; the final returned pool of molecules must jointly satisfy a complex protocol spanning size, diversity, drug-likeness (QED), synthetic accessibility (SAS), and docking scores.
This creates a control mismatch: the agent plans locally (step-by-step), but success is judged globally (set-wide). Existing agents handle this by dumping the entire raw interaction history into the LLM's context window and asking it to "self-reflect." This leads to two major issues: imprecise failure localization (the LLM can't pinpoint exactly why a set failed) and memory bloat (the context window becomes long, noisy, and inefficient over multiple iterations).
Methods
The authors present CACM (Constraint-Aware Corrective Memory), a control-layer framework that sits between the LLM planner and the molecular toolchain. Instead of letting the LLM guess its mistakes, CACM introduces a structured feedback loop:
- Protocol Audit: A deterministic, code-based gate that evaluates the candidate set against the target criteria and calculates exact mathematical residuals (quantifying how far the pool is from satisfying each constraint).
- Grounded Diagnoser: If the audit fails, this module translates the mathematical residuals and pocket context into an explicit, actionable natural language repair hint and recommends an action bias (e.g., biasing the next step toward a code-based filtering repair).
- Concise Memory Construction: To prevent context bloat, CACM splits the agent's memory into three distinct channels:
- Static Memory: Invariant target and pocket descriptors.
- Dynamic Descriptive Memory: A compact, ranked summary of the current molecular pool and recent actions.
- Corrective Memory: Bounded, high-value records of past failures and repair directions.
These channels undergo a selection and deterministic template-based compression process before being written back to the planner, ensuring the agent's state remains compact and decision-ready.
Datasets
The framework was evaluated on the LIDDiA benchmark, which consists of 30 distinct protein targets. Each target includes a curated protein pocket structure, a natural-language specification of design requirements, and reference thresholds derived from known effective drugs. The underlying molecular toolchain utilized standard domain tools: Pocket2Mol for structure-based generation, GraphGA for molecular optimization, and AutoDock Vina for docking evaluation.
Key Insights and Ideas
- Set-Level vs. Molecule-Level Optimization: Maximizing individual molecular properties can actually hurt the global goal. For instance, over-optimizing binding affinity often collapses pool diversity. True reliability requires an explicit control layer focused on the entire set.
- Precision + Parsimony > Raw Context: More data isn't always better. Dumping full trajectories into an LLM creates noise and stale information. By distilling failures into explicit, localized diagnosis signals and strictly bounding memory growth, the agent makes much more logical, targeted decisions.
- Controlled Context Growth: As shown in Figure 2, while standard agent memory lengths grow linearly and uncontrollably over iterations, CACM's structured compression keeps the context length within a tight, flat band after the first few steps, preventing performance degradation over longer horizons.
Key Results
- Perfect Success Rate: CACM achieved a 100% Target Success Rate (30/30 targets) on the benchmark, representing a 36.4% absolute improvement over the DeepSeek-powered LIDDiA baseline (73.3%).
- Leaner, Higher-Quality Pools: CACM reduced the average final pool size from 21.0 molecules down to exactly 5.0, proving it finds compact, fully compliant sets rather than just throwing a massive net of candidates.
- Higher Efficiency: The average number of iterations required to succeed dropped from 4.40 to 3.07, leading to a 31.3% reduction in controller-side token usage per target due to earlier successful stopping.
Limitations and Future Work
The authors note that the current 30-target benchmark operates on a relatively short-horizon setting (a maximum of 10 iterations). While CACM excels here, its true potential in handling unstructured memory growth will be more fully tested in longer-horizon tasks, stricter multi-constraint protocols, or harder targets where open-ended history would completely saturate an LLM. Future work could also explore integrating more diverse or advanced neural molecular generators and optimization subroutines into the framework.
Summary updated