Language Models Can Predict Their Own Behavior

Dhananjay Ashok, Jonathan May
2/18/2025
cs.CLcs.AIcs.LG

No official code found. Best implementation: DhananjayAshok/LMBehaviorEstimation (2 stars, CC0-1.0, last commit 2025-05-12).

Abstract

The text produced by language models (LMs) can exhibit specific `behaviors,' such as a failure to follow alignment training, that we hope to detect and react to during deployment. Identifying these behaviors can often only be done post facto, i.e., after the entire text of the output has been generated. We provide evidence that there are times when we can predict how an LM will behave early in computation, before even a single token is generated. We show that probes trained on the internal representation of input tokens alone can predict a wide range of eventual behaviors over the entire output sequence. Using methods from conformal prediction, we provide provable bounds on the estimation error of our probes, creating precise early warning systems for these behaviors. The conformal probes can identify instances that will trigger alignment failures (jailbreaking) and instruction-following failures, without requiring a single token to be generated. An early warning system built on the probes reduces jailbreaking by 91%. Our probes also show promise in pre-emptively estimating how confident the model will be in its response, a behavior that cannot be detected using the output text alone. Conformal probes can preemptively estimate the final prediction of an LM that uses Chain-of-Thought (CoT) prompting, hence accelerating inference. When applied to an LM that uses CoT to perform text classification, the probes drastically reduce inference costs (65% on average across 27 datasets), with negligible accuracy loss. Encouragingly, probes generalize to unseen datasets and perform better on larger models, suggesting applicability to the largest of models in real-world settings.

View on arXivView PDF

Code Implementations(1)

CC0-1.0

Home of the experiments conducted in the NeurIPS 2025 paper: Language Models Can Predict Their Own Behavior

20Shell, PythonFeb 18, 20251 years agoCC0-1.0

Similar Papers

Cite this paper

@article{ashok2025language,
  title  = {Language Models Can Predict Their Own Behavior},
  author = {Dhananjay Ashok and Jonathan May},
  year   = {2025},
  eprint = {2502.13329},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.13329v2}
}

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/2502.13329.svg)](https://codeofpaper.com/paper/2502.13329)

Discussion