Skip to main content
QUICK REVIEW

[Paper Review] MarioGPT: Open-Ended Text2Level Generation through Large Language Models

Shyam Sudhakaran, Miguel González-Duque|arXiv (Cornell University)|Feb 12, 2023
Topic ModelingComputer Science25 citations
TL;DR

MarioGPT fine-tunes GPT-2 for text-prompted, playable Mario levels and combines it with novelty search to produce diverse, open-ended content with ~88% playability.

ABSTRACT

Procedural Content Generation (PCG) is a technique to generate complex and diverse environments in an automated way. However, while generating content with PCG methods is often straightforward, generating meaningful content that reflects specific intentions and constraints remains challenging. Furthermore, many PCG algorithms lack the ability to generate content in an open-ended manner. Recently, Large Language Models (LLMs) have shown to be incredibly effective in many diverse domains. These trained LLMs can be fine-tuned, re-using information and accelerating training for new tasks. Here, we introduce MarioGPT, a fine-tuned GPT2 model trained to generate tile-based game levels, in our case Super Mario Bros levels. MarioGPT can not only generate diverse levels, but can be text-prompted for controllable level generation, addressing one of the key challenges of current PCG techniques. As far as we know, MarioGPT is the first text-to-level model and combined with novelty search it enables the generation of diverse levels with varying play-style dynamics (i.e. player paths) and the open-ended discovery of an increasingly diverse range of content. Code available at https://github.com/shyamsn97/mario-gpt.

Motivation & Objective

  • Motivated by the need for controllable, diverse Procedural Content Generation (PCG) in games.
  • Propose a text-prompt conditioned level generator using a fine-tuned language model.
  • Enable open-ended content discovery by integrating with novelty-search driven evolution.
  • Demonstrate playability and prompt controllability of generated levels.

Proposed method

  • Fine-tune a distilled GPT-2 (DistilGPT-2) on Mario level tokens to predict next tokens across level sequences.
  • Represent levels as tile strings tokenized by Byte Pair Encoding and sampled in 50-column windows.
  • Incorporate prompt information via a frozen BART encoder whose average hidden state feeds cross-attention in MarioGPT.
  • Inpaint level borders with a MarioBert model to preserve path consistency after mutations.
  • Combine MarioGPT with novelty-search (NS-MarioGPT) to mutate elites and encourage behavioral diversity of predicted player paths.
  • Evaluate tile prediction accuracy, level playability using A* agent, and prompt controllability; assess memorization and diversity.

Experimental results

Research questions

  • RQ1Can a fine-tuned language model conditioned on natural-language prompts generate playable, controllable Super Mario Bros levels?
  • RQ2Does integrating a novelty-search loop with an LLM-based mutation operator produce diverse, open-ended level content?
  • RQ3How well do prompt descriptions map to generated level properties (pipes, enemies, blocks, elevation)?
  • RQ4What is the playability and path similarity between model-predicted paths and agent trajectories?
  • RQ5To what extent does the model memorize training data, and can sampling strategies mitigate memorization while preserving quality?

Key findings

  • 88.4% of MarioGPT-generated levels are playable by a standard A* agent.
  • Tile prediction accuracy for non-air tiles reaches 93% on validation when using MarioGPT.
  • Prompt-conditioned generations align with prompts in most cases (e.g., pipes 81%, blocks 92%, elevation 76%).
  • Novelty-search with MarioGPT enables open-ended, diverse level generation across an archive of paths and levels.
  • Levels produced via NS-MarioGPT cover increasingly larger regions of the behavior space, with about 78% of path coordinates filled after 300 levels.
  • Memorization dynamics are present; higher sampling temperatures increase diversity but reduce quality.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.