PlayTrain: An Efficient Reinforcement Learning Framework for LLM-Generated Adaptable JavaScript Games
Ryan Truong, Lance Ying, Samuel J. Gershman, Kazuki Irie
Key points
From the paper's conclusion- Here we present PlayTrain, an RL framework that combines the abilities of large language models (LLMs) to robustly generate JavaScript (JS) games from a minimal human prompt, and an efficient pipeline that can run any JS game in a standard 'gym' environment.
Abstract
While many video-game environments (VGEs) have played crucial roles in advancing reinforcement learning (RL), developing novel VGEs or modifying existing ones to support new features, has been a laborious process requiring extensive hand-coding. Here we present PlayTrain, an RL framework that combines the abilities of large language models (LLMs) to robustly generate JavaScript (JS) games from a minimal human prompt, and an efficient pipeline that can run any JS game in a standard 'gym' environment. Not only are recent LLMs particularly good at writing JS code, but the JS format also allows users to easily play generated VGEs, while PlayTrain enables us to train RL agents on the exact same games. We demonstrate multiple use cases of PlayTrain, including cloning well-known Atari and ProcGen games in simple JS, where PlayTrain trains pixel-based agents end-to-end at over 1M agent-decisions per second on a single GPU node; and creating modified versions thereof (e.g., that support novel test sets, procedural generation logics, or game dynamics). Through PlayTrain, we reimagine RL VGE development: all we need is a single JS file, generated and modified through an LLM. We discuss promising future RL research directions that PlayTrain unlocks.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- From Game Generation to Game Playing: Fully Automated Ability Training for Vision-Language-Action ModelsarXiv · 2026
- GAMEGO: Training Game-Dev Agents with Synthetic Trajectories Anchored in Real-World AssetsarXiv · 2026
- Game2Player: Scaling Gameplay Experience for Visual Agents through Environment-Player Co-DevelopmentarXiv · 2026
- Coding4Games: Can Modern Coding Agents Play Modern Video Games?arXiv · 2026
- VibeGame: Prompt-to-Game Development with AI-Native Engine and Self-Evolving Adversarial Agent TeamarXiv · 2026
- RSIGame: Autonomous Agentic Game Development with Recursive Self-improvementarXiv · 2026