TL;DR
Large Language Models (LLMs) are increasingly used for generating structured outputs, but existing benchmarks fall short. This paper introduces StructEval, a comprehensive benchmark covering 18 formats and 44 tasks, to rigorously evaluate LLMs' ability to produce both text-based (JSON, YAML) and visually renderable (HTML, React, SVG) structured data. Results show significant performance gaps, with even top models struggling with complex structures and visual generation.
What Problem Does This Paper Address?
As LLMs become more integrated into software development, their ability to generate accurate and well-formed structured outputs is crucial. Current benchmarks often focus on semantic quality or specific formats, leaving a gap in evaluating LLMs' general capabilities across a wide range of structured data types. This makes it difficult to understand their limitations and guide future development, especially for tasks requiring not just syntactically correct output, but also visually coherent and functional results.
Methods
StructEval employs a two-pronged approach to evaluate LLMs:
- Generation Tasks: LLMs are prompted with natural language descriptions and tasked with generating structured output.
- Conversion Tasks: LLMs are asked to translate structured data from one format to another (e.g., JSON to YAML).
The benchmark includes both StructEval-T for text-only formats (JSON, YAML, CSV, etc.) and StructEval-V for visually renderable formats (HTML, React, SVG, etc.). A novel evaluation framework is used, incorporating:
- Syntax Score: Checks for structural correctness and renderability.
- Keyword Matching Score: Verifies the presence of expected structural elements.
- Visual Question Answering (VQA) Score: For visual outputs, a vision-language model (GPT-4.1-mini) answers questions about the rendered output to assess fidelity.
Datasets
The paper introduces StructEval, a new benchmark dataset comprising 2,035 examples across 44 unique tasks and 18 structured output formats. This dataset is divided into two main subsets:
- StructEval-T: Focuses on text-only structures like JSON, XML, YAML, Markdown, and CSV.
- StructEval-V: Evaluates visually renderable outputs from code such as HTML, React, Matplotlib, Canvas, LaTeX, SVG, and Mermaid.
The dataset was constructed through a multi-stage annotation pipeline involving task curation, LLM-based synthesis, and expert review to ensure quality and diversity.
Key Insights and Ideas
- Significant Performance Gaps: Even state-of-the-art models like o1-mini struggle, achieving an average score of only 75.58%, with open-source models lagging by about 10 points. This highlights the ongoing challenge of generating complex structured outputs.
- Generation is Harder than Conversion: LLMs generally perform better on conversion tasks than on generation tasks, indicating that creating structures from scratch based on natural language is more demanding.
- Visual Rendering is More Difficult: Generating code that renders correct visual content is more challenging than producing text-only structures. This is particularly evident in formats like Mermaid and TikZ.
- Format-Specific Challenges: While LLMs excel at common formats like JSON and HTML, they struggle with less frequent or more complex formats like TOML, SVG, and Mermaid.
- Proprietary Models Lead: Commercial models generally outperform open-source models, especially on challenging tasks, suggesting an advantage in handling complex structural representations and reasoning.
Key Results
- Overall Performance: GPT-40 achieved the highest average score (76.02%), while the best open-source model, Qwen3-4B, scored 67.04%. The lowest-performing model was phi-3-mini-128k-instruct (40.79%).
- StructEval-T vs. StructEval-V: Generation tasks within StructEval-V (visual rendering) were found to be more challenging than those in StructEval-T (text-only).
- Task Type Performance: Models generally performed better on conversion tasks than generation tasks, with an exception for commercial models in StructEval-T generation.
- Challenging Subtasks: Tasks like Text→TOML, Text→SVG, and Text→Mermaid generation, and conversion tasks like Matplotlib→TikZ, proved difficult for all models.
Limitations and Future Work
- Non-interactive Formats: The current benchmark focuses on static visual rendering formats (HTML, React, Mermaid). It does not account for dynamic behaviors like page transitions or animations, which are crucial for real-world user interfaces. Future work could extend the benchmark to include dynamic rendering tasks.
- Expert Review Limitations: While the dataset underwent expert review, the initial content was LLM-generated, potentially retaining subtle biases. Future work could involve broader multi-annotator audits or automated bias detection.
- Future Model Development: The authors advocate for future LLMs to invest more effort in optimizing their abilities to generate highly structured output, particularly for less common and visually complex formats.
Summary updated