MechParser: A Vision-Language Framework for Parsing Chemical Reaction Mechanism Diagrams

Yufan Chen, Lu Shing Hin, Yujian Yuan, Ching Ting Leung, Hanyu GaoNeurIPS 2026

TL;DR

For decades, the secret life of chemical reactions—how electrons dance, bonds snap, and new ones form—has been locked away as hand-drawn curved arrows in textbook and journal diagrams, completely invisible to computers. MechParser breaks this bottleneck by teaching a compact Vision-Language Model to read those curved arrows and translate the step-by-step Choreography of organic chemistry into a machine-readable text sequence. By turning static, messy pictures into structured mechanistic data, it unlocks decades of chemical intuition for next-generation AI models.

What Problem Does This Paper Address?

If you ask an AI to predict the outcome of a chemical reaction today, it mostly learns by memorizing "before and after" snapshots—reactants go in, products come out. What’s missing is the why and how: the reaction mechanism.

Chemists communicate mechanisms using curved "electron-pushing" arrows drawn directly over molecular structures. Current Optical Chemical Structure Recognition (OCSR) tools are great at reading static molecules, but they treat those crucial curved arrows as visual noise to be ignored—or worse, get tripped up by them. Meanwhile, standard text notations for molecules (like SMILES or SMARTS) have no grammar for describing dynamic, step-by-step electron flow. Because manually annotating millions of multi-step reactions is prohibitively slow, AI for chemistry has been starved of authentic mechanistic data.

Figure 1: MechParser overview. MechParser parses mechanism diagrams from real literature or patents into SM-SMARTS, a sequential string representation that cumulatively encodes each curved-arrow step, including bond breaking, bond formation, and atom state changes. The framework combines arrow removal, OCSR, VLM-based arrow reasoning, and post-processing to produce the final SM-SMARTS output.

Methods

MechParser is a modular pipeline that separates reading the molecule from reading the arrows, alongside a new chemical grammar:

  • SM-SMARTS (New Representation): The authors extend standard SMARTS notation with seven new symbols that track bond changes (e.g., ! for breaking a bond, δ for forming one) and formal charge shifts (α for electron donors, γ for acceptors). Instead of just outputting the final product, SM-SMARTS outputs a cumulative sequence of strings—one per arrow—capturing the exact causal chain of the reaction.
  • Divide-and-Conquer Preprocessing: Curved arrows confuse molecule recognizers. So, MechParser first uses a segmentation model (SAM3) prompted with "curved arrow" to erase the arrows from the image. A standard graph-based OCSR tool (MolNexTR) then cleanly reads the underlying molecular scaffold and assigns an index number to every atom.
  • Left-Right Visual Prompting: Trying to read arrows and atom indices on a single cluttered diagram causes spatial confusion. Instead, the authors feed their vision-language model (MechParser-VL, a LoRA-adapted Qwen3-VL-4B) a side-by-side image: the original arrow-filled diagram on the left, and a clean, RDKit-redrawn reference molecule with numbered atoms on the right.
  • Four-Stage Curriculum + RL: MechParser-VL is trained progressively: starting with 200K single-arrow synthetic diagrams, moving to 100K multi-arrow chains, warming up on a mix of synthetic and real literature diagrams, and finishing with Group Relative Policy Optimization (GRPO)—a reinforcement learning step using a chemistry-aware reward to push accuracy past standard supervised limits.

Datasets

Because no large-scale arrow-annotated dataset existed, the authors built two from scratch:

  • Geometry-Aware Synthetic Dataset (303,000 samples): Starting from PubChem molecules, an automated engine draws 1–3 chained Bézier-curve arrows per molecule. It enforces strict chemical locality (arrows span 1–3 bonds) and geometric collision checks (arrows curve toward the reaction center without crashing into unrelated atoms or bonds), yielding 303K training and 10,000 evaluation (Synthetic-Eval) diagrams at zero manual cost.
  • Real-World Literature Dataset (1,191 samples): Curated from canonical organic chemistry textbooks and name-reaction compendia, double-annotated and verified by chemistry PhDs. Of these, 1,040 are used for domain adaptation and RL, while 151 diagrams (361 arrows) form Real-Eval, a strictly held-out benchmark for real-world deployment.

Key Insights and Ideas

  • Spatial disentanglement beats brute-force fine-tuning: Simply fine-tuning a 4B VLM on diagrams with atom numbers overlaid directly on top of the arrows scored 41.1% exact match—losing to zero-shot Gemini 2.5 Pro (51.7%). Switching to the side-by-side visual prompt and structured text jumped performance to 55.6% before even adding the curriculum or RL. Giving the model a clean workspace matters immensely.
  • Arrows actively poison OCSR: Running molecule recognition on raw diagrams succeeded only 57.0% of the time on real literature, crashing end-to-end accuracy to 33.1%. Erasing the arrows first with SAM3 vaulted OCSR accuracy to 93.4% and more than doubled end-to-end exact match to 76.2%.
  • Visual augmentation is the unsung hero: In ablation studies, removing visual data augmentation (varying fonts, bond widths, rotations) caused the single largest performance drop on real diagrams (-18.5% exact match), proving critical for bridging clean synthetic renders and messy textbook drawings.

Key Results

Because reaction mechanisms can have independent branches or concerted rings (like pericyclic reactions) with multiple valid arrow orderings, the authors evaluate using Equivalence-Aware Exact Match (EA-EM):

  • Crushing Zero-Shot Giants: On Real-Eval (using ground-truth scaffolds to isolate arrow reasoning), the 4B-parameter MechParser-VL achieves 80.1% EA-EM and 88.6% arrow F1. By comparison, GPT-4o (17.9%), GPT-5 (19.9%), and Claude Sonnet 4 (24.5%) struggle severely with spatial grounding, while the strongest baseline, Gemini 2.5 Pro, reaches 51.7% EA-EM.
  • End-to-End Automation: Running the full automated pipeline from raw image to SM-SMARTS—SAM3 arrow erasure, MolNexTR recognition, VLM arrow reasoning, and deterministic parsing—achieves 76.2% EA-EM and 84.5% SM-SMARTS F1 on Real-Eval, losing less than 4 points compared to using an oracle molecular scaffold.

Limitations and Future Work

In the main text, the authors note that MechParser currently handles the diagram-parsing stage—operating on individual mechanism figures—and defer a detailed breakdown of residual model failures and limitations to Appendices H and O (not included in the main paper body). Looking ahead, they highlight that combining MechParser with automated document figure detection and cross-panel atom mapping (tracking atoms across multi-step reaction schemes) will enable fully automated, literature-scale extraction of reaction mechanism databases to train mechanism-aware synthesis and prediction models.

Summary updated

Abstract

Reaction mechanisms are central to understanding chemical reactivity, guiding reaction prediction, synthesis design, and selectivity rationalization. In chemistry literature, they are universally depicted as curved electron-pushing arrows that capture stepwise electron flow and bond changes. Yet, this vast knowledge remains trapped in unstructured diagrams, forcing data-driven modeling to rely on small or template-expanded datasets. We introduce MechParser, a vision-language framework that converts mechanism diagrams into SM-SMARTS (Sequential Mechanism-Aware SMARTS), a representation encoding electron flow and atom state changes as a cumulative string sequence. At its core, MechParser-VL applies a left-right visual prompt design (arrow diagram alongside an atom-indexed reference) to separate dynamic arrow reasoning from static atom identification, and is trained via a four-stage curriculum on over 300K samples from a geometry-aware synthetic data pipeline and an expert-annotated real-world dataset. On both synthetic and real-world benchmarks, MechParser-VL substantially outperforms zero-shot proprietary and open-source VLMs, and controlled comparisons with task-adapted baselines on the same backbone and data trace its margin to the visual prompt and staged curriculum. By standardizing visual mechanisms into machine-readable data, MechParser lays the groundwork for constructing large-scale mechanism databases from the chemical literature, which in turn can support the training of advanced mechanism-centric models on authentic mechanistic data. Code, model weights and data are available at https://github.com/CYF2000127/MechParser.
BibTeX
@inproceedings{chen2026mechparser,
  author = {Yufan Chen and LU Shing Hin and Yujian Yuan and Ching Ting Leung and Hanyu Gao},
  title = {{MechParser: A Vision-Language Framework for Parsing Chemical Reaction Mechanism Diagrams}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Xv450nsgRJ},
}
Figure