Measuring In-Context Computation Complexity via Hidden State Prediction

Vincent Herrmann, Róbert Csordás, Jürgen Schmidhuber
3/17/2025
cs.LG

No official code found. Best implementation: vincentherrmann/predicting-hidden-states (9 stars, last commit 2025-06-11).

Abstract

Detecting when a neural sequence model does "interesting" computation is an open problem. The next token prediction loss is a poor indicator: Low loss can stem from trivially predictable sequences that are uninteresting, while high loss may reflect unpredictable but also irrelevant information that can be ignored by the model. We propose a better metric: measuring the model's ability to predict its own future hidden states. We show empirically that this metric -- in contrast to the next token prediction loss -- correlates with the intuitive interestingness of the task. To measure predictability, we introduce the architecture-agnostic "prediction of hidden states" (PHi) layer that serves as an information bottleneck on the main pathway of the network (e.g., the residual stream in Transformers). We propose a novel learned predictive prior that enables us to measure the novel information gained in each computation step, which serves as our metric. We show empirically that our metric predicts the description length of formal languages learned in-context, the complexity of mathematical reasoning problems, and the correctness of self-generated reasoning chains.

View on arXivView PDF

Code Implementations(1)

Official code for the ICML paper "Measuring In-Context Computation Complexity via Hidden State Prediction"

92PythonJun 6, 20251 years ago

Similar Papers

Cite this paper

@article{herrmann2025measuring,
  title  = {Measuring In-Context Computation Complexity via Hidden State Prediction},
  author = {Vincent Herrmann and Róbert Csordás and Jürgen Schmidhuber},
  year   = {2025},
  eprint = {2503.13431},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.13431v1},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.13431.svg)](https://codeofpaper.com/paper/2503.13431)

Discussion