Saved in:
Bibliographic Details
Main Authors: Belrose, Nora, Ostrovsky, Igor, McKinney, Lev, Furman, Zach, Smith, Logan, Halawi, Danny, Biderman, Stella, Steinhardt, Jacob
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2303.08112
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912699783315456
author Belrose, Nora
Ostrovsky, Igor
McKinney, Lev
Furman, Zach
Smith, Logan
Halawi, Danny
Biderman, Stella
Steinhardt, Jacob
author_facet Belrose, Nora
Ostrovsky, Igor
McKinney, Lev
Furman, Zach
Smith, Logan
Halawi, Danny
Biderman, Stella
Steinhardt, Jacob
contents 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 at https://github.com/AlignmentResearch/tuned-lens.
format Preprint
id arxiv_https___arxiv_org_abs_2303_08112
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Eliciting Latent Predictions from Transformers with the Tuned Lens
Belrose, Nora
Ostrovsky, Igor
McKinney, Lev
Furman, Zach
Smith, Logan
Halawi, Danny
Biderman, Stella
Steinhardt, Jacob
Machine Learning
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 at https://github.com/AlignmentResearch/tuned-lens.
title Eliciting Latent Predictions from Transformers with the Tuned Lens
topic Machine Learning
url https://arxiv.org/abs/2303.08112