The behavioural battery treated any greedy-text difference as an effect,
so a punctuation-only edit looked like a change and nothing measured
task success.
Add a local, versioned scorer registry with deterministic exact-answer
and structured-output (JSON + declared schema) scorers. Each completion
yields separate endpoints: task success, invalid output and abstention;
raw text change is reported as descriptive only. Paired summaries use a
one-sided exact McNemar test and Wilson bounds against a declared
per-task margin; min_pairs defaults to the smallest sample that could
pass that margin, and untested or underpowered endpoints never aggregate
to PASS. Every aggregate keeps its per-example records.
EvaluationBattery(scorers=...) writes behavioural["scorecard"]; without
scorers nothing changes. Pipeline admission refuses batteries that carry
scorers until their generation is modelled. Dataset-built examples read
select/calibrate rows; locked test still needs explicit acknowledgement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per-layer protected spans make the embedding projector ambiguous; embedding_geometry_layer
picks one layer's geometry and is recorded for export and replay. D4 uses the first layer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve ExtractionRecipe conflict with #329: keep collateral_margin and
steering_scale and validate both in __post_init__.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add preserve= to concept interventions so the removed span is first
orthogonalised against protected directions (e.g. refusal), with
overlap metadata and export replay; a protected_direction repair step
gated on the collateral battery; CLI/recipe support including
--preserve refusal; and a D4 arm in the Appendix D script. Paths
without preserve are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Lift the dense-only restriction for supported OLMoE, Qwen2-MoE and
Qwen3-MoE layouts: routing-aware extraction readout, per-expert
down-projection edits through the fused/ModuleList MoE paths, optional
router orthogonalization, expert gate checks, and routing-drift and
expert-load reports. Unsupported MoE layouts still fail closed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
Replace significance-only FAIL with a configurable non-inferiority
decision (default 3 points): PASS, FAIL, INCONCLUSIVE, UNDERPOWERED.
Plumb the margin through recipes, CLI, reports, cards, metadata and the
Q4 export gate, and add 'concepts rescore' for saved batteries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add scale=residual_norm|raw|vector to concept steering across the API,
CLI, recipes and run metadata, recording effective vector norms. The
default residual-norm path is unchanged. The Pain Axis resteer stage now
uses the concept API with identical arithmetic.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remote obliterate commands accept the folding opt-out, folded repair
candidates are validated after storage-dtype conversion, the refusal golden
fixtures record the new provenance key (numeric values unchanged), and the
risk map registers the shared post-norm module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AbliterationPipeline now folds Gemma 2/3 and OLMo 2 post-attention and
post-feedforward RMSNorm scales into residual-writer projections across
excise, Bayesian, SAE, LoRA-ablation and repair paths, sharing the
recognition rules with the concept API. fold_post_norms=False
(--no-fold-post-norms) reproduces the previous numerics and is recorded in
run metadata. Combinations that cannot be folded fail explicitly.
Fixes#320
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Concept orthogonalize/lora now remove the direction from what Gemma 2/3 and
OLMo 2 sandwich-norm layers write to the residual by folding the post-norm
scale into the projection, and fail closed on unrecognized post-norm layouts.
project_embeddings adds the input embedding edit, with an explicit
tied_embeddings choice (edit_both or untie) for tied models.
Fixes#318
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A new Concept Lab tab (obliteratus/ui_concept_lab.py) drives the merged
concept APIs in six steps:
1. select a concept or pack;
2. extract with the pack recipe;
3. validate through the gate (an override needs a non-empty, recorded
reason);
4. intervene (orthogonalize, project, steer, lora), with pristine and
modified previews;
5. evaluate with the collateral battery, and run the repair ladder for
every intervention mode;
6. export through the #231 guards.
Under those guards, research-tier packs never push modified weights, a
collateral FAIL blocks only the publish card, and incomplete repairs need
an explicit acknowledgement. The UI never fetches pack data implicitly.
Selecting a concept pack disables or rejects the custom-prompt and dataset
controls, with a clear message.
The Obliterate tab still defaults to refusal and is unchanged. Legacy
refusal runs also expose their extraction as a ConceptDirection artifact,
best effort: a layout the artifact cannot represent is logged and never
aborts the run. Operator-UI coverage follows the existing conditional
policy pattern.
Closes#234
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/CONCEPT_WORKFLOW.md walks a concept from definition to export
(define, extract, validate, intervene, evaluate, repair, compare/export),
with offline CLI examples. Its interpretation guide covers what
validation, ablation and steering do and do not show: behavioural nulls
as first-class results, hidden KV-cache channels, steering fragility, and
why "direction removed" is not "experience removed". A responsible-use
section covers user-defined concepts.
Every literature claim is cited by arXiv id or DOI. The existing concept
docs link to the guide, and the README gains a short "Concept vectors
beyond refusal" section. A test runs the outcome-language lint over the
concept docs, resolves local links and anchors, checks that every
documented `obliteratus` command parses, and checks the required
citations.
Closes#235
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any intervention export for a research-tier concept, such as the pain pack,
now requires the run's evaluation record to show that the collateral
battery ran with a refusal-rate result. A skipped or missing battery blocks
the export, with an error naming the missing channel; research tier has no
override. Direction- and validation-only exports stay allowed. User-tier
runs that skip the battery still export, with the skip reason recorded.
This implements the #232 acceptance criterion that the collateral battery,
including refusal rate, is required for any pain intervention export.
Refs #231#232
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Concept runs can now be compared and exported as directions, reports,
reversible adapters or full checkpoints. Each export carries
schema-validated provenance (concept-provenance.v1) with sorted content
digests, pack identity, gate verdict, evaluation outcome and repair status.
Exported cards use outcome language ("direction removed / behaviour
changed"), and a lint rejects claims about removing pain, suffering or
experience. Pack data is excluded from exports through a strict file
allowlist (model files, shard index cross-check, symlink rejection).
Publication guards follow the interim maintainer decisions on #223:
- Q4: a collateral FAIL blocks only --publish-card. Other exports proceed
with the FAIL recorded. Publishing anyway needs an explicit, recorded
reason, from the CLI or the UI acknowledgement panel.
- Q5: research-tier packs never push modified weights or adapters to the
Hub, from the pipeline, the CLI or the UI. Malformed concept metadata
fails closed.
Incomplete repairs need an explicit acknowledgement before export or a UI
Hub push. Refusal metadata changes are additive only.
Closes#231
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an intervention costs coherence, a repair ladder runs steps in order
of invasiveness:
1. norm preservation;
2. retained-fraction regularization;
3. KL-budget rollback;
4. RDO refinement;
5. a reversible LoRA repair adapter.
A step is accepted only if coherence is within budget, the target
projection stays removed, and collateral metrics are no worse than before
the step. A step that re-introduces the direction is rejected, and its
weights are rolled back bit-exactly, including on exceptions. Every attempt
and its reasons are recorded. Non-finite measurements become rejection
reasons rather than errors. repair: incomplete is reported, and the report
saved, when no step satisfies all criteria. Steps that are unavailable for a
layout (for example offloaded or quantized weights) are recorded as
unavailable. The legacy refusal path is unchanged.
Closes#233
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Weight orthogonalization can drive a direction's projection to about 0
while behaviour is unchanged (arXiv:2609.16247, App. D), and valence state
can persist through the KV cache (arXiv:2609.35591). Every non-refusal
concept intervention is now followed by an evaluation battery:
- mechanistic: per-layer residual projection before and after;
- collateral (on by default): refusal rate on 320 paired, seeded built-in
harmful prompts versus the pristine model, using a one-sided exact
McNemar test on discordant pairs. The report includes Wilson CIs for both
rates, a paired bootstrap CI for the drop, and loss/gain transitions.
Below 284 prompts a non-significant result is UNDERPOWERED, and a
significant drop is FAIL at any size. Also first-token KL, coherence
anchors and neighbour-concept projections;
- optional re-steer and KV-cache persistence probes, and a pack-supplied
behavioural battery hook.
evaluation.json separates mechanistic, behavioural and collateral outcomes,
and lists untested channels (the KV channel unless probed). Skipping the
battery is recorded with a reason. Pristine refusal flags are cached by model
id and revision, prompt-set hash, decoding config and scorer identity (mode
plus pattern hash); runs with no pinned revision are not cached. Legacy
refusal runs are unchanged.
Closes#230
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
apply_concept_intervention(model, direction, mode, layers, positions, ...)
supports four modes:
- orthogonalize: the permanent weight projection, routed through the
offload-aware transactional path (all targets resolved before the first
mutation, including tied aliases; rollback on failure);
- project: a reversible inference-time projection hook;
- steer: reversible steering with signed alpha, per-layer vectors, a
runtime-mutable coefficient, and safetensors+JSON save/load;
- lora: a forward-time adapter that never modifies base weights, so
removal restores pristine logits exactly.
The pipeline and SteeringHookManager now share one hook mechanism, with the
public API kept compatible. Installation is transactional: a failure partway
removes any hooks already installed. evaluate_dose_ladder reports steering
over a default alpha ladder, with invalid-output and refusal denominators and
a caution that steering effects are coefficient-fragile and non-monotonic.
The validation gate is enforced. Only the built-in refusal pack (matched by
pack hash, not by label) is exempt. Other directions need a passing or
warning verdict, or a recorded override.
Closes#229
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>