Skip to content

feat: M70 — Output Entropy Analysis - #150

Merged
hlin99 merged 1 commit into
mainfrom
feat/m70-entropy-analysis
Apr 5, 2026
Merged

hlin99 merged 1 commit into
mainfrom
feat/m70-entropy-analysis

Conversation

@hlin99

@hlin99 hlin99 commented Apr 5, 2026

Copy link
Copy Markdown
Member

Summary

Per-token Shannon entropy analysis from top-K logprob distributions for richer divergence characterization.

Changes

  • New entropy.py module: token_entropy(), sequence_entropy(), entropy_stats(), entropy_at_divergence()
  • EntropyStats and EntropyComparison dataclasses with serialization
  • CLI subcommand: xpyd-acc entropy --baseline-logprobs <path> [--target-logprobs <path>]
  • Flags: --divergence-index, --context-window, --json
  • ROADMAP.md updated with M70
  • 22 tests

Closes #149

- entropy.py module: per-token Shannon entropy from top-K logprob distributions
- token_entropy(), sequence_entropy(), entropy_stats(), entropy_at_divergence()
- EntropyStats and EntropyComparison dataclasses with to_dict() serialization
- CLI: xpyd-acc entropy --baseline-logprobs <path> [--target-logprobs <path>]
- --divergence-index, --context-window, --json export
- Rich terminal formatting for stats and comparison
- 22 tests covering computation, edge cases, formatting, file I/O, CLI

Closes #149
@hlin99
hlin99 merged commit f6ff8d4 into main Apr 5, 2026
4 checks passed
@hlin99
hlin99 deleted the feat/m70-entropy-analysis branch April 5, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: M70 — Output Entropy Analysis

1 participant