atlas

Research map / Architectures and efficiency / Attention and transformers

Understanding Factual Recall in Transformers via Associative Memories

ICLR 2025 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows theoretically and empirically that linear/MLP associative memories and a one-layer transformer (attention and/or MLP) can store factual associations at near-linear-in-parameter capacity, analyzes gradient-flow hallucination dynamics, and gives information-theoretic lower bounds.

Problem

How transformers optimally encode factual associations in their weights, i.e., what storage capacity shallow transformers can achieve for factual recall, and how training dynamics unfold.

Approach

Model factual recall via associative memories built from outer products of random sphere embeddings; show that a one-layer transformer can store SR facts using either attention value matrices or the MLP (trade-off), with near-optimal capacity matched by information-theoretic lower bounds.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use attention-only storage with sufficient embedding dimension and attention capacityOne-layer transformer · Synthetic factual recallaccuracy: 100\%Helped
Use an MLP associative memory with sufficient width and parameter countOne-layer transformer · Synthetic factual recallaccuracy: 100\%Helped
Increase associative-memory parameters with random sphere embeddingsLinear associative memory · Discrete-vocabulary association storagestorage capacity: d^2 \gtrsim N\poly\log NHelped
Increase MLP associative-memory parameters with random sphere embeddingsMLP associative memory · Discrete-vocabulary association storagestorage capacity: md \gtrsim N\poly\log NHelped
Scale total model parameters with the number of factsOne-layer transformer · Synthetic factual recallnumber of facts storedHelped
Trade MLP parameters for self-attention parameters while retaining sufficient attention capacityOne-layer transformer · Synthetic factual recall, S = 32, R = 32, D = 8accuracyNo clear effect
Train the linear-attention model through the intermediate relation-only stageLinear attention model with orthogonal embeddings · Synthetic factual recall, S = 16, R = 4, D = 8loss: \log\abs{\gA} to \log D to zero lossMixed
Train softmax attention with random embeddingsSingle softmax attention head · Synthetic factual recalllossMixed

Surprising findings

Limitations

Experimental setup

Datasets: synthetic factual recall task (subject, relation, noise tokens, answers)

Benchmarks: synthetic factual recall task

Metrics: accuracy cross-entropy loss maximum number of facts stored at 99% accuracy

Baselines: one-hot embedding associative memory

Builds on: associative memories / Hopfield networks Allen-Zhu and Li factual knowledge capacity neural tangent kernel

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy