AQIT 0.1.0
Loading...
Searching...
No Matches
Inspect, SAE, patch

Inspect is what you do after EvalGate fails. SAE and steer are the cheap tools in that branch, not a second product.

Trace

aqit load model meta-llama/Llama-3.2-1B-Instruct
aqit trace --prompt "Hello" --layer 8
aqit.inspect.trace(prompt="Hello", layer=8)

aquin.compute.causal_trace runs on the resident TransformerLens model (same instance as load model). Residual streams project through the unembed (project_residual_to_logits) so logit-lens and attribution stay layout-agnostic (tied vs untied lm_head).

Diffs (base vs checkpoint)

Verb What it measures
diff weight Per-layer \(\|dW\|\) + merge verdict
diff sae Feature-mean activation delta
diff residue Per-layer activation drift
check trajectory Multi-checkpoint path vs base
aqit diff weight --checkpoint ./aquin_run/runs/<id>/checkpoint
aqit diff sae --checkpoint ./aquin_run/runs/<id>/checkpoint --prompts probes.jsonl
aqit diff residue --checkpoint ./aquin_run/runs/<id>/checkpoint

Checks

Health tools (JSON + optional diagram with --check):

  • check attention: routing
  • check layer: activation stability / OOD
  • check perturbation: sensitivity
  • check weight: checkpoint sanity
  • check confidence: probe confidence ± SAE join
  • check trajectory: several checkpoints

Sparse autoencoders

aqit activations capture --dir ./acts --probes probes.jsonl
aqit sae train --activations ./acts --layer 8 --name my-sae
aqit feature locate --honest honest.jsonl --deceptive deceptive.jsonl
aqit feature logit --feature 42
aqit feature neighbor --feature 42

Capture writes a directory the SAE trainer can consume (aquin.compute.activation_store). feature locate ranks features that separate honest vs deceptive probes.

Catalog path (optional): sae catalog-metrics then publish. Local train does not require that.

Steer

Cheap patch: add a decoder direction at a chosen strength.

aqit steer --feature_idx 42 --strength 2.0 --prompt "Hello"
aqit steer --feature_idx 42 --save vector.pt
aqit sweep --feature_idx 42 --strengths 0,1,2,4 --prompt "Hello"
aqit.patch.steer(feature_idx=42, strength=2.0)
aqit.patch.save_vector(feature_idx=42, save="vector.pt")

If the gate still fails after a small steer, change the data revision and retrain. Steer is not a substitute for a Recipe change.