Welcome to Journal of Graphics

Journal of Graphics ›› 2026, Vol. 47 ›› Issue (3): 511-523.DOI: 10.11996/JG.j.2095-302X.2026030511

• Image Processing and Computer Vision • Previous Articles     Next Articles

LlaMario: controllable Mario level generation based on large language models

GENG Yuxuan1, LU Yinan1, WU Tieru2, LI Wenhui1,3, MA Rui2()   

  1. 1 College of Computer Science and Technology, Jilin University, Changchun Jilin 130012, China
    2 School of Artificial Intelligence, Jilin University, Changchun Jilin 130012, China
    3 Jilin Animation Institute, Changchun Jilin 130013, China
  • Received:2025-08-15 Accepted:2026-01-21 Online:2026-06-30 Published:2026-06-30
  • Contact: MA Rui
  • Supported by:
    National Natural Science Foundation of China(62202199)

Abstract:

In game development, Procedural Content Generation (PCG) effectively reduces development costs and enhances the diversity of level design. Recent advances in integrating PCG with machine learning have demonstrated significant progress in game level generation. However, existing methods still exhibit limitations in generation controllability and adaptability to complex design intentions. To address these limitations, the LlaMario model was proposed to convert Mario game levels into character matrices for training with Large Language Models (LLMs), and then transformed the generated symbolic sequences into playable Mario levels. Specifically, we adopted the Llama 3.1-8B-instruct model combined with the efficient language model to fine-tune the Unsloth framework, empowering the model with enhanced level comprehension and generation capabilities. An instruction set of 40 000 entries derived from the Gemini model’s comprehension of level data was constructed and employed together with the data-efficient Alpaca instruction-tuning strategy for dataset construction; the resulting LlaMario trained on this dataset generated highly playable Mario levels from natural language descriptions. Experimental results validated that the proposed model achieved exceptional performance in level logical coherence, playability, complexity, and generation quality, successfully producing user-intended Mario game levels. Furthermore, the proposed framework demonstrated generality and was extended to other tile-based level generation tasks.

Key words: procedural content generation, large language models, game level generation, instruction fine-tuning, controllable level generation

CLC Number: