# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.1] - 2026-03-15

### Added

- **Cross-probe analysis**: New `cross-probe` command compares layer importance across multiple probes (math, eq, json) — identifies universal vs probe-specific layers with correlation matrix
- **Multi-model comparison**: New `compare` command loads multiple report.json files and generates similarity matrix, shared reasoning analysis, and model rankings
- Cross-probe grouped bar chart visualization

## [0.2.0] - 2026-03-15

### Added

- **Tuned Lens** (Belrose 2023): Native implementation of per-layer affine probes that reduce early-layer systematic bias by 4-5 bits vs vanilla logit lens
  - New `calibrate` command to train lens from calibration texts (~minutes, single GPU)
  - `--tuned-lens` option on `logit-lens` and `map` commands
  - Save/load via safetensors format
- **Circuit Detection**: Three-phase pipeline to find synergistic and redundant layer pairs
  - Phase 1: Select top-K sensitive layers from single-layer ablation
  - Phase 2: Representation similarity filtering (optional, one forward pass)
  - Phase 3: Targeted pairwise ablation with interaction effect measurement
  - New `circuit` command with `--strategy fast|thorough|exhaustive`
- **Block Influence** (ShortGPT, ACL 2025): Lightweight layer importance metric (`BI = 1 - cos_sim(input, output)`) computed in a single forward pass — L times faster than full ablation
  - Automatically included in `map` output
  - Summary shows top-5 most transformative and most removable layers
- **Scoring diagnostics**: `ScoreResult` now includes `coverage`, `full_vocab_entropy`, `full_vocab_log_odds`, `top_token`, and `top_token_prob` fields
- **Entropy profile chart**: Visualizes how vocabulary entropy changes across layers (from logit lens data)
- **Layer similarity module**: Cosine similarity matrix and Block Influence computation utilities
- **Interaction heatmap**: Plotly visualization of synergistic (red) and redundant (blue) layer pairs

### Changed

- `score_from_logits()` now accepts an optional `tokenizer` parameter for full-vocab diagnostics
- `AggregateResult` includes `mean_coverage` for aggregate coverage tracking
- `NeuroReport` includes `block_influence` field
- `NeuroScanConfig` includes `tuned_lens_path` field
- `run_logit_lens()` accepts optional `tuned_lens` parameter
- `map` command now generates entropy profile chart alongside other visualizations
- Report JSON export includes `block_influence` data

## [0.1.0] - 2026-03-12

### Added

- Layer ablation analysis — zero out each layer, measure score impact
- Logit lens analysis — project hidden states to vocabulary at each layer
- Attention entropy analysis — quantify focus/diffusion of attention heads
- Automatic layer-function labeling (early_processing, syntax, reasoning, formatting, output)
- Prompt repetition experiment (`prompt-repeat` command)
- Three built-in probes: math, eq (emotional intelligence), json (format compliance)
- Custom probe support via JSON files
- Two inference backends: HuggingFace Transformers and ExLlamaV2
- Interactive Plotly HTML visualizations (ablation bar chart, logit lens heatmap, attention heatmap)
- JSON and CSV export for all results
- CLI with `map`, `ablate`, `logit-lens`, `attention`, `prompt-repeat`, `probes`, and `version` commands
- Comprehensive test suite (103 tests)
- CI/CD with GitHub Actions (lint, test, PyPI publish)
