Visualization Generation with Large Language Models: An Evaluation
Xinyu Wang, Chenwei Liang, Shunyuan Zheng, Jinyuan Liang, Guozheng Li, Yu Zhang, Chi Harold Liu
TL;DR
The paper addresses NL2VIS by systematically evaluating six open-source LLMs across eight prompt strategies to generate Vega-Lite specifications from nvBench data. It introduces a baseline evaluation framework, reports large performance disparities tied to prompt design, chart type, and model, and uncovers counterintuitive findings such as the limited value of deeper reasoning and the benefit of explicit exemplars. It also identifies nvBench limitations (query errors, mapping issues, and data/label inaccuracies) that can skew results and suggests benchmark improvements and more grounded prompting. Overall, the work provides a foundation for reliable, interpretable NL2VIS systems and guides future research on prompt design, evaluation methodologies, and benchmark quality.
Abstract
The frequent need for analysts to create visualizations to derive insights from data has driven extensive research into the generation of natural Language to Visualization (NL2VIS). While recent progress in large language models (LLMs) suggests their potential to effectively support NL2VIS tasks, existing studies lack a systematic investigation into the performance of different LLMs under various prompt strategies. This paper addresses this gap and contributes a crucial baseline evaluation of LLMs' capabilities in generating visualization specifications of NL2VIS tasks. Our evaluation utilizes the nvBench dataset, employing six representative LLMs and eight distinct prompt strategies to evaluate their performance in generating six target chart types using the Vega-Lite visualization specification. We assess model performance with multiple metrics, including vis accuracy, validity and legality. Our results reveal substantial performance disparities across prompt strategies, chart types, and LLMs. Furthermore, based on the evaluation results, we uncover several counterintuitive behaviors across these dimensions, and propose directions for enhancing the NL2VIS benchmark to better support future NL2VIS research.
