测试大模型单次生成可运行游戏场景,发现全失败因缺乏引擎知识。
Knowledge-Conditioned, Single-Pass LLM Synthesis of Executable Unity Game Scenes: A Compiler Error Census across 26 Goal Playable Concepts

- 去掉迭代修复,只看第一次生成的代码是否能编译。
- 10400次生成全部失败,9万多条错误主要分类型和结构问题。
- 不同玩法需求对引擎知识依赖不同,揭示生成瓶颈所在。
大型语言模型(LLMs)可编写Unity C#代码生成游戏场景。然而,现有演示大多依赖迭代修复循环,不断重写直至编译通过,混淆了模型原始输出与修复结果。本文移除该循环,采用单次生成策略,即首次草稿即为最终结果,从而隔离模型的参数化知识,进行最严格的无辅助生成评估。在10,400次生成中(4个开源模型,7B–30B规模;2种生成模式;4种中间表示条件水平;26个目标模式;20个随机种子),所有生成代码均无法编译成可运行场景,避免了幸存者偏差。为理解代码失败原因,将90,673次编译错误归类为两类:根基性错误(虚构或误用Unity类型与API)与卫生性错误(无需Unity知识的结构缺陷)。两类错误分布随目标模式显著变化(如潜行模式多因虚构引擎引用失败,夺旗模式则多为普通C#结构问题)。更大模型、更严格中间表示及不同生成模式虽改变错误类型,但始终无法生成可运行场景。核心瓶颈在于缺少引擎特异性知识。该普查按需求对目标模式排序,揭示单次生成在何处失效,为设计者提供关键参考。
原文摘要 · Abstract (English)
Large language models (LLMs) write Unity C\# for game scenes. Yet nearly all demonstrations rest on an iterative repair loop that regenerates code until it compiles, conflating what the model writes with what the loop fixes. We remove the loop and evaluate a single pass, where the first draft is final. This isolates the model's parametric knowledge, the most stringent test of unaided generation. Models instantiate Goal Playable Concepts, playable counterparts of goal patterns, across 10,400 generations (four open-weight models, 7B--30B; two generation modes; four intermediate-representation (IR) conditioning levels; 26 goal patterns; 20 seeds). None compiled into a runnable scene, leaving no survivorship bias. To understand how the generated C\# scripts fail, we categorize the 99 error codes behind 90{,}673 compiler-error occurrences as Grounding (invented or misused Unity types and APIs) or Hygiene (structural defects needing no Unity knowledge). The split differs sharply by goal pattern (e.g., Stealth fails mostly on invented engine references; Capture on plain C\# structure). Larger models, stricter IRs, and different generation modes move the errors but never yield a compiling scene. The bottleneck is missing engine-specific knowledge. The census orders goal patterns by that demand, showing designers where single-pass generation breaks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。