Hook
Author: Mehdi Sadriu, independent educator. Last reviewed: 25 November 2026. How we check claims: methodology.
A callback attached to a module so you can read or modify its activation during the forward pass. TransformerLens is built around hooks.
In one paragraph. A callback attached to a module so you can read or modify its activation during the forward pass. TransformerLens is built around hooks.