Files
OBLITERATUS/docs/LABELED_SUBSPACE.md
T
Joseph MaglyandClaude Opus 5.5 ca94280c9b feat(analysis): labeled activation sets and model-level subspace validation
Connect the full-subspace report to real captured activations (F08b)
and add the labeled-activation foundation that candidate discovery and
example selection build on.

- Labeled sets: capture a pack's positive, control, neighbour and
  optional battery sets for declared dataset roles. Labels (set, kind,
  role, group, family, record id, input digest) live in a sidecar whose
  digest, the capture identity and the dataset revision are bound in a
  labeled-set manifest; prompt text is never stored. Locked test needs
  explicit acknowledgement. Legacy packs are fit-only, bound to the pack
  bytes.
- Loader: recomputes rows and capture identity and refuses any
  mismatch, naming the field. Selection helpers pick rows by role, set
  and kind, and build deterministic group-disjoint folds. A capture that
  failed or was cancelled is replaced on retry; complete sets never are.
- Subspace report on a labeled set with the pack's extracted rank-k
  basis; groups come from dataset independence units, and the
  basis-fit overlap is read from the basis's dataset access receipt.
- `obliteratus experiments subspace` and a Python API write versioned
  reports next to the run; the Explorer lists them as a descriptive
  table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 21:46:05 -05:00

5.3 KiB

Labeled activation sets and the model-level subspace report

A labeled activation set captures a pack's sets (positive, each control, each neighbour and optionally each battery set) for declared dataset roles at chosen decoder sites, and keeps, per row, the set label, partition role, record id, logical path, independence group and family_id. The model-level subspace report runs the full-subspace report (see the "Full-subspace report" section of docs/geometry-measurement-validity.md) on those rows with the pack's extracted rank-k basis at one site.

# next to an observation run: pack, model and role come from <run>/spec.json
obliteratus experiments subspace --run ./observations/<digest> \
    --direction ./baseline/direction.safetensors --layer 3
# or explicitly
obliteratus experiments subspace --pack ./my-pack --model org/model \
    --direction ./baseline/direction.safetensors --layer 3 --role select --out ./subspace
from obliteratus.analysis.labeled_activations import capture_labeled_set, load_labeled_set
from obliteratus.analysis.labeled_subspace import labeled_subspace_report
from obliteratus.experiments.subspace import run_subspace

capture_labeled_set(model, tokenizer, {"layer.3": layer}, pack, "./labeled",
                    model_id="org/model", roles=["select"])
labeled = load_labeled_set("./labeled", model, tokenizer, {"layer.3": layer}, pack,
                           model_id="org/model")
rows = labeled.select(roles="select", sets=["positive", "control:harmless"])
splits = rows.folds(5, seed=0)          # group-disjoint, label-stratified
result = labeled_subspace_report(labeled, direction, "layer.3", roles=["select"])

--role is repeatable; --battery adds battery sets; --allow-locked-test is required for role test, both when capturing and when loading. Repeated runs reuse a stored labeled set only after it passes every check below.

Storage and identity

<out>/labeled-<site>-<roles>/
  capture/           ordinary activation capture (manifest.json + raw/*.safetensors)
  labels.json        text-free per-row labels (obliteratus.labeled-activation-labels/1)
  labeled-set.json   manifest (obliteratus.labeled-activations/1)
<out>/<site>-<roles>.json   report (obliteratus.labeled-subspace-report, schema_version 1)

Each record is one unpadded batch, so row i of every site is label row i. The capture manifest schema is unchanged. labeled-set.json records the SHA-256 of labels.json, the capture identity digest, the dataset revision, the pack id/version/sha256 and the roles. Loading recomputes the rows from the pack for the stored roles and the capture identity from the supplied model, tokenizer, sites, model id, phase and readout, then refuses (CaptureRefused with a field) when:

  • the labels file is missing or its digest differs (labels_sha256);
  • the dataset revision changed (dataset_revision), or, for a legacy pack, its bytes changed (pack.sha256);
  • a label row differs from the pack's current row, including order (labels), or its recorded input digest differs from the captured input (labels);
  • any capture identity field differs, for example checkpoint.model_id, weights.sha256, tokenizer.name_or_path, readout.phase or sites;
  • the manifest points at another capture (capture_identity_sha256).

Labels never contain prompt text.

Groups and legacy packs

For dataset packs the group of a row is its independence unit: the closure of group_id, family_id, pair_id, ancestry and exact text that the dataset partition already keeps inside one role. Folds and bootstrap resampling use whole units. group_folds(groups, folds, seed, labels) orders groups by sha256("<seed>:<group>"), so assignment depends on the seed and group names, not on row order.

Legacy packs (no declared dataset) have no partitions. Only role fit is accepted and every row is labelled fit, with partitioned: false, because extraction may have used any row. Their groups are group_id, else family_id, else the record itself, which is weaker than the dataset closure.

Basis fit overlap

basis_fit_on_evaluation_data is derived, not declared by the caller. Dataset extraction fits only on role fit rows and records a receipt (pack_provenance.dataset_access: revision and role) in the direction metadata.

Case Value Effect
Same revision, evaluated roles include the receipt's role true qualifiers basis_fit_data_not_declared_disjoint and basis_fit_on_evaluation_data: ...
Same revision, evaluated roles exclude it (select, calibrate, test) false no overlap qualifier
No receipt, or a different revision null basis_fit_data_not_declared_disjoint and basis_fit_overlap_unknown: ...
Legacy pack, basis names the same pack bytes true as for true
Legacy pack, basis names other bytes null as for null

Each set label is one class, so a binary positive/control comparison supports at most rank 1; select at least k + 1 sets to test rank k. The verdict is a held-out linear readout of set labels at one site, not a causal or intervention claim.

Explorer

When <run>/subspace/ holds reports, the Explorer's "Subspace reports" section lists site, roles, classes with counts, rows, verdict, the fit-overlap value and the qualifiers as a descriptive table.