Commit Graph
8 Commits
Author SHA1 Message Date
Joseph MaglyandClaude Opus 5.5 6dc719ff05 fix: address review findings (72b-placement)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 20:52:50 -04:00
Joseph MaglyandClaude Opus 5.5 6b3acf21bb Merge upstream/main into feat/331-pinned-extraction-layer
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>
2026-10-17 14:37:59 -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 24b2342229 feat(concepts): non-inferiority margin for the collateral refusal test (#329)
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>
2026-10-17 13:07:10 -04:00
Joseph MaglyandClaude Opus 5.5 20d4fb0ac8 feat(concepts): add first-class pack entry points for latent concepts (#311)
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>
2026-10-15 17:37:51 -04:00
Joseph MaglyandClaude Opus 5.5 c7f45460eb test: cut slow CPU integration tests below the per-test budget (#304)
Tiny-model pipeline tests were dominated by fixed per-step costs, not
arithmetic: the pipeline's gc.collect() after each verify prompt rescans
every long-lived object the session imported (~0.2 s per call), and
intra-op thread fan-out makes each 16-dim forward slower on loaded runners.

- conftest: add an opt-in tiny_model_runtime fixture (one intra-op thread,
  gc.freeze() of pre-test objects, both restored afterwards). Objects the
  test creates remain collectable, so pipeline behaviour is unchanged.
  Applied to test_offline_integration and the concept_* integration modules.
- test_disk_offloaded_fused_moe_surgery_matches_live_surgery: bound verify
  free-form completions to 4 tokens; every diagnostic still runs through
  the disk-offload hooks and no assertion depends on generated text.
- test_disk_offloaded_subprocess_rss_bound: measure native and legacy export
  in one subprocess on the same offloaded model, resetting VmHWM (after GC
  and malloc_trim) before each mode; native is measured first. Same three
  assertions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 16:53:10 -04:00
Joseph MaglyandClaude Opus 5.5 86982b8a5e fix(concepts): harden the pain pack and record GPU baselines
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>
2026-10-05 22:42:46 -04:00
Joseph MaglyandClaude Opus 5.5 14854019dd feat(concepts): add research-tier pain pack with pinned upstream data
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>
2026-10-05 22:18:08 -04:00