Skip to main content
QUICK REVIEW

[Paper Review] Visualization Generation with Large Language Models: An Evaluation

Xinyu Wang, Liang, Chenwei|arXiv (Cornell University)|Jan 20, 2024
Data Mining Algorithms and ApplicationsComputer Science9 citations
TL;DR

GPT-3.5 with Vega-Lite shows strong NL2VIS performance on nvBench, with few-shot prompts outperforming zero-shot prompts and surpassing prior NL2VIS approaches.

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.

Motivation & Objective

  • Evaluate the capability of a large language model to generate Vega-Lite visualizations from natural language queries (NL2VIS).
  • Assess the impact of zero-shot vs. few-shot prompting strategies on NL2VIS performance.
  • Identify limitations in model outputs and benchmarks to guide future NL2VIS research and evaluation.

Proposed method

  • Use GPT-3.5 as the representative LLM to generate Vega-Lite specifications.
  • Represent Vega-Lite specifications with the Vega-Lite grammar as the target output.
  • Employ nvBench as the NL2VIS benchmark dataset.
  • Design and compare zero-shot and few-shot prompting strategies.
  • In zero-shot prompts, introduce ground-truth-inspired rules to reduce common errors.
  • In few-shot prompts, provide chart-type–matched examples to guide generation.

Experimental results

Research questions

  • RQ1How capable is GPT-3.5 at generating correct Vega-Lite specifications from natural language queries?
  • RQ2Do few-shot prompts yield higher NL2VIS accuracy than zero-shot prompts for Vega-Lite generation?
  • RQ3What are the main sources of error in GPT-3.5 NL2VIS outputs and how do they relate to Vega-Lite grammar and data attribute understanding?
  • RQ4What refinements to the NVBench benchmark could improve NL2VIS evaluation?

Key findings

  • GPT-3.5 demonstrates strong Vega-Lite generation performance on nvBench, outperforming previous NL2VIS approaches.
  • Few-shot prompting yields higher accuracy than zero-shot prompting in NL2VIS with Vega-Lite.
  • GPT-3.5 still makes Vega-Lite grammar errors and sometimes misinterprets data attributes, affecting correctness.
  • Several benchmark issues identified: some ground-truth visualizations do not fully align with task descriptions or contain ambiguities, impacting evaluation.
  • Certain issues with Vega-Lite transforms (e.g., sort usage) reveal limitations of rule-based prompt guidance and grammar adherence.
  • Ground-truth and benchmark ambiguities are highlighted as directions for future improvement.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.