Skip to content

feat(eval): per-site faithfulness observability (rel/abs Frobenius)#934

Open
ocg-goodfire wants to merge 1 commit into
feature/jaxfrom
bridge/task-per-site-faith-observability
Open

feat(eval): per-site faithfulness observability (rel/abs Frobenius)#934
ocg-goodfire wants to merge 1 commit into
feature/jaxfrom
bridge/task-per-site-faith-observability

Conversation

@ocg-goodfire

Copy link
Copy Markdown
Collaborator

What

Adds per-site faithfulness observability to the LM in-loop eval. Bridge task per-site-faith-observability; follow-up to the investigation in lore 2026-07-03--unmasked-kl-vs-faith-no-eval-bug-4-culprit-sites.

The global FaithfulnessLoss (Σ_s‖Δ_s‖²/Σ_s numel) is an aggregate that hides catastrophically broken small-norm sites: on p-8e2380e2, 4 of 224 sites carried nearly all of the 6.6 unmasked KL while faith sat at ~1e-8. This surfaces the per-site breakdown.

How

  • New param_decomp/per_site_faith_eval.py:
    • make_per_site_faith_step(lm, co) → jitted (model, components) -> {site: ‖Δ_s‖²_F}, reusing model.weight_deltas — the same per-site deltas the global loss reduces, so Σ_s result / Σ_s numel == FaithfulnessLoss exactly (asserted in tests). model is the jit arg (HLO-baking rule); each Δ is reduced to a scalar so XLA frees it → peak mem ≈ one delta.
    • ‖W_s‖²_F (the constant relative denominator) is obtained from the same step on a zeroed vu (Δ = W − 0), cached once in the eval closure — no new protocol surface, fully generic.
    • per_site_faith_scalars(...) → the rank-indexed top-k scalar helper.
  • Wired into _make_lm_eval_fn (param_decomp_lab/experiments/lm/run.py). At eval cadence (always-on — cheap: one faith-loss-sized materialization per eval, already done every train step) it logs:
    • eval/faith/rel_frob_top{1..8} — the 8 largest ‖Δ_s‖_F/‖W_s‖_F, rank-indexed so line-plot keys stay stable as the ranking reshuffles (top1 == max)
    • eval/faith/abs_frob_max
    • eval/faith/rel_frob_bar_chart — all-site, site-labeled (rank-0, mirrors eval/l0/bar_chart)

Resolves the task's design question on wandb key volume (224 sites): rank-indexed scalars for stable trends + one bar chart for per-site identity, instead of 224 line keys.

Scope / caveat

Observability, not a culprit detector. Relative Frobenius is per-site weight-space error, which ≠ behavioral sensitivity — per the investigation, the worst rel-Frobenius sites (l0 o/v_proj) were behaviorally inert; only KL-under-delta-ablation ranked the real culprits. That probe (proposal (b)) and per-site-relative faith-loss normalization (proposal (c), an algorithm change needing a SPEC amendment) are deferred pending a decision — see the bridge task log.

Tests

param_decomp/tests/test_per_site_faith_eval.py: per-site == weight_deltas, Σ/Σnumel == FaithfulnessLoss, zeroed-vu == ‖W_s‖², top-k ranking + keys. Full make check clean; test_runtime_standalone + test_eval green (44 tests).

🤖 Generated with Claude Code

The global FaithfulnessLoss (Σ_s‖Δ_s‖²/Σ_s numel) hides catastrophically
broken small-norm sites (lore 2026-07-03--unmasked-kl-vs-faith-no-eval-bug-4-culprit-sites:
4 of 224 sites carried ~all of the 6.6 unmasked KL while faith sat at ~1e-8).

Add per_site_faith_eval.make_per_site_faith_step: a jitted (model, components) ->
{site: ‖Δ_s‖²_F} reusing model.weight_deltas — the SAME per-site deltas the global
FaithfulnessLoss reduces, so Σ_s/Σ_s numel == FaithfulnessLoss exactly. ‖W_s‖²_F (the
constant relative denominator) comes from the same step on a zeroed vu (Δ=W−0), cached
once in the LM eval_fn closure.

The LM in-loop eval logs, at eval cadence (always-on, cheap — one faith-loss-sized
materialization per eval, which already runs every train step):
- eval/faith/rel_frob_top{1..8} — 8 largest rel-Frobenius, RANK-indexed (stable line keys)
- eval/faith/abs_frob_max
- eval/faith/rel_frob_bar_chart — all-site, site-labeled (rank 0)

Observability only — relative Frobenius is per-site WEIGHT-space error, NOT behavioral
sensitivity (the culprit sites above were behaviorally inert on rel-Frobenius). The
KL-under-delta-ablation probe is the diagnostic that ranks behavioral sensitivity;
deferred pending a compute/design decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant