Research map / Architectures and efficiency / Attention and transformers
Dynamics of Spontaneous Topic Changes in Next Token Prediction with Self-Attention
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.
Theoretically characterizes spontaneous topic changes in a single-layer self-attention model via token-priority graphs, showing changes need lower-priority tokens to outnumber higher-priority ones and that longer context or ambiguity does not increase them, then checks this empirically with RAG on four frontier LLMs.
Problem
Self-attention models predict next tokens from structured input patterns and seem to lack the spontaneous topic shifts characteristic of human thought; it is unclear when and how such topic changes occur in self-attention and whether they resemble human cognition.
Approach
Defines a topic as a set of token-priority graphs (TPGs) and uses the Graph-SVM convergence result of a single-layer self-attention model trained on mixed-topic data to derive necessary conditions for topic change, showing that longer inputs and higher topic ambiguity do not increase change probability, unlike human cognition.
Key results
- In the toy model, the change-of-topic proportion drops from 1.40% at T=16 to 0.00% at T=512 (Table of varying T).
- In the toy model, change-of-topic proportion decreases from 1.52% at L=4 to 0.72% at L=18 while ambiguity rises from 0.26% to 1.26%.
- On frontier LLMs with RAG, cosine similarity between single-topic and mixed-topic continuations tends to increase with input length (10 to 150 words) across GPT-4o, Llama-3.3, Claude-3.7 and DeepSeek-V3.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Increase test input length from T_test=4 to T_test=512 | Mixed-topic single-layer self-attention · Synthetic TPG test sequences | Change (%): 0.00 ± 0.00 -> 0.00 ± 0.00 | Hurt |
| Increase topic-overlap edge count L from 4 to 18 | Mixed-topic single-layer self-attention · Synthetic TPG test sequences | Change (%): 1.52 ± 1.31 -> 0.72 ± 0.86 | No clear effect |
| Increase input prompt length | GPT-4o, Llama-3.3, Claude-3.7, and DeepSeek-V3 · ArXiv paper abstracts; RAG with single-paper versus paired-paper context | Cosine similarity | Helped |
| Increase topic ambiguity | GPT-4o, Llama-3.3, Claude-3.7, and DeepSeek-V3 · ArXiv paper abstracts; five ambiguity bins | Cosine similarity | No clear effect |
Surprising findings
- Greater topic ambiguity does not increase spontaneous topic changes, contrary to human cognition where inter-connectivity promotes spontaneous thought.
- Longer prompts reduce rather than increase topic change in both the toy model and LLMs, opposite to human cognition.
Limitations
- Theory relies on a simplified single-layer self-attention model with log-loss and fixed classification head, which omits deep architectures and training heuristics.
- LLM experiments use a proxy (cosine similarity of RAG-based continuations) rather than the formal topic-continuity definition, and use a small set of 100 papers.
- Topic definition via TPGs and reconstruction assumption is idealized and not validated for real language.
Experimental setup
Datasets: 100 arXiv papers from March 2025 synthetic TPG-generated sequences
Benchmarks: synthetic TPG simulations 100 arXiv papers (March 2025)
Metrics: proportion keep topic / ambiguous / change of topic cosine similarity between single-topic and mixed-topic conti attention priority similarity
Baselines: GPT-4o Llama-3.3 Claude-3.7 DeepSeek-V3
Builds on: token-priority graph Graph-SVM implicit bias of self-attention attribution graphs retrieval-augmented generation
Closest papers by meaning
- The emergence of sparse attention: impact of data distribution and benefits of repetition (NeurIPS 2025 · similarity 0.86)
- Artificial Hivemind: The Open-Ended Homogeneity of Language Models (and Beyond) (NeurIPS 2025 · similarity 0.85)
- A Phase Transition between Positional and Semantic Learning in a Solvable Model of Dot-Product Attention (NeurIPS 2024 · similarity 0.85)
- Don't Take Things Out of Context: Attention Intervention for Enhancing Chain-of-Thought Reasoning in Large Language Models (ICLR 2025 · similarity 0.85)
- A Theoretical Study of (Hyper) Self-Attention through the Lens of Interactions: Representation, Training, Generalization (ICML 2025 · similarity 0.85)
- Graph of Thoughts: Solving Elaborate Problems with Large Language Models (AAAI 2024 · similarity 0.84)
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.
