Automated Visualization Code Synthesis via Multi-Path Reasoning and Feedback-Driven Optimization
Journal:
arXiv
Published Date:
Feb 16, 2025
Abstract
Rapid advancements in Large Language Models (LLMs) have accelerated their
integration into automated visualization code generation applications. Despite
advancements through few-shot prompting and query expansion, existing methods
remain limited in handling ambiguous and complex queries, thereby requiring
manual intervention. To overcome these limitations, we propose VisPath: a
Multi-Path Reasoning and Feedback-Driven Optimization Framework for
Visualization Code Generation. VisPath handles underspecified queries through
structured, multi-stage processing. It begins by reformulating the user input
via Chain-of-Thought (CoT) prompting, which refers to the initial query while
generating multiple extended queries in parallel, enabling the LLM to capture
diverse interpretations of the user intent. These queries then generate
candidate visualization scripts, which are executed to produce diverse images.
By assessing the visual quality and correctness of each output, VisPath
generates targeted feedback that is aggregated to synthesize an optimal final
result. Extensive experiments on widely-used benchmarks including MatPlotBench
and the Qwen-Agent Code Interpreter Benchmark show that VisPath outperforms
state-of-the-art methods, offering a more reliable solution for AI-driven
visualization code generation.