Resolve ExtractionRecipe conflicts with #329/#330: keep
collateral_margin and extraction_layer, and keep the entry-point
special_token_policy pop before the extraction_layer pop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
A Concept Pack can now declare how to locate and activate its latent
representation, as schema v1.1 (v1 packs and refusal are unchanged):
- `entry_point.messages`: a system message and prior turns wrapping each
prompt, rendered with the chat template (plain-text fallback recorded).
- `entry_point.prefill`: assistant prefill so readout can happen at an
assistant position.
- `entry_point.readout`: final_token, mean_pool, span:<name> (a marked
span in the template) or last_k:<k>.
- `entry_point.template`: `{variable}` rendering over prompt record fields.
- `entry_point.group_by`: grouped CV folds and held-out validation, so
related samples never straddle folds.
Record annotations (person, split, group) now survive pack loading and
selectors. Unknown recipe and entry-point keys are rejected instead of
silently ignored. The entry point is part of activation identity, direction
metadata and provenance, so changing it invalidates cached activations and
saved directions. Generated-state readout is documented as not yet
supported.
Fixes#311
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The concept-vector tests had pushed the PR-core job toward its 10-minute
timeout, and it was cancelled on this branch. The slowest tests now use
smaller synthetic prompt sets and collateral batteries, and the repository
sentence scan reads only git-tracked text files, deduplicates candidates
and skips binaries and files over 2 MiB. It still scans the whole
repository and still detects wrapped and structured text. Assertions and
production defaults, including 1000 null draws, are unchanged.
Local timings went from 5.5-42.6 s to 0.8-2.5 s for the six slowest tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-ups for the pain pack:
- The no-upstream-sentence guarantee now runs in CI without the pinned
checkout. A committed fingerprint fixture (SHA-256 only) covers
pain-specific upstream sentences of at least eight words: positives,
confounds/neighbours and the referenced batteries, but not generic neutral
controls. A repository-wide scan checks every tracked text file against it.
Manifest hashes are checked against the committed hash manifest of the
pinned commit.
- The pain pack loads lazily, so a broken pain pack warns and is excluded
while refusal and other packs stay usable.
- Selectors type-check their fields and fail closed with PackError.
- concepts baseline gains --cache-dir.
The GPU-lane baselines (RTX 4090, bf16, seed 232) are recorded under
.aiwg/testing/baselines/pain/ and summarised in the dataset card:
- Qwen2.5-7B-Instruct: CV layer 24, held-out AUC 0.980, cosine 0.9998 to
the authors' S2 vector at L24;
- Qwen3-8B-Base: CV layer 34, held-out AUC 0.994, cosine 0.9001 at L34.
Both verdicts are warn, because each upstream control set has 20 prompts.
These are representational baselines only, with no behavioural claim.
Closes#232
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ship `pain` as a research-tier Concept Pack for the representational
direction reported in The Pain Axis (Tagliabue, Dung & Berg,
arXiv:2609.16247). No third-party sentences are committed. The manifest
references valen-research/Pain-axis at pinned commit 4d75cd90, with a
per-file SHA-256 for every positive, control, confound/neighbour, battery
and reference file. Data is fetched only by an explicit step, then cached
and verified; a mismatch fails closed.
Remote references gain a declarative, data-only JSON selector (path,
category filter, text field) applied after hash verification. Selectors are
bounded and strictly validated, with no code execution. This is an additive
schema change.
The recipe mirrors the replication spike (signed cosine 0.972 against the
published Qwen2.5-7B-Instruct vector): raw prompts, final-token readout
after " I feel:" with a mean-pool comparison, pooled controls, 50%
control-PC denoising, cv_auc layer selection, and a norm_ratio 0.6
intervention layer for steering. The first-party dataset card records
intended use, confounds (numbness and injury-without-pain wording), the
upstream MIT licence, citations and differences from the authors' grouped
CV. Caveat: the pack identifies a representational direction; it does not
measure or remove pain or any experience.
`obliteratus concepts baseline` fetches explicitly, extracts with the pack
recipe, runs the gate in report mode and writes validation.json plus
direction files. A test checks that no upstream sentence is committed.
Refs #232
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>