IC-481Llama-3.1-8B and four other released LLMs reorganize their internal representations to reflect in-context graph structure in a sudden two-phase transition as context length increases
Core Francisco Park, Andrew Lee, Ekdeep Singh Lubana, Yongyi Yang, Maya Okawa, Kento Nishi, Martin Wattenberg, Hidenori Tanaka
The paper inputs traces of random walks on predefined graphs (square grid, ring, hexagonal lattice) into five released LLMs and measures the Dirichlet energy of the models' mean token representations with respect to the ground-truth graph. As context length scales from roughly 10 to 1000 tokens, the energy decreases and rule-following accuracy increases in a two-phase pattern: a slow initial rise followed by a sudden steep ascent. The transition point scales as a power-law with graph size. Simple memorization baselines (1-shot and 2-shot) cannot account for the observed accuracy curves. The same energy-decrease-then-accuracy-rise pattern is observed across Llama-3.1-8B, Llama-3.2-1B, Llama-3.1-8B-Instruct, Gemma-2-2B, and Gemma-2-9B on all three graph topologies.
Evidence
correlational
Key metric
Cosine similarity between model PCs and spectral embeddings (Table 2): grid 0.950/0.954, ring 0.942/0.930, hex 0.745/0.755. Memorization baselines (1-shot, 2-shot) fail to explain the accuracy curve on both ring (50 nodes) and grid (25 nodes) graphs.
Caveat
The authors note that PCA visualizations can be misleading, and that graph sizes are relatively small, likely causing significant finite-size effects. The percolation analogy is described as 'still loose' and would require graphs with at least 2 orders-of-magnitude difference in size to corroborate.