Estetica del Codice con Feedback di Ricompensa Agente
Code Aesthetics with Agentic Reward Feedback
October 27, 2025
Autori: Bang Xiao, Lingjie Jiang, Shaohan Huang, Tengchao Lv, Yupan Huang, Xun Wu, Lei Cui, Furu Wei
cs.AI
Abstract
I Large Language Model (LLM) sono diventati assistenti preziosi per gli sviluppatori in compiti relativi al codice. Sebbene gli LLM eccellano in compiti di programmazione tradizionali come la generazione di codice e la correzione di bug, faticano con compiti di codifica orientati all'aspetto visivo, producendo spesso un'estetica subottimale. In questo articolo, introduciamo una nuova pipeline per migliorare la qualità estetica del codice generato dagli LLM. In primo luogo, costruiamo AesCode-358K, un dataset su larga scala per l'instruction-tuning focalizzato sull'estetica del codice. Successivamente, proponiamo l'agentic reward feedback, un sistema multi-agente che valuta l'eseguibilità, l'estetica statica e l'estetica interattiva. Sulla base di ciò, sviluppiamo GRPO-AR, che integra questi segnali nell'algoritmo GRPO per l'ottimizzazione congiunta della funzionalità e dell'estetica del codice. Infine, sviluppiamo OpenDesign, un benchmark per valutare l'estetica del codice. I risultati sperimentali mostrano che combinare il supervised fine-tuning su AesCode-358K con il reinforcement learning utilizzando l'agentic reward feedback migliora significativamente le prestazioni su OpenDesign e migliora anche i risultati su benchmark esistenti come PandasPlotBench. Notevolmente, il nostro AesCoder-4B supera GPT-4o e GPT-4.1 e raggiunge prestazioni paragonabili a modelli open-source di grandi dimensioni con 480B-685B parametri, sottolineando l'efficacia del nostro approccio.
English
Large Language Models (LLMs) have become valuable assistants for developers
in code-related tasks. While LLMs excel at traditional programming tasks such
as code generation and bug fixing, they struggle with visually-oriented coding
tasks, often producing suboptimal aesthetics. In this paper, we introduce a new
pipeline to enhance the aesthetic quality of LLM-generated code. We first
construct AesCode-358K, a large-scale instruction-tuning dataset focused on
code aesthetics. Next, we propose agentic reward feedback, a multi-agent system
that evaluates executability, static aesthetics, and interactive aesthetics.
Building on this, we develop GRPO-AR, which integrates these signals into the
GRPO algorithm for joint optimization of functionality and code aesthetics.
Finally, we develop OpenDesign, a benchmark for assessing code aesthetics.
Experimental results show that combining supervised fine-tuning on AesCode-358K
with reinforcement learning using agentic reward feedback significantly
improves performance on OpenDesign and also enhances results on existing
benchmarks such as PandasPlotBench. Notably, our AesCoder-4B surpasses GPT-4o
and GPT-4.1, and achieves performance comparable to large open-source models
with 480B-685B parameters, underscoring the effectiveness of our approach.