Emergent World Models and Latent Variable Estimation in Chess-Playing Language Models

Adam Karvonen
3/21/2024
cs.LGcs.CL

No official code found. Best implementation: adamkarvonen/chess_llm_interpretability (221 stars, last commit 2024-11-18).

Abstract

Language models have shown unprecedented capabilities, sparking debate over the source of their performance. Is it merely the outcome of learning syntactic patterns and surface level statistics, or do they extract semantics and a world model from the text? Prior work by Li et al. investigated this by training a GPT model on synthetic, randomly generated Othello games and found that the model learned an internal representation of the board state. We extend this work into the more complex domain of chess, training on real games and investigating our model's internal representations using linear probes and contrastive activations. The model is given no a priori knowledge of the game and is solely trained on next character prediction, yet we find evidence of internal representations of board state. We validate these internal representations by using them to make interventions on the model's activations and edit its internal board state. Unlike Li et al's prior synthetic dataset approach, our analysis finds that the model also learns to estimate latent variables like player skill to better predict the next character. We derive a player skill vector and add it to the model, improving the model's win rate by up to 2.6 times.

View on arXivView PDF

Code Implementations(1)

Visualizing the internal board state of a GPT trained on chess PGN strings, and performing interventions on its internal board state and representation of player Elo.

22125Python, Jupyter NotebookDec 31, 20231 years ago

Cite this paper

@article{karvonen2024emergent,
  title  = {Emergent World Models and Latent Variable Estimation in Chess-Playing Language Models},
  author = {Adam Karvonen},
  year   = {2024},
  eprint = {2403.15498},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2403.15498v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2403.15498.svg)](https://codeofpaper.com/paper/2403.15498)

Discussion