PlayTrain: An Efficient Reinforcement Learning Framework for LLM-Generated Adaptable JavaScript Games
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.
Create a lesson
Metadata
- Comments
- 36 pages. v2: adds a Craftax-Classic figure and AI-use, ethics and reproducibility statements, removes the bigfish code figure, condenses the main text, and revises the appendix. Code and data: https://github.com/heyodog0/playtrain/releases/tag/paper-v2
Related papers
CHORD: Rollout-Free Off-Policy Replay of the Denoising Chain for Sample-Efficient Diffusion-Policy Reinforcement Learning
Shared title terminologycs.LGKuanyen Liu, Ren-jyun Huang, Chong-Yan Chen et al.
Poetics: A Unified Training Framework for Generative Patient Models
Shared title terminologycs.LGYoucheng Li, Xiaoyan Liu, Zican Hu et al.
TGRL: Temperature-Grouped Reinforcement Learning for Efficient Exploration in LLMs
Shared title terminologycs.LGZihan Lin, Xiaohan Wang, Jie Cao et al.
Chameleon: Dynamic Format Adapter for Efficient Diffusion
Shared title terminologycs.LGArnab Sanyal, Sandeep Chinchali
Policy Plasticity Matters in Offline-to-Online Reinforcement Learning: Refitting Offline Policies for Online Adaptation
Shared title terminologycs.LGYuheng Huang, Yunpeng Qing, Yixiao Chi et al.
From Static Policies to Adaptive Priors in Offline Reinforcement Learning
Shared title terminologycs.LGTianwei Ni, Vineet Jain, Akash Karthikeyan et al.