Eliciting Latent Predictions from Transformers with the Tuned Lens

@misc{belrose2023elicitinglatentpredictionstransformers, title={Eliciting Latent Predictions from Transformers with the Tuned Lens}, author={Nora Belrose and Zach Furman and Logan Smith and Danny Halawi and Igor Ostrovsky and Lev McKinney and Stella Biderman and Jacob Steinhardt}, year={2023}, eprint={2303.08112}, archivePrefix={arXiv}, primaryClass={cs.LG}, url={https://arxiv.org/abs/2303.08112}, }

March 14, 2023

Nora Belrose

Zach Furman

Logan Smith

Danny Halawi

Igor Ostrovsky

Lev McKinney

Stella Biderman

Jacob Steinhardt

Abstract

We analyze transformers from the perspective of iterative inference, seeking to understand how model predictions are refined layer by layer. To do so, we train an affine probe for each block in a frozen pretrained model, making it possible to decode every hidden state into a distribution over the vocabulary. Our method, the tuned lens, is a refinement of the earlier “logit lens” technique, which yielded useful insights but is often brittle. We test our method on various autoregressive language models with up to 20B parameters, showing it to be more predictive, reliable and unbiased than the logit lens. With causal experiments, we show the tuned lens uses similar features to the model itself. We also find the trajectory of latent predictions can be used to detect malicious inputs with high accuracy. All code needed to reproduce our results can be found on GitHub.

Research

Our research explores a portfolio of high-potential agendas.

Events

Our events bring together global leaders in AI.

Programs

Our programs build the field of trustworthy and secure AI