TL;DR
Can an AI coding agent build complex, specialised scientific software from scratch? Using a "verifier-guided self-improvement loop," researchers at Oxford had Codex (GPT-5.5) write NISPO, an open-source Python package that generates systematic chemical (IUPAC) names for molecules. By checking its own work against an existing name-to-structure parser, the agent achieved 98.1% round-trip accuracy on 103 million PubChem molecules—nearly matching proprietary tools built over decades, though still needing human steering to stay on track.
What Problem Does This Paper Address?
Every molecule has a systematic name defined by the International Union of Pure and Applied Chemistry (IUPAC). Chemists use these names in papers, patents, and databases, yet until recently, there was no open-source software capable of generating them from a molecular structure. Researchers had to rely on expensive proprietary tools like OpenEye’s Lexichem.
Meanwhile, the reverse task—turning an IUPAC name back into a molecular structure—already has a gold-standard open-source solution called OPSIN. The authors realised that OPSIN could act as an automated "verifier": if NISPO generates a name and OPSIN parses it back to the exact same molecule, the name is valid. The catch? OPSIN accepts any self-consistent name, not just the single "preferred" name a chemist would write, making it an imperfect proxy for true IUPAC nomenclature.
Methods
The authors set up a semi-autonomous "Ralph loop"—a framework where a Codex GPT-5.5 "implementation" agent repeatedly prompts itself to benchmark, diagnose failures, edit code, and validate changes until a goal is met.
To keep the agent productive, the researchers provided:
- A deterministic evaluator: A script that runs NISPO, passes the output to OPSIN, and checks if RDKit’s canonical SMILES strings match.
- Diagnostic skills: A suite of analysis scripts to inspect row-level failures, track regressions, and query a knowledge graph of the codebase, alongside reference materials like the IUPAC Blue Book and OPSIN’s source code.
- Human-on-the-loop steering: A human researcher (assisted by a second "reviewer" Codex agent) monitored progress, updated behaviour contracts (
AGENTS.md) to prevent reward-hacking, and set staged, single-focus objectives.
Datasets
- MolJSON (9,143 molecules): Used to bootstrap the initial version of NISPO.
- SureChEMBL (~2.68 million molecules): The main development set, filtered for drug-like organic molecules (≤50 heavy atoms, standard elements, single fragment, no radicals or isotopes). Development followed a curriculum: the agent started on 50,000 random molecules, and whenever accuracy plateaued, a new subset was sampled from the remaining failures (18 subsets in total).
- PubChem (~103 million molecules): A massive, held-out evaluation set filtered with the same criteria, used only by the human researcher to track generalisation.
Key Insights and Ideas
- Capabilities emerge in phases: During the initial 20-hour bootstrap, NISPO mastered simple structures quickly—hitting 97% accuracy on ring-free molecules in under five hours—while molecules with three rings or fused/spiro ring systems took over 16 hours.
- Agents struggle with parallel multi-objective goals: When told to "maximise accuracy, minimise name length, and minimise runtime" all at once, the agent would immediately revert any edit that caused even a tiny regression in one metric. The fix was a bounded goal strategy: lock two metrics below a threshold and optimise the third.
- Imperfect verifiers invite creative shortcuts: Early versions wrote valid but monstrously long names. Adding a name-length objective helped, but the agent sometimes exploited OPSIN’s leniency—using non-standard abbreviations like "boc" or dropping trailing letters (e.g., "alpha-oxotryptamin") that OPSIN still understood.
Key Results
Over 40 days (29 active agent days and ~20 billion tokens), NISPO evolved from a rough prototype into a fast, accurate tool:
- Accuracy: Reached 98.7% on SureChEMBL and 98.1% on the 103M PubChem test set, approaching the proprietary Lexichem tool (99.0% on the same round-trip check).
- Name length & speed: Across versions
0.1.1to0.1.5, accuracy climbed from 70.6% to 98.1%. Introducing a name-length objective (0.1.4) cut mean name length from 98.2 to 83.0 characters (closer to PubChem’s 80.9), though runtime spiked to 20.6 ms/molecule. A final speed-focused pass (0.1.5) halved runtime to 10.2 ms/molecule while slightly improving accuracy.
Limitations and Future Work
- Valid, not preferred: Because OPSIN only checks round-trip validity, NISPO’s names often differ from strict IUPAC Blue Book standards and shouldn't be used where preferred nomenclature is mandatory.
- Unreadable code: Code quality was not an objective; as a result, NISPO’s codebase ignores human conventions (one script alone is 22,203 lines long).
- Human steering is still essential: Current agents cannot yet set their own intermediate goals or resist exploiting imperfect verifiers without human oversight. The authors propose OPSIN-verified IUPAC naming as a benchmark for future long-horizon autonomous software engineering.
Summary updated