Commit Graph
5 Commits
Author SHA1 Message Date
Joseph Magly 7dffffa00c Merge remote-tracking branch 'upstream/main' into feat/331-pinned-extraction-layer
# Conflicts:
#	obliteratus/concepts/direction.py
#	tests/test_concept_intervention.py
2026-10-17 17:51:22 -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 d1504faf88 feat(concepts): rank-k subspace and affine (LEACE / mean-centred) erasure (#335)
Remove whole per-layer subspaces in project, orthogonalize and lora
modes; add mean-centred orthogonal and LEACE erasure at inference time
and, where a native bias exists, as a permanent edit with recorded
reference provenance. k=1 zero-origin paths are unchanged. Adds the
Pain Axis Appendix D script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:07:11 -04:00
Joseph MaglyandClaude Opus 5.5 5f558a78db feat(concepts): apply #223 maintainer rulings on publication, leace and steering
Maintainer decisions for epic #223 (2026-10-15):

- Q1: `leace` is a deprecated alias of the Fisher LDA direction. It keeps
  its numerical behaviour, warns once per public resolution with a
  DeprecationWarning naming `fisher_lda` and `leace_exact`, and will be
  removed in a future minor release.
- Q4: a collateral FAIL blocks both the model card and any Hub push of
  modified weights or adapters on every path (pipeline, export_run, both
  CLIs, Concept Lab, the Hub UI and tourney uploads), checked before any
  network call. `--allow-collateral-fail REASON` (and the matching API
  argument and UI field) overrides the block and stamps the FAIL and
  reason into the card, checkpoint metadata and provenance. Local save
  and export are never blocked.
- Q5: research-tier packs no longer carry publication or local-export
  restrictions; the tier is provenance only and Q4 applies to every pack.
- Steering defaults are removal-first: `steer` defaults to alpha -1 and
  the default dose ladder is non-positive. Positive doses stay available
  explicitly; `project` keeps its positive removal strength.
- Q3 (gate modes) and Q7 (dense only, follow-up #310) are unchanged and
  documented.

Refs #223

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 15:37:51 -04:00
Joseph MaglyandClaude Opus 5.5 3b0bf33b3d feat(concepts): add generalized extraction recipe and saved directions
Non-refusal concepts now extract directions through a declarative recipe,
implemented as pure tensor functions in obliteratus/concepts/extraction.py
and wired into the pipeline:

- pooled control sets with no pairing or truncation (mean of means);
- control principal-component denoising by variance fraction;
- final-token readout with an optional suffix, or masked mean pooling,
  correct under left and right padding;
- seeded k-fold layer selection on projection AUC (rank-based), using cached
  activations with no extra forward passes;
- an intervention-layer rule (same, norm_ratio, explicit), separate from
  the extraction layer.

ConceptDirection save/load carries the recipe, layer choice, CV scores and
seed in safetensors plus JSON, with no pickle. Explicit n_directions or
direction_method values that conflict with the recipe are rejected. Preset
defaults superseded by the recipe are logged, and invalid recipes fail
before probing.

The refusal path is unchanged: the golden test passes for every CPU preset.
Refusal metadata keeps its historical pooling value, because refusal does
not pool.

Closes #227

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