SamuelBang/AesCoder-4B

Warm
Public
4B
BF16
40960
Oct 25, 2025
License: apache-2.0
Hugging Face
Overview

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.