Re:From vibes to data: measuring how LLMs attend to your pro...
by hkonte on Tuesday March 10, 2026 @05:29PM
(#47329021)
Defining prompt regions and measuring attention per region is the right level of abstraction. The interesting question is whether named semantic blocks (role, constraints, output format, examples) actually get attended to differently, or whether position in the token stream is what dominates.
If blocks do carry distinct attention signatures, that would be strong evidence for structuring prompts that way rather than writing them as flat text. I built flompt (github.com/Nyrok/flompt) around the block decomposition idea, and empirical attention maps like yours are exactly the kind of signal that would validate or kill the thesis.
You define regions of your prompt (instructions, examples, constraints, whatever), run the pipeline on any HuggingFace model, and get back per-layer attention heatmaps, cooking curves showing how attention to each region evolves through the network, and logit lens snapshots. Supports Llama, Qwen, Mistral, Gemma out of the box. Self-contained engine script you can scp to a GPU box and run with no dependencies beyond transformers. The repo is designed so that Claude can handle the whole pipeline end-to-end including interpreting results in a grounded domain-specific way.
I built it to tune system prompts for another project and realized the general approach was useful enough to extract. The "before and after" comparison tooling ended up being the part I use most.