Bringing Code ALIVE: Optimizing Interactive Frontend Mini-Games via Automated Play and Reinforcement Learning at Scale
Abstract
The rapid evolution of Large Language Models (LLMs) has empowered even non-programmers to create visually appealing frontend mini-games with a single instruction. However, open-source models significantly lag behind proprietary counterparts in this domain. The core bottleneck is the lack of an evaluation mechanism that balances reliability with scalability, as existing methods either fail to verify dynamic interactivity or incur prohibitive computational costs. To bridge this gap, we introduce ALIVE (Aligning LLMs via Interactive Visual Execution), a high-throughput framework that leverages one-shot planning and DOM-based analysis to automatically evaluate generated games at scale. Extensive experiments demonstrate that ALIVE significantly outperforms static judge baselines in identifying functional flaws while remaining orders of magnitude more efficient than GUI agents. Functioning as a scalable `pre-flight' evaluation layer, it curates high-quality data for Supervised Fine-Tuning (SFT) and provides a consistent reward signal for Reinforcement Learning (RL). We leverage this pipeline to train ALIVE-Coder, a model achieving superior performance in interactive frontend generation. To the best of our knowledge, our work offers the first scalable path to evaluate and optimize interactive code, substantially advancing open-source capabilities.
Lay Summary
Thanks to recent advances in AI, anyone — even without programming experience — can now describe a simple game idea in plain language and have an AI system automatically generate a playable, visually appealing mini-game. However, open-source AI models still fall far behind commercial products in this capability. A key reason for this gap is the lack of a reliable and efficient way to automatically test whether a generated game actually works correctly. Does the score update when you collect a coin? Does the character respond to keyboard input? Checking these interactive behaviors is fundamentally different from checking whether code merely looks right on the surface. Existing approaches either miss these dynamic interactions entirely, or require a human-like AI agent to manually "play" each game — which is far too slow and expensive to scale up. To solve this, we develop ALIVE, a framework that automatically plays generated games and evaluates whether they behave as intended, using a fast and lightweight approach inspired by how web browsers internally track page elements. ALIVE is dramatically faster than having an AI agent play games manually, while being far more accurate than simply checking the code's appearance. We use ALIVE to collect high-quality training data and feedback signals to teach an AI model — ALIVE-Coder — how to generate better interactive games. The result is an open-source model that significantly closes the gap with commercial AI systems in this challenging task, offering the first practical and scalable path to automatically evaluate and improve interactive code generation.