Table of Contents
Fetching ...

From Gameplay Traces to Game Mechanics: Causal Induction with Large Language Models

Mohit Jiwatode, Alexander Dockhorn, Bodo Rosenhahn

TL;DR

This work tackles the problem of causal understanding in game-playing AI by proposing Causal Induction: using Large Language Models (LLMs) to reverse-engineer Video Game Description Language (VGDL) rules from gameplay traces. It introduces a neurosymbolic, SCM-guided two-stream synthesis framework in which an intermediate Structural Causal Model (SCM) is inferred before generating VGDL, and benchmarks this against direct VGDL generation. Across a semantically diverse GVGAI 9-game benchmark, the SCM-guided approach consistently yields higher fidelity and logical consistency, with up to 81% expert preference in blind judgments, and enables downstream causal reinforcement learning, interpretable agents, and principled procedural content generation. The results support the thesis that explicitly structured causal reasoning provides a strong inductive bias beyond pattern matching, offering a path toward more robust, explainable game-playing systems.

Abstract

Deep learning agents can achieve high performance in complex game domains without often understanding the underlying causal game mechanics. To address this, we investigate Causal Induction: the ability to infer governing laws from observational data, by tasking Large Language Models (LLMs) with reverse-engineering Video Game Description Language (VGDL) rules from gameplay traces. To reduce redundancy, we select nine representative games from the General Video Game AI (GVGAI) framework using semantic embeddings and clustering. We compare two approaches to VGDL generation: direct code generation from observations, and a two-stage method that first infers a structural causal model (SCM) and then translates it into VGDL. Both approaches are evaluated across multiple prompting strategies and controlled context regimes, varying the amount and form of information provided to the model, from just raw gameplay observations to partial VGDL specifications. Results show that the SCM-based approach more often produces VGDL descriptions closer to the ground truth than direct generation, achieving preference win rates of up to 81\% in blind evaluations and yielding fewer logically inconsistent rules. These learned SCMs can be used for downstream use cases such as causal reinforcement learning, interpretable agents, and procedurally generating novel but logically consistent games.

From Gameplay Traces to Game Mechanics: Causal Induction with Large Language Models

TL;DR

This work tackles the problem of causal understanding in game-playing AI by proposing Causal Induction: using Large Language Models (LLMs) to reverse-engineer Video Game Description Language (VGDL) rules from gameplay traces. It introduces a neurosymbolic, SCM-guided two-stream synthesis framework in which an intermediate Structural Causal Model (SCM) is inferred before generating VGDL, and benchmarks this against direct VGDL generation. Across a semantically diverse GVGAI 9-game benchmark, the SCM-guided approach consistently yields higher fidelity and logical consistency, with up to 81% expert preference in blind judgments, and enables downstream causal reinforcement learning, interpretable agents, and principled procedural content generation. The results support the thesis that explicitly structured causal reasoning provides a strong inductive bias beyond pattern matching, offering a path toward more robust, explainable game-playing systems.

Abstract

Deep learning agents can achieve high performance in complex game domains without often understanding the underlying causal game mechanics. To address this, we investigate Causal Induction: the ability to infer governing laws from observational data, by tasking Large Language Models (LLMs) with reverse-engineering Video Game Description Language (VGDL) rules from gameplay traces. To reduce redundancy, we select nine representative games from the General Video Game AI (GVGAI) framework using semantic embeddings and clustering. We compare two approaches to VGDL generation: direct code generation from observations, and a two-stage method that first infers a structural causal model (SCM) and then translates it into VGDL. Both approaches are evaluated across multiple prompting strategies and controlled context regimes, varying the amount and form of information provided to the model, from just raw gameplay observations to partial VGDL specifications. Results show that the SCM-based approach more often produces VGDL descriptions closer to the ground truth than direct generation, achieving preference win rates of up to 81\% in blind evaluations and yielding fewer logically inconsistent rules. These learned SCMs can be used for downstream use cases such as causal reinforcement learning, interpretable agents, and procedurally generating novel but logically consistent games.
Paper Structure (39 sections, 11 figures, 3 tables)

This paper contains 39 sections, 11 figures, 3 tables.

Figures (11)

  • Figure 1: 2D UMAP projection of the 80 games across 9 semantic clusters. The representative games are marked within their respective regions.
  • Figure 2: Task 1 Workflow: The model predicts the game label based on a sequence of observations and a game description. The description is either fixed (Standard) or generated/refined by the LLM (Cons, Dest, VGDL) prior to classification.
  • Figure 3: Runtime vs. Accuracy with Pareto Front. The red line indicates the Pareto frontier. Qwen3-8B and QwQ-32B lie on the frontier, justifying their selection for the resource-intensive synthesis task.
  • Figure 4: Task II Workflow Diagram. This overview illustrates the hierarchical context engineering levels (left) feeding into the dual-stream generation architecture (right). Stream A utilizes direct synthesis, while Stream B enforces a Structural Causal Model (SCM) blueprint.
  • Figure 5: Model Performance by Description Mode. The figure illustrates the mean accuracy across description types. The stark drop in the $P_{Dest}$ trajectory compared to $P_{Standard}$ indicates that models lack complete internal knowledge of the games, relying heavily on provided context.
  • ...and 6 more figures