Language Models Represent Space and Time

Wes Gurnee, Max Tegmark
10/1/2023

No official code found. Best implementation: wesg52/world-models (263 stars, MIT, last commit 2023-10-17).

Abstract

The capabilities of large language models (LLMs) have sparked debate over whether such systems just learn an enormous collection of superficial statistics or a set of more coherent and grounded representations that reflect the real world. We find evidence for the latter by analyzing the learned representations of three spatial datasets (world, US, NYC places) and three temporal datasets (historical figures, artworks, news headlines) in the Llama-2 family of models. We discover that LLMs learn linear representations of space and time across multiple scales. These representations are robust to prompting variations and unified across different entity types (e.g. cities and landmarks). In addition, we identify individual"space neurons"and"time neurons"that reliably encode spatial and temporal coordinates. While further investigation is needed, our results suggest modern LLMs learn rich spatiotemporal representations of the real world and possess basic ingredients of a world model.

View on arXivView PDF

Code Implementations(1)

wesg52/world-modelsCommunity100%
MIT

Extracting spatial and temporal world models from LLMs

26326Shell, PythonOct 3, 20233 years agoMIT

Similar Papers

Cite this paper

@article{gurnee2023language,
  title  = {Language Models Represent Space and Time},
  author = {Wes Gurnee and Max Tegmark},
  year   = {2023},
  eprint = {2310.02207},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2310.02207},
  journal = {ICLR 2023 2023}
}

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/2310.02207.svg)](https://codeofpaper.com/paper/2310.02207)

Discussion