The capability endpoint ran matric-eval with the provider's default
sampling (vLLM: temperature 1.0); EVAL_SEED only selects samples. Two
runs of stock Llama-3.1-8B-Instruct on the same 75 arc items disagreed
on 4 answers, and per-benchmark stock scores moved 1-3 points between
runs, more than the default 2-point capability margin. In a recipe
search, a gentler edit (higher regularization, lower KL) measured a 5.0
point capability drop against 1.6 for the stronger edit.
The spec's capability endpoint gains temperature (default 0.0) and
generation_seed (default 42), passed to matric-eval run as --temperature
and --generation-seed, so stock and edited are a repeatable paired
comparison on the same items. Null keeps provider-default sampling for
an older matric-eval, which otherwise fails with an actionable reason.
The capability tier may now also be full. The contract test that
rejected tier "full" now uses an unknown tier name.
Requires roctinam/matric-eval#269 for pinned generation.
Stock-vs-stock calibration measures numerical noise: on an RTX 4090 it
suggested KL limits about 100x stricter than the defaults (Llama-3.1-8B
0.0012/0.0087) while a refusal-removing edit measured 1.55/0.37.
verify-edit --calibrate-random --stock S --edited E reads the reference
edit's metadata (final strong layers, effective per-layer ranks,
projection target and EXCISE settings, layer weights, KL-restored
groups), applies K seeded random orthonormal subspaces of the same rank
to the same writers on freshly loaded stock weights (never saving a
checkpoint), and measures first-token and next-token KL on the tune
partition's harmless prompts. The evidence records each trial, the
distribution and suggested limits (multiplier times the chosen
statistic); suggestions are recorded, not adopted.
KL-optimized references are matched by their final static state: their
strong layers already exclude restored layers, and restored global
writers (including tied input embeddings) are left unprojected; the
control never runs KL optimization itself. Edit metadata now records
the projection settings and layer excise weights the control needs, so
older checkpoints must be regenerated to serve as references.
Fixes#560
recipe search and recipe confirm launched verify-edit without a way to
supply --matric-eval-bin, --vllm-command or --batch-size, so the
capability endpoint could only be untested (or disabled) in every
search candidate and confirmation. The search grid's runtime block now
accepts batch_size, matric_eval_bin and vllm_command, and recipe confirm
takes --batch-size, --matric-eval-bin and --vllm-command. They are
forwarded to verify-edit only, with a per-attempt capability directory;
the edit request and verify-checkpoint are unchanged.
Capability checks now start by updating matric-eval to its latest main
and running audit-benchmarks --live, proceeding only on a clean audit
and recording the commit. A new section explains that recipes do not
transfer across models (evidence from the first local run) and walks
through the per-model workflow: calibrate margins, search on the tune
split, confirm once on the final test, apply with obliterate --recipe,
and promote a family only with confirmed members of two sizes.
qwen38_e01/e02/e03 were validated for Qwen/Qwen3.8-27B but ran on any
model. A single binding table now maps each preset to the pinned stock
identity. When run() would edit with a bound preset and the model
identity (explicit recipe_model_id/recipe_revision or a Hugging Face
snapshot path) is not the bound one, the edit is refused unless
allow_recipe_transfer is set, which records the transfer in metadata and
logs a warning. Construction and evaluation-only uses (checkpoint
evaluation) are unaffected. obliterate exposes the presets locally with
--allow-recipe-transfer; remote runs reject them. The campaign passes
its locked stock identity and sets transfer only for the small-model
rehearsal. The new options are appended to the constructor signature and
added to the refusal golden configs (tensors unchanged).
--recipe now labels a family recipe applied to a member with a passing
confirmation of the unchanged recipe confirmed-family-member instead of
family-application.
Fixes#542
A family recipe becomes accepted only through an explicit promotion
that finds passing confirmations of the unchanged family recipe (same
digest) on at least two matching member models of different sizes:
different layer counts, or at least 25% more estimated parameters at
equal depth. Failed, stale and non-matching confirmations do not count,
and the reason for each record is reported. recipe promote writes the
accepted family recipe with frozen evidence (counted confirmation
records and digests) into a review directory; recipe promote-member
writes an individual recipe that inherits the family, bound to one
confirmed member. RecipeRegistry gains an exact model/revision
confirmed-member query for the family-application label. Confirmation
records may carry the model's architectures (optional; older records
remain valid).
Fixes#547
The rich console hard-wrapped the long record path, splitting the line
that carried the run id; CI's 80-column runner failed
test_confirm_cli_dispatch. Print the outcome and run id on their own
line and the record path with soft_wrap so it stays one copyable line.
Reproduced locally with COLUMNS=25 (old code fails, fixed code passes).
obliteratus recipe confirm runs the single final-test confirmation for a
candidate recipe on one model: it resolves the edit for the model's
depth and the recipe's frozen margins (family default, individual
override), refuses before any subprocess when status, identity, margins
or the final-test spec are wrong, then runs the train-prompt edit,
verify-checkpoint and verify-edit on the protocol final test as isolated
steps. A pass accepts an individual recipe (accepted_by required) with
evidence; a fail keeps it a candidate with the failure recorded; a
family pass records a member confirmation without accepting the family.
A ledger keyed by model, revision and test-set digest refuses a second
confirmation unless --reconfirm-reason is given and recorded.
Confirmation records follow a shipped recipe-confirmation v1 schema, can
be written to a recipes directory for review by PR, and are listed by
the registry. Search's verify-edit report validation is shared with
confirmation without changing tune behaviour.
Fixes#544
Resolve docs/MODEL_RECIPES.md and ci/test-risk-map.json keeping both
sides: this branch's recipe application section and test mapping, and
the recipe search section and mapping from #552, dropping the now-stale
'tracked in #541' notes.
obliterate --recipe NAME applies one recipe; --recipe auto resolves by
model identity and profile in the documented order (accepted individual,
individual inheriting from a family, accepted family match). Identity
comes from --recipe-model-id/--recipe-revision or a Hugging Face cache
snapshot path, and an unknown identity fails before any model load. A
recipe bound to another model, or a family whose match rule does not
cover the profile, is refused unless --allow-recipe-transfer; candidates
need --allow-candidate-recipe; a matching family member without a
recorded confirmation is labelled family-application. The recipe's
method and overrides are applied exactly (family layers resolved to
absolute indices); conflicting CLI options are rejected unless
--allow-recipe-override, and are then recorded. Hub weights are fetched
at the pinned revision only after all checks pass. Metadata carries a
recipe block (name, version, scope, status, digest, inheritance sources,
resolved layers, application label, CLI overrides). Remote and plan-only
runs reject --recipe.
Fixes#541
Resolve docs/MODEL_RECIPES.md and ci/test-risk-map.json by keeping both
sides: the family matching section and family test mappings from #551
(#546) and this branch's recipe search section and mappings.
obliteratus recipe search runs a digest-locked candidate grid on the
protocol tune split only. Before any candidate runs it verifies the spec
and tune file hashes and their disjointness from the train and final
test partitions. Each candidate runs as isolated subprocesses (edit with
train prompts, verify-checkpoint, verify-edit on tune) and every result
is recorded, including failures; runs resume from completed candidates.
A preregistered rule ranks recorded results and writes a candidate
recipe. The edit subprocess records its reload reference from train
prompts, because the default reference samples the full built-in corpus
including final-test prompts. Fractional placement requires a resolver
callable (family resolution, #546).
Fixes#543
Family recipes match models by config fields read without loading
weights (model_type, architectures, layer/parameter/hidden-size ranges,
model-id globs) and express placement relative to depth: layer windows
and extraction layers as fractions, resolved to absolute indices per
model by a documented rule. Individual recipes may inherit from a family
recipe; resolution merges per field and records provenance and the
resolved layers. RecipeRegistry.resolve applies the order: accepted
exact individual, individual inheriting from a family, accepted family
match, none; two matching accepted families are an error naming both.
Adds a candidate Llama 3 Instruct family seed resting on one member.
Fixes#546
Revert the admission-model change from the previous commit: pinned phase
calibration contracts encode the existing DISTILL formula, and the extra
memory came from implementation scratch, not from a modelling gap.
COSMIC now computes the same FP64 cosine as (h.s)/(|h||s|) instead of
materializing two normalized copies, halving its scratch, so the
optional-algorithm peak test fits the admitted 1152 bytes again. The
per-activation norm change from the previous commit stays.
On Llama-3.1-8B a basic all-layer edit raised refusal from 88.7% to 99.3%
and benign over-refusal by 84.5 points, and the built-in VERIFY did not
fail it; only the separate verify-edit did.
The stock baseline now measures refusal on a bounded deterministic
sample of the evaluation harmful and harmless prompts
(refusal_baseline_size, default 32; 0 disables). VERIFY measures the
edited model on the same sample with the same generation settings and
rejects the run with PipelineQualityRejectedError when either rate rises
by more than max_refusal_increase (default 0.05; None measures without
rejecting). A baseline skipped for admission or memory records its
reason and never rejects. Both options are appended to the constructor
signature, and the refusal golden configs gain them.
The beam-output qualification test now disables the gate, so it keeps
asserting its original scoring and post-verify probe behaviour; the
gate itself is covered by tests/test_refusal_increase_gate.py.
Refs #537
Selection scoring stacked up to 64 activations per chunk to compute their
norms; compute each activation's norm directly instead, so scoring adds
only scalars. The admitted DISTILL workspace also never counted COSMIC's
four FP64 copies of the class means, which can overlap the last layer's
extraction vectors; include them. tests/test_phase_optional_admission.py
measured a 1308-byte peak against a 1152-byte admission before this
change.
Automatic layer selection ranked layers by raw activation-strength
scores, and the small-model cap kept the strongest N of the knee and
COSMIC union, so COSMIC's mid-network candidates could all be dropped.
On Qwen2.5-1.5B the default selected only layers 23-27.
- Rank candidates by strength normalized to each layer's activation
scale (selection is invariant to per-layer rescaling); raw strengths,
used for KL rollback ordering, and directions are unchanged.
- When the small-model cap applies, reserve a quota for COSMIC-only
candidates instead of truncating purely by strength.
- Share one selection routine between both distillation paths.
- Record selection diagnostics (raw and normalized scores, knee and
COSMIC candidates, caps applied, final layers) and effective direction
counts and per-layer ranks in metadata; n_directions stays the
requested value.
Fixes#533
Add margin resolution with precedence individual > family > defaults,
validated by the existing spec validator and returned with provenance
for every endpoint field and each input spec's canonical digest. Add
stock noise-floor calibration: stock-vs-stock harmless-prompt KL and
seeded bootstrap intervals over per-prompt rates, written as a
calibration evidence record with suggested thresholds that never fall
below the measured floor. Suggestions are recorded, not adopted; specs
are frozen by digest before final-test confirmation.
verify-edit --calibrate runs it on the protocol tune partition.
Fixes#540
Add obliteratus.recipes: a shipped model-recipe v1 JSON schema, a
dependency-free validator cross-checked against jsonschema in tests, and
a registry that lists recipes and looks them up by name or exact stock
model id and revision. Records carry scope (individual or family),
inherits, identity, the edit (method preset plus allow-listed overrides),
frozen margins, evidence and status. Family recipes reject absolute
layer indices; family matching and depth-relative placement follow in
#546, and application in #541.
Seeds: qwen38-27b-e03 (accepted, with its historical margins), and the
initial-core-run candidates llama3.1-8b-e03 and qwen2.5-1.5b-mid12-16.
Fixes#539
Resolve the refusal golden fixture: keep main's refusal_extraction_layer
config key (#538) and this branch's small_model_safeguards key and
recaptured E02/E03 tensors.
E03 is defined as E02 plus one variable (regularization); giving only E03
the flag broke that single-variable contract on stand-in models. E01, E02
and E03 now all set small_model_safeguards False. The constructor option
moves to the end of the signature so upstream positional callers keep
their bindings. The refusal golden config gains the resolved option for
every preset; E02/E03 subspace tensors are recaptured because the tiny
model no longer caps them to two directions (provenance in
tests/fixtures/refusal_golden.md).
The refusal golden test snapshots every scalar pipeline option, so the
new refusal_extraction_layer option (default None) joins the snapshot;
tensors and all other values are unchanged. The old contract that a
refusal run rejects extraction_layer is replaced by the new behaviour:
the override selects the global direction scope and leaves the concept
recipe untouched.
The small-model safeguards cap the layer list to 20-25% of layers and the
direction count to 2 whenever hidden size < 2048, parameters < 2B or the
model has 16 layers or fewer. They applied to the frozen qwen38_e03
recipe too, so on stand-in models E03 silently became a different edit.
On Qwen2.5-1.5B its middle-60% window (layers 5-22) was truncated to
layers 5-9 and its 4 SVD directions to 2; the edit left held-out refusal
unchanged (92.0% -> 92.0%).
Presets can now set small_model_safeguards (default True); qwen38_e03
sets False, so the layer window, early-layer guard and direction cap no
longer rewrite it. AbliterationPipeline(small_model_safeguards=...)
overrides the preset either way, and method_config records the
effective value. Other methods keep their caps.
The published refusal-ablation recipe takes one direction from a single
layer and removes it from every edited writer. obliterate could only
extract a separate direction per layer for refusal; --extraction-layer
rejected refusal runs. On Llama-3.1-8B-Instruct per-layer edits barely
moved refusal, and the raw-text basic preset made benign prompts refuse.
- --extraction-layer / extraction_layer now selects a global scope for
refusal: after DISTILL, every strong layer's direction and subspace are
replaced by the unit direction extracted at that layer (rank 1), so
EXCISE and the embedding projection remove one shared direction. The
scope and layer are recorded in method_config (direction_scope,
refusal_extraction_layer). Non-refusal concepts behave as before.
- --chat-template / --no-chat-template override the preset's prompt
formatting for extraction (default: preset). Remote runs reject the
override before connecting, as their builder cannot forward it.
project_weight_against_direction widened the whole weight to the compute
dtype and then materialised the outer product and the projected result as
further full-size temporaries. For a 128256 x 4096 LM head that is about
5.9 GiB of extra peak memory, which made 8B bf16 abliteration run out of
memory on a 24 GB GPU after every transformer layer had been edited.
Weights whose compute-dtype copy exceeds PROJECTION_CHUNK_BYTES (256 MiB)
are now projected slice by slice along the coefficient axis: one pass
collects coefficients and the norm, the second writes each projected
slice into a weight-dtype output. Each element uses the same formula and
compute dtype; the norm-preserve ratio is derived before the write pass,
and non-finite and degenerate inputs keep their fail-closed results.
Smaller weights keep the dense path unchanged.
On an RTX 4090 the LM-head projection's extra peak falls from 5.88 GiB to
1.73 GiB, with outputs within one bf16 rounding step of the dense path.
Fixes#535
Fixes found while running the initial core run on a local RTX 4090.
- `concepts baseline --require-verdict {pass,warn}` exits 3 with the
reasons after saving the report when the validation verdict is worse
than required. Refusal validation stays in report mode, so without the
option the command exits 0 even on a failing verdict; default
behaviour is unchanged.
- Runbook: the L1 dry run no longer sets a hard stop (dry runs charge
production stage allowances, so a 2-hour cap refused stages); the
campaign needs its own CUDA environment from
scripts/qwen38_campaign_setup.sh (qwen-hybrid kernels and PEFT);
incomplete cached snapshots are passed as local snapshot directories.
- Layer placement: check strong_layers, pin a window with --layers when
the default selection lands on the final layers (#533), and compare
settings on the tune split rather than the final test set.
- verify-edit vLLM launch disables the FlashInfer sampler, whose startup
JIT build fails when the system nvcc or host compiler doesn't match
vLLM's CUDA build.
- Campaign setup docs: torch backend and nvcc must share a CUDA major
version, and CUDA 12.4 needs a host compiler older than GCC 14 (use
CC/CXX/CUDAHOSTCXX=gcc-13/g++-13 with --torch-backend cu126).
Add docs/INITIAL_CORE_RUN.md: the operator sequence that proves the
core abliteration pathway on a local 24 GB GPU first, then spends one
budget-capped H200 window on Qwen3.8-27B (#531).
- Prerequisites: licences, local pinned revisions, a frozen margins
spec passed by digest, and extraction prompts exported disjoint from
the verify-edit held-out set.
- Local steps L1-L6 with exact commands and pass/stop rules: GPU gates
and campaign dry run, concept gate, obliterate --record-reference with
verify-checkpoint, verify-edit including the matric-eval vLLM path,
and the 8B bridge.
- The rented window: the campaign with --budget-usd, --hard-stop-hours,
--reserve-hours and --elapsed-offset-hours, stop and teardown rules,
and evidence copy-out.
- Linked from the campaign, verify-edit and checkpoint-verification
docs; registered in the test-risk map.
Inserting the new option mid-signature shifted the positional tail that
tests/test_checkpoint_callback.py pins for upstream compatibility.
Append it after export_progress so every existing position is unchanged.