Figures as Programs: Recursive Generation of Editable Scientific Figures

Yepeng Liu, Dasen Dai, Chengzhi Liu, Yiren Song, Hai Ci, Yu Zhang, Qi Zhang, Mike Zheng Shou, Xin Eric Wang, Yuheng BuarXiv 2026

TL;DR

FigTree is a multi-agent system that transforms research papers into high-quality, editable scientific figures by treating them as SVG programs rather than static images. By recursively decomposing complex diagrams into smaller, manageable code fragments and using a "render-critic" loop to debug both the visual output and the underlying code, FigTree achieves superior semantic accuracy and editability compared to state-of-the-art raster-based models.

What Problem Does This Paper Address?

Scientific methodology figures are crucial for communication, but they are notoriously difficult to automate. While recent AI models like DALL-E or GPT-4 can generate visually impressive images, they struggle with the precision required for research.

The authors identify three main hurdles in current "raster-based" (pixel-based) generation:

  1. Semantic Grounding: Models often hallucinate elements or fail to capture the specific logic of a paper.
  2. Spatial Planning: It is difficult for a model to layout dozens of interdependent components (boxes, arrows, labels) in a single pass without overlaps or misalignments.
  3. Editability: Raster images are "black boxes." If one label is wrong or an arrow is misplaced, you often have to regenerate the entire image, which might change everything else. There is no way to surgically edit a single element.

Methods

The core innovation of FigTree is recasting figure generation as recursive SVG program construction. Instead of predicting pixels, the system writes code.

The FigTree workflow: Grounding, Recursive Construction, and Render-Critic Refinement.

The system operates through a multi-agent pipeline:

  • Paper Grounding: A "grounder" agent extracts a structured content plan (modules, data flow, notation) and a global style guide from the paper text.
  • Recursive Decomposition: The figure is treated as a hierarchy. The system breaks a complex diagram into sub-regions (e.g., "Encoder" vs. "Decoder"). Each region is generated as a short, simple SVG fragment.
  • Parent-Owned Connections: To prevent messy "spaghetti" arrows, parent nodes—which have visibility into multiple sub-regions—are responsible for drawing the connections between their children.
  • Render-Critic Refinement: This is a "dual-space" review. A critic agent inspects both the rendered PNG (to find visual flaws like overlapping text) and the SVG source code. Because the figure is code, the critic can trace a visual defect to a specific line of SVG and instruct a "worker" agent to fix just that line.

Datasets

The authors evaluated FigTree using:

  • PaperBananaBench: A dataset of 292 methodology-figure cases curated from NeurIPS 2025 papers, providing method descriptions, captions, and human-drawn reference figures.
  • AutoFigure-Edit Bench: Used to build a "verification memory"—a library of common defect-repair rules that the critic agent uses to maintain high standards for academic aesthetics.

Key Insights and Ideas

  • Code is the Better Representation: By generating SVG, every element (a box, a line, a piece of text) has a unique address. This makes the figure "resolution-independent" and perfectly editable by both humans and AI agents.
  • Divide and Conquer: Recursive decomposition turns a "long-horizon" generation problem (which is prone to error accumulation) into many small, "short-horizon" tasks. An error in one small fragment doesn't necessarily break the rest of the layout.
  • The Power of the Critic's Memory: Rather than relying on vague "looks good" judgments, the system uses a frozen set of academic design rules (e.g., "arrows must be at least 20px long," "use Times New Roman to match LaTeX").

Key Results

FigTree significantly outperformed both standalone image generators and complex agentic raster frameworks.

Table 1: Reference-based evaluation results showing FigTree's dominance across all quality dimensions.
  • Overall Performance: FigTree achieved an overall score of 59.59%, beating the strongest raster-based baseline (Crafter) by nearly 10 points.
  • Hallucination Control: In fine-grained diagnostic testing, FigTree scored 8.59/10 for hallucination control, far exceeding models like Nano Banana Pro (3.36/10).
  • Iterative Editing: The authors found that while raster models often plateau or even degrade in quality during multi-turn editing, FigTree’s vector-based approach allowed for steady improvement, eventually reaching a quality score of 8.46 after eight rounds of refinement.
Table 2: Fine-grained diagnostic evaluation across eight dimensions.

Limitations and Future Work

  • Structural Complexity: The system currently uses an adaptive tree depth capped at 10. Extremely dense diagrams might still challenge the decomposition logic.
  • Stylistic Range: While excellent for clean, academic diagrams, the system is constrained by the primitives available in SVG and the specific "academic style" programmed into its agents. It may not be suitable for more artistic or illustrative scientific art.
  • Future Directions: The authors suggest integrating more advanced mathematical rendering (like direct LaTeX integration within the SVG) and expanding the system to handle multi-page poster generation.

Summary updated

BibTeX
@misc{liu2026figures,
  author = {Yepeng Liu and Dasen Dai and Chengzhi Liu and Yiren Song and Hai Ci and Yu Zhang and Qi Zhang and Mike Zheng Shou and Xin Eric Wang and Yuheng Bu},
  title = {{Figures as Programs: Recursive Generation of Editable Scientific Figures}},
  year = {2026},
  eprint = {2609.01006},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.01006},
}
Figure