Do Large Language Models Understand Data Visualization Rules?
Organizations: Universidad Torcuato Di Tella, Buenos Aires, Argentina · Universidad de Buenos Aires, Buenos Aires, Argentina · Consejo Nacional de Investigaciones Científicas y Técnicas, Buenos Aires, Argentina
Abstract
Data visualization rules-derived from decades of research in design and perception-ensure trustworthy chart communication. While prior work has shown that large language models (LLMs) can generate charts or flag misleading figures, it remains unclear whether they can reason about and enforce visualization rules directly. Constraint-based systems such as Draco encode these rules as logical constraints for precise automated checks, but maintaining symbolic encodings requires expert effort, motivating the use of LLMs as flexible rule validators. In this paper, we present the first systematic evaluation of LLMs against visualization rules using hard-verification ground truth derived from Answer Set Programming (ASP). We translated a subset of Draco's constraints into natural-language statements and generated a controlled dataset of 2,000 Vega-Lite specifications annotated with explicit rule violations. LLMs were evaluated on both accuracy in detecting violations and prompt adherence, which measures whether outputs follow the required structured format. Results show that frontier models achieve high adherence (Gemma 3 4B / 27B: 100%, GPT-oss 20B: 98%) and reliably detect common violations (F1 up to 0.82),yet performance drops for subtler perceptual rules (F1 < 0.15 for some categories) and for outputs generated from technical ASP formulations.Translating constraints into natural language improved performance by up to 150% for smaller models. These findings demonstrate the potential of LLMs as flexible, language-driven validators while highlighting their current limitations compared to symbolic solvers.
Figures & tables
| Llama 3.1 8B | Llama 3.2 3B | Gemma3 4B | Gemma3 27B | GPT-oss 20B | |||||||
| Problem Name | F1 | STD | F1 | STD | F1 | STD | F1 | STD | F1 | STD | |
| encoding | size_negative | 0.05 | 0.00 | 0.05 | 0.01 | 0.04 | 0.00 | 0.35 | 0.01 | 0.98 | 0.02 |
| shape_without_point | 0.20 | 0.01 | 0.23 | 0.02 | 0.36 | 0.00 | 0.40 | 0.01 | 0.99 | 0.00 | |
| size_without_point_text | 0.33 | 0.01 | 0.32 | 0.01 | 0.41 | 0.00 | 0.12 | 0.01 | 1.00 | 0.00 | |
| same_field_x_and_y | 0.16 | 0.03 | 0.12 | 0.01 | 0.11 | 0.01 | 0.02 | 0.01 | 0.98 | 0.01 | |
| same_field | 0.20 | 0.00 | 0.19 | 0.01 | 0.29 | 0.01 | 0.37 | 0.01 | 0.82 | 0.01 | |
Data Visualization
Data visualization studies how visual representations help people explore, interpret, communicate, and reason about data.
See all 120 papers