MI Analysis Operational Reference

Automate MI analysis of prompts with region annotation, attention capture, and logit-lens projections.

42|4|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/taylorsatula/TeaLeaves --skill mi-analysis-operational-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: MI Analysis Operational Reference
Source: https://github.com/taylorsatula/TeaLeaves/tree/main
Command: npx skills add https://github.com/taylorsatula/TeaLeaves --skill mi-analysis-operational-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This operational guide documents how to run TeaLeaves' mechanistic interpretability (MI) pipeline end-to-end, covering region annotation, attention capture, logit-lens projections, and result rendering to support prompt engineering decisions.

Core Features & Use Cases

  • Region annotation: define named spans in prompts and map them to token positions to analyze focus and region interactions.
  • Attention capture & logit lens: hook attention across layers and project residual streams to understand token decisions.
  • Visualization & comparison: generate heatmaps, cooking curves, layer sweeps, and multi-sample reports to compare variants and seeds.

Quick Start

Run the MI analysis workflow on a test_cases.json using the GPU-enabled run_analysis.py to produce per-case results and visuals.

Frequently Asked Questions about MI Analysis Operational Reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform mechanistic interpretability analysis on LLM prompts?

Mechanistic interpretability analysis automates region annotation, attention capture, and logit-lens projections across models to understand token decisions and support prompt engineering.

How do I generate attention heatmaps and cooking curves for prompt variants?

Generate attention heatmaps and cooking curves by running an automated MI analysis pipeline that hooks attention across layers and renders multi-sample comparison reports.

Can I use logit-lens projections to analyze residual stream token focus?

Yes, logit-lens projections hook attention across layers and project residual streams to understand token decisions and map named prompt spans to token positions.

Does prompt interpretability analysis require GPU-side execution?

Yes, the prompt interpretability pipeline supports GPU-side analysis stages to execute attention capture, auto-discover model architecture, and render visual outputs.

What is the best way to ensure reproducibility in prompt region annotation and analysis?

Ensure reproducibility in prompt region annotation by enforcing strict data conventions, CLI workflows, and robust region mapping for variant analysis across different seeds.

Why does my attention capture analysis fail to map prompt regions to token positions?

Attention capture fails to map prompt regions when strict data conventions and CLI workflows for robust region mapping are not followed during the prep stage.