PlayTrain:面向LLM生成的可适配JavaScript游戏的高效强化学习框架 PlayTrain: An Efficient Reinforcement Learning Framework for LLM-Generated Adaptable JavaScript Games 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-09-08
⬇️ 3 次下载
👁️ 预览文献
💡 AI 中文简介
PlayTrain是一个强化学习框架,利用大语言模型根据简单提示生成JavaScript游戏,并自动在标准gym环境中运行。它能在单GPU节点上以每秒超100万次决策的速度端到端训练像素级智能体,还能轻松修改游戏规则或生成新测试集。这大大简化了游戏环境的开发,为强化学习研究提供了新工具。
领域强化学习与游戏环境生成
适合谁读需要一定专业背景(强化学习或大语言模型基础)
核心贡献1. 提出PlayTrain框架,首次将LLM生成的JavaScript游戏与标准gym环境无缝集成,实现端到端训练。2. 展示高效训练能力,单GPU节点上每秒处理超100万次智能体决策,并支持游戏修改与程序化生成。
关键数据单GPU节点上每秒超过1M智能体决策;成功克隆Atari和ProcGen游戏;支持修改游戏动态、程序生成逻辑和新测试集。
推荐理由如果你对用大模型自动生成游戏并训练AI感兴趣,这篇工作展示了如何用简单JS文件快速搭建强化学习环境,速度惊人,值得一读!
关键词["强化学习", "大语言模型", "游戏环境", "JavaScript", "程序生成", "高效训练"]

原文摘要

查看英文原文摘要

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.