TL;DR
This paper introduces WebGen-Bench, a new benchmark for evaluating Large Language Models (LLMs) on their ability to generate complete, functional websites from scratch. They also release WebGen-Instruct, a large training dataset, and demonstrate that fine-tuning an LLM on this data significantly improves website generation capabilities, even surpassing top proprietary models.
What Problem Does This Paper Address?
LLMs have shown promise in code generation, but evaluating their ability to build complex, multi-file applications like websites from scratch has been challenging. Existing benchmarks often focus on bug fixing or single-file tasks. There's a growing need for tools that can help non-experts build custom web applications, but a lack of standardized evaluation methods hinders progress in this area. This paper aims to fill that gap by providing a comprehensive benchmark and dataset for website generation.
Methods
The authors developed a rigorous process for creating their benchmark and evaluating LLM performance:
- Instruction Curation: They gathered website development project descriptions from various platforms, identified 20 common categories, and then had human annotators brainstorm specific web applications. GPT-4o was used to convert these into detailed, natural language instructions, excluding technical implementation details to assess the LLM's decision-making.
- Test Case Generation: For each instruction, GPT-40 generated test cases covering functionality and appearance. These were then manually filtered and refined to ensure accuracy and comprehensive coverage, resulting in 647 test cases.
- Automated Testing: A web navigation agent, WebVoyager, was employed to execute test cases on generated websites. This agent simulates user interactions and verifies if the website behaves as expected.
- Appearance Evaluation: GPT-4o was used to grade the aesthetic quality of generated websites on a scale of 1-5, considering rendering, content relevance, layout harmony, and modernness.
- Training Data Creation: They created WebGen-Instruct, a dataset of 6,667 website-generation instructions, carefully deduplicated to avoid contamination with the benchmark.
Datasets
- WebGen-Bench: A newly introduced benchmark consisting of 101 diverse website-generation instructions and 647 corresponding test cases. It's designed to evaluate LLM agents' ability to build multi-file websites from scratch.
- WebGen-Instruct: A newly introduced training dataset containing 6,667 website-generation instructions, used to fine-tune LLMs for improved website generation performance.
Key Insights and Ideas
- Website generation is HARD: Even the best LLM-powered agent frameworks struggle significantly with generating functional websites from scratch, achieving only around 27.8% accuracy on this benchmark. This highlights the complexity of the task, which involves planning, multi-file code management, and nuanced requirement fulfillment.
- Training data matters (a lot): Fine-tuning a model (Qwen2.5-Coder-32B-Instruct) on their custom WebGen-Instruct dataset dramatically improved performance, reaching 38.2% accuracy. This suggests that specialized training data is crucial for advancing LLM capabilities in complex domains.
- Appearance and Functionality are loosely correlated: While functional websites generally don't have major rendering issues, the paper notes that design validation testing sometimes yields higher accuracy than functional testing. This implies that superficial aspects like color themes might be easier for LLMs to implement than deeper internal functionalities.
Key Results
- The best-performing combination of agent framework and LLM (Bolt.diy with DeepSeek-R1) achieved 27.8% accuracy on the WebGen-Bench.
- Fine-tuning Qwen2.5-Coder-32B-Instruct on WebGen-Instruct resulted in 38.2% accuracy, surpassing the best proprietary model.
- The WebGen-LM family of models (fine-tuned from Qwen2.5-Coder) showed improved performance, with WebGen-LM-32B achieving the highest accuracy.
- Appearance scores showed a moderate correlation with accuracy, with Bolt.diy and Claude-3.5-Sonnet achieving the best appearance score of 3.0.
Limitations and Future Work
- Language Support: The benchmark currently focuses on TypeScript, JavaScript, CSS, and HTML. Expanding to other languages like Python, Java, and Go would be beneficial.
- Training Methods: The paper primarily used supervised fine-tuning. Exploring reinforcement learning or direct preference optimization could further enhance performance.
- Dataset Size: While WebGen-Instruct is substantial, the authors note that further improvements could be achieved with more training data or advanced techniques like data augmentation.
- LLM Capabilities: The benchmark's challenging nature suggests that current LLMs are still far from saturating its capabilities, indicating ample room for future research and development.
Summary updated