flâneur — a map of the web's best reading

Tuned Lens

tuned-lens.readthedocs.io · 473 words · saved by 1 readers

This package provides a simple interface for training and evaluating tuned lenses. A tuned lens allows us to peek at the iterative computations a transformer uses to compute the next token. A lens into a transformer with n layers allows you to replace the last m layers of the model with an affine transformation (we call these affine translators). Each affine translator is trained to minimize the KL divergence between its prediction and the final output distribution of the original model. This means that after training, the tuned lens allows you to skip over these last few layers and see the best prediction that can be made from the model’s intermediate representations, i.e., the residual stream, at layer n - m. The reason we need to train an affine translator is that the representations may be rotated, shifted, or stretched from layer to layer. This training differentiates this method from simpler approaches that unembed the residual stream of the network directly using the unembedding

Tuned Lens 🔎 ¶ Tools for understanding how transformer predictions are built layer-by-layer. This package provides a simple interface for training and evaluating tuned lenses . A tuned lens allows us to peek at the iterative computations a transformer uses to compute the next token. What is a Lens? ¶ A lens into a transformer with n layers allows you to replace the last m layers of the model with an affine transformation (we call these affine translators). Each affine translator is trained to minimize the KL divergence between its prediction and the final output distribution of the original m

Explore this link on the map →

related reading