SamuelBang/AesCoder-4B

Hugging Face
TEXT GENERATIONConcurrency Cost:1Model Size:4BQuant:BF16Ctx Length:32kPublished:Oct 25, 2025License:apache-2.0Architecture:Transformer0.1K Open Weights Warm

AesCoder-4B is a 4 billion parameter model developed by SamuelBang (Microsoft Research Asia, Shanghai Jiao Tong University, Peking University) specifically designed to enhance the aesthetic quality of LLM-generated code, particularly for webpage design. It was trained using the AesCode-358K dataset and an agentic reward feedback system, integrating executability, static, and interactive aesthetics. This model excels at generating visually appealing and functional web code, outperforming larger models like GPT-4o and GPT-4.1 on code aesthetics benchmarks.

Loading preview...

AesCoder-4B: Code Aesthetics with Agentic Reward Feedback

AesCoder-4B is a 4 billion parameter model developed by SamuelBang and researchers from Microsoft Research Asia, Shanghai Jiao Tong University, and Peking University. It addresses the challenge of Large Language Models (LLMs) struggling with the visual aesthetics of generated code, particularly for webpage design.

Key Capabilities & Innovations

  • Enhanced Code Aesthetics: AesCoder-4B is specifically trained to improve the aesthetic quality of LLM-generated code, moving beyond traditional functional correctness.
  • AesCode-358K Dataset: A large-scale instruction-tuning dataset focused on code aesthetics was constructed to train the model.
  • Agentic Reward Feedback: Utilizes a multi-agent system to evaluate code based on executability, static aesthetics, and interactive aesthetics.
  • GRPO-AR Algorithm: Integrates these aesthetic signals into the GRPO algorithm for joint optimization of code functionality and visual appeal.
  • OpenDesign Benchmark: A new benchmark was developed to assess code aesthetics, on which AesCoder-4B demonstrates strong performance.

Performance & Use Cases

Experimental results show that AesCoder-4B significantly improves performance on the OpenDesign benchmark and enhances results on existing benchmarks like PandasPlotBench. Notably, it surpasses GPT-4o and GPT-4.1 in code aesthetics and achieves performance comparable to much larger open-source models (480B-685B parameters).

This model is particularly well-suited for generating visually appealing and functional web code, including:

  • Website Design: Creating complete, modern, and responsive HTML pages with embedded CSS and JavaScript.
  • Game Development: Building browser-based interactive games.
  • 3D Design: Generating HTML pages with 3D graphics and animations using WebGL or libraries like Three.js.
  • Data Visualization: Producing dynamic data visualizations and interactive charts.
  • UI Component Generation: Crafting visually stunning, interactive, and responsive UI components.