atlas

Research map / Architectures and efficiency / Attention and transformers

Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 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.

The paper shows LLM fact retrieval can be hijacked by prepending semantically neutral-but-related context, and models this as associative memory via a latent concept association task solved by a one-layer transformer whose value matrix acts as associative memory.

Problem

Fact retrieval in LLMs is not robust: adding factual but misleading context (e.g., "not in Chicago") can flip outputs, so the mechanism of memory recall in transformers needs explanation.

Approach

Frames LLM fact recall as associative memory where context tokens act as latent-concept clues; proposes a latent concept association task (Hamming-distance-based latent semantic similarity) and proves a one-layer transformer can solve it by using self-attention to aggregate context and the value matrix as associative memory.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
prepend “Do not think of {target_false}” more timesGPT-2, Gemma, and LLaMA-2-7B · CounterFactEfficacy ScoreHelped
prepend factually correct sentences associated with the relation and false targetGPT-2, Gemma, and LLaMA-2-7B · CounterFact, relation-ID hijackingEfficacy ScoreHelped
prepend sentences containing the true target instead of the false targetGPT-2, Gemma, and LLaMA-2-7B · CounterFact, reverse context hijackingEfficacy ScoreHurt
train the value matrix instead of fixing it to the identity (ablation)single-layer transformer · Latent concept association, context length 64 and 128accuracyHelped
replace the trained value matrix with the constructed associative-memory value matrix (ablation)single-layer transformer · Latent concept associationaccuracyNo clear effect
train embeddings instead of freezing them (ablation)single-layer transformer with embedding dimension smaller than vocabulary size · Latent concept association, underparameterized regimeaccuracyHelped
train embeddings instead of freezing them (ablation)single-layer transformer with embedding dimension larger than vocabulary size · Latent concept association, overparameterized regimeaccuracyNo clear effect
use self-attention to select tokens within the same clustersingle-layer transformer · Latent concept association with cluster-structured contextsattention to same-cluster tokensHelped

Surprising findings

Limitations

Experimental setup

Datasets: CounterFact synthetic latent concept association data

Benchmarks: CounterFact latent concept association synthetic task

Metrics: efficacy score accuracy error rate smallest principal angle

Baselines: randomly constructed value matrix identity value matrix (frozen W_V) Gaussian-initialized value matrix

Builds on: Hopfield networks CounterFact transformer attention as associative memory

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