> Paper: Generating Statistical Charts with Validation-Driven LLM Workflows > Authors: Pavlin G. Poličar, Andraž Pevcin, Blaž Zupan > arXiv: 2605.00800 | 2026-05-01
The "Blind Box" Problem of LLM Chart Generation
Asking an LLM to generate a chart seems simple: give it data, have it write code. In practice, however, many issues only become visible after rendering:
- Post-rendering errors: overlapping labels, truncation, and scale distortion only appear in the final image
- Data–code mismatches: code may reference nonexistent columns or use wrong aggregations
- Readability issues: color choices, label placement, font sizes, and other aesthetic factors
- Validation difficulty: existing datasets rarely align code, rendered output, descriptions, and Q&A pairs
A Validation-Driven LLM Workflow
The paper proposes a structured multi-stage workflow:
1. Dataset Screening — assess whether the data is suitable for visualization; check quality and completeness. 2. Plot Proposal — recommend chart types based on data characteristics, reader needs, and the data story. 3. Code Synthesis — generate executable plotting code with standard libraries (matplotlib, seaborn, plotly, etc.). 4. Rendering — execute the code to produce the actual image: the key step from abstract code to concrete visuals. 5. Validation-Driven Refinement — the core innovation: automatically inspect the rendered image for overlaps, truncation, and proportion problems, then iteratively fix the code. 6. Description Generation — produce natural-language descriptions to keep charts accessible and understandable. 7. Question-Answer Generation — create comprehension questions about the chart to verify how well information is conveyed.
It is like giving the AI designer a quality inspector: not just generate, but verify, fix, and verify again.
Why Validation-Driven Matters
Traditional LLM chart generation is one-shot: write code → execute → hope it is correct. The validation-driven approach is iterative:
> write code → render → check → fix → re-render → re-check…
This resembles how human designers work: design, look, adjust, look again. The process also yields fully aligned data—executable code, dataset context, rendered images, natural-language descriptions, and QA pairs—providing high-quality supervision for training better chart-generation models.
Key Takeaways
If you use LLMs to generate visual content (charts, images, UIs), ask:
1. Am I validating only at the code level while ignoring visual-level validation? 2. Does my pipeline include a render–check–fix iteration loop? 3. Do I provide fully aligned data (code + rendering + description) for each output? 4. Can detection of visualization errors be automated?
The paper's central lesson: in visual tasks, "seeing" matters more than "writing." Generating code is only the first step; ensuring the code produces correct visual output through automated validation completes the solution. The ultimate goal of data visualization is not generating code, but generating charts that can be correctly understood.