How do Language Models Bind Entities in Context?

Jiahai Feng, Jacob Steinhardt
10/1/2023

No official code found. Best implementation: jiahai-feng/binding-iclr (19 stars, last commit 2024-03-05).

Abstract

To correctly use in-context information, language models (LMs) must bind entities to their attributes. For example, given a context describing a"green square"and a"blue circle", LMs must bind the shapes to their respective colors. We analyze LM representations and identify the binding ID mechanism: a general mechanism for solving the binding problem, which we observe in every sufficiently large model from the Pythia and LLaMA families. Using causal interventions, we show that LMs' internal activations represent binding information by attaching binding ID vectors to corresponding entities and attributes. We further show that binding ID vectors form a continuous subspace, in which distances between binding ID vectors reflect their discernability. Overall, our results uncover interpretable strategies in LMs for representing symbolic knowledge in-context, providing a step towards understanding general in-context reasoning in large-scale LMs.

View on arXivView PDF

Code Implementations(1)

194Python, Jupyter NotebookFeb 12, 20242 years ago

Similar Papers

Cite this paper

@article{feng2023language,
  title  = {How do Language Models Bind Entities in Context?},
  author = {Jiahai Feng and Jacob Steinhardt},
  year   = {2023},
  eprint = {2310.17191},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.17191},
  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.17191.svg)](https://codeofpaper.com/paper/2310.17191)

Discussion