AI
Framework helps AI systems generate better visualization code from vague requests
A new system called VisPath uses multi-path reasoning and feedback loops to improve how language models create visualization scripts from underspecified natural language instructions.
Researchers have introduced VisPath, a framework designed to help large language models generate visualization code more reliably when users provide incomplete or ambiguous instructions. The system tackles a persistent challenge: even advanced LLMs struggle when requests lack critical details about data preprocessing, library choices, or other implementation specifics—often requiring manual fixes after the fact.
How the approach works#
Rather than treating an underspecified query as a single problem, VisPath breaks it into structured stages. The system begins by asking the LLM to reformulate the user's request using Chain-of-Thought prompting, which encourages step-by-step reasoning. This generates multiple candidate queries in parallel, each representing a plausible interpretation of what the user intended.
From these interpretations, VisPath synthesizes several candidate visualization scripts and actually runs them to produce output images. The system then evaluates the visual quality and correctness of each result, generating targeted feedback. This feedback is aggregated to guide synthesis of a final, optimized visualization—moving beyond simple one-shot generation to an iterative refinement process.
Performance gains#
Testing on MatPlotBench and the Qwen-Agent Code Interpreter Benchmark shows that VisPath outperforms existing methods. By enabling the LLM to explore multiple reasonable concretizations of an ambiguous request and learn from execution feedback, the framework provides a more robust alternative to current techniques like few-shot prompting and query expansion alone.
The work illustrates how breaking down an underspecified problem into parallel reasoning paths and leveraging execution feedback can improve AI-driven code generation for a practical task that many data professionals encounter daily.

