Commit Graph
4 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 d06badc75e fix: post-merge audit findings (recipe)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 21:57:38 -04:00
Joseph MaglyandClaude Opus 5.5 10e01101fe feat(concepts): pinned extraction layers and grouped CV (#331)
Allow packs and the CLI to pin per-model extraction layers, recorded as
pinned or selected, and add grouped layer CV. The pain pack pins the
paper's layers for Qwen2.5-7B-Instruct, Gemma-2-2B-it and Gemma-2-9B-it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:07:11 -04:00
Joseph MaglyandClaude Opus 5.5 691c75129d fix(concepts): calibrate the validation gate against the refusal baseline
A calibration spike on Qwen2.5-1.5B-Instruct (842 prompts per class)
confirmed the AUC and percentile thresholds, but found four gate defects:

- Arbitrary SVD/eigen signs failed valid directions. Directions are now
  oriented on training rows only, so the positive class projects higher.
  Reference and neighbour cosines keep the sign of the supplied vector.
- Supplied vectors were validated by refitting the recipe, so random
  vectors scored held-out AUC 0.99. A supplied vector is now scored as-is
  on held-out folds, and recipe-refit CV AUC is reported separately.
- A suffix-only lexical confound scored AUC 1.0 and only warned. A seeded,
  cross-validated text-only lexical baseline now flags lexical_confound
  when wording alone is about as separable as the activation direction.
- The default is now 1000 norm-matched null draws, up from 20.

Power floors: fail below 16 per class, warn below 32. The refusal default
(off) is unchanged. The docs and the ADR-004 amendment record the
calibration.

Closes #256

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 21:17:58 -04:00
Joseph MaglyandClaude Opus 5.5 13a20bc147 feat(concepts): add validation gate and report before intervention
Any contrast set yields a direction, and separability can come from
wording. The gate (obliteratus/concepts/gate.py) checks a concept direction
on cached activations before any weight edit:

- in-sample and held-out k-fold AUC, refitting the full recipe per fold;
- percentile against N seeded, norm-matched random directions;
- semantic-control AUCs, and neighbour-concept cosine and AUC;
- a confound scan (discriminating tokens, masked AUC) comparing
  final-token and mean-pool readouts;
- an optional reference-vector cosine.

It returns pass | warn | fail with reasons and writes validation.json,
including the effective thresholds and a fixed statement of what validation
does not establish (causal use, behavioural effect, anything about
experience). Thresholds come from the pack, falling back to the initial
defaults, and await calibration.

Modes: enforce (default for concept entry points) stops the run after
DISTILL and before EXCISE unless --override-gate "<reason>" is given, and
the reason is recorded. report never blocks. off records validation:
skipped. Legacy refusal runs, including concept="refusal", default to off;
report is opt-in, so existing runs are never blocked and pay no gate cost.
Non-gate validation errors are raised as PipelineFailure with cleanup.

New obliterate flags: --concept, --override-gate and --gate-mode. ADR-004
gains an amendment documenting the neighbour forward-pass budget and the
refusal default.

Closes #228

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 20:06:19 -04:00