What problem does it solve? Understanding how large language models like Llama-3.1-8B and Qwen-2.5-7B arrive at their predictions requires inspecting internal hidden states at every transformer layer, which is difficult to do without specialized tooling. ## Core Features & Use Cases - Layer-wise Prediction Analysis: Apply the Logit Lens technique to project hidden states from each transformer layer into vocabulary space and inspect per-layer token predictions and confidence scores. - Component Decomposition: Compare attention mechanism outputs against MLP contributions at each layer to understand which components drive predictions. - Visualization Generation: Produce heatmaps, confidence progression plots, component comparison charts, and summary dashboards from analysis results. - Use Case: A mechanistic interpretability researcher wants to know at which layer Llama-3.1-8B commits to predicting "mat" after "The cat sat on the". Run the analysis script to get per-layer top-k predictions, then generate heatmaps showing how confidence evolves across all 32 layers. ## Quick Start Run the basic analysis script on a prompt like "The cat sat on the" with Llama-3.1-8B and then generate layer-wise prediction heatmaps from the saved JSON results.