atlas

Research map / Architectures and efficiency / Attention and transformers

Measuring In-Context Computation Complexity via Hidden State Prediction

ICML 2025 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and circuits

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.

Proposes the PHi layer, an information bottleneck with a learned autoregressive prior that measures the KL-based description length of a model's hidden states as a metric of in-context computation complexity.

Problem

Next-token prediction loss does not reliably indicate whether a sequence model performs interesting or complex in-context computation, since low loss can come from trivial sequences and high loss from irrelevant randomness.

Approach

Insert a PHi layer (VAE-style information bottleneck with a learned autoregressive prior over latents) into the residual pathway of a sequence model and use the per-token KL divergence between posterior and prior, i.e. novel information in hidden states not predictable from the past, as the interestingness metric; train jointly with NLL loss or post-hoc on a frozen pretrained LLM.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Measure hidden-state predictability with PHi loss rather than relying on next-token lossTransformer in PFA language learning · PFA language learningpartial correlation with PFA complexity: r=0.37, with a 95% confidence interval of [0.32, 0.43]Helped
Measure hidden-state predictability with PHi lossLlama 3.2 3B on MATH solutions · MATHpartial correlation with problem difficulty: r=0.079, with a 95% confidence interval of [0.07, 0.09]Helped
Select the rationale with higher PHi loss instead of choosing at randomLlama 3.2 3B generated GSM8K rationales · GSM8Kcorrect-answer selection rateHelped
Select the rationale with lower next-token lossLlama 3.2 3B generated GSM8K rationales · GSM8Kcorrect-answer selection rate: 71%Helped
Insert the PHi layer in early rather than later Llama layers (ablation)Llama 3.2 3B · Trivial, license, random, literature, and code sequencesnext-token prediction lossHurt
Place the PHi layer after layers 18–24 rather than in early layers (ablation)Llama 3.2 3B · Trivial, license, random, literature, and code sequencesnext-token prediction lossHelped
Compare PHi loss across task typesTransformer and LSTM trained from scratch · Memorized subsequences, memorized programs, PFA language learning, and random examplesPHi lossMixed
Compare PHi loss across task typesLlama 3.2 3B · Trivial, memorized licenses, random words, literature, and codePHi lossHelped
Add repeated unseen subsequences that must be copied from context (ablation)Fully trained Transformer · Copying taskPHi lossHurt

Surprising findings

Limitations

Experimental setup

Datasets: SlimPajama MATH GSM8K synthetic probabilistic finite automata data

Benchmarks: MATH GSM8K

Metrics: PHi loss next token loss partial correlation pairwise selection accuracy

Baselines: next token prediction loss

Builds on: variational autoencoder reparameterization trick in-context language learning prequential coding

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