You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Proposal] Linear Artificial Tomography (LAT) scans #1957
Add a utility for running LAT scans on HookedTransformer models. A scan finds a concept direction at each layer and projects activations onto it, producing a layer-by-token readout of where the concept is represented. TransformerLens has the hooks for this, but no standard implementation.
Motivation
LAT is a common tool in representation engineering, and each project currently reimplements it. I used it to study emotion-associated directions in Qwen3-0.6B, where alignment rose in later layers. Interpreting that result required controls for norm growth and anisotropy that a shared implementation could provide by default. I already have the code written, would have to just be ported to the repository.
Proposed functionality
Direction extraction: Build per-layer concept vectors from contrastive or stimulus-based prompt sets, with PCA or difference-of-means options.
Scanning: Run run_with_cache over input text and project resid_pre / resid_post onto the vectors, returning a layer × token score tensor.
Baselines: Built-in random-direction and norm-matched controls, plus optional centering or whitening from neutral-prompt statistics.
Visualization: Layer-wise alignment curves and token-level heatmaps.
Interventions: Optional steering or ablation along extracted vectors for causal checks.
changed the title [-]Feature request: Linear Artificial Tomography (LAT) scans[/-][+][Proposal] Linear Artificial Tomography (LAT) scans[/+]on Oct 30, 2026
Hi @Allan0820! I appreciate you putting this proposal together. A couple items on how this fits with our roadmap going forward. First and foremost, HookedTransformer has been deprecated (v3) and removed (v4), so any existing implementation would need to be rewritten to work with our new TransformerBridge system. Additionally, we have plans in the future for a generic set of these functionalities that are not tied specifically to a lat_scan method. We do not typically include visualization tools in the core of TransformerLens, so once those methods are in place, we'd ideally build this as a demo notebook, rather than as an explicit method or module within the repository.
I'll mark this as parked for now, and come back to it once we've finished overhauling our analysis tools functionalities. Thank you again for your interest in TransformerLens!
Just to clarify, I had initially implemented the LAT Scans directly in PyTorch. I adapted the implementation to use HookedTransformer primarily to make it fit more naturally into the existing TransformerLens ecosystem, rather than because the implementation inherently depended on it. So adapting it to TransformerBridge or a more generic analysis interface shouldn't be an issue.
Thanks again for taking the time to review this! Also happy to help in the overhaul efforts, please do let me know, would be more than happy to contribute!
I would use this for probing guard models on residual stream activations, so a vote of interest from me. Happy to help test a demo notebook once the generic direction tooling lands.
Activity
[-]Feature request: Linear Artificial Tomography (LAT) scans[/-][+][Proposal] Linear Artificial Tomography (LAT) scans[/+]Allan0820 commentedon Oct 30, 2026
@jlarson4 @neelnanda-io: interested in your thoughts on this!
jlarson4 commentedon Oct 30, 2026
Hi @Allan0820! I appreciate you putting this proposal together. A couple items on how this fits with our roadmap going forward. First and foremost,
HookedTransformerhas been deprecated (v3) and removed (v4), so any existing implementation would need to be rewritten to work with our newTransformerBridgesystem. Additionally, we have plans in the future for a generic set of these functionalities that are not tied specifically to alat_scanmethod. We do not typically include visualization tools in the core of TransformerLens, so once those methods are in place, we'd ideally build this as a demo notebook, rather than as an explicit method or module within the repository.I'll mark this as parked for now, and come back to it once we've finished overhauling our analysis tools functionalities. Thank you again for your interest in TransformerLens!
Allan0820 commentedon Oct 30, 2026
Hey @jlarson4, thanks for the detailed feedback!
Just to clarify, I had initially implemented the LAT Scans directly in PyTorch. I adapted the implementation to use
HookedTransformerprimarily to make it fit more naturally into the existing TransformerLens ecosystem, rather than because the implementation inherently depended on it. So adapting it to TransformerBridge or a more generic analysis interface shouldn't be an issue.I also already have a notebook that I originally put together for @neelnanda-io's MATS submission: [LAT Scans Notebook](https://colab.research.google.com/drive/1jakU_dGTI2CYRbsWOaxf18pmktrGezfZ?usp=sharing). It provides a look at the underlying PyTorch implementation. The current focus is more on the mechanics of LAT than its applications, but it can certainly be adapted into a demonstration notebook as you suggested.
Thanks again for taking the time to review this! Also happy to help in the overhaul efforts, please do let me know, would be more than happy to contribute!
hunar2006 commentedon Dec 1, 2026
I would use this for probing guard models on residual stream activations, so a vote of interest from me. Happy to help test a demo notebook once the generic direction tooling lands.