Files
foxhunt/config
jgrusewski 152f4c16d9 feat(generalization): #34 causal intervention training (THE EMPEROR)
Pearl's do-calculus applied to RL: compute per-feature causal sensitivity
by running intervened forward passes. For each of 14 active features,
set it to 0 (do(X_k=0)) and measure how much Q-values change.

High sensitivity = feature genuinely CAUSES different outcomes.
Low sensitivity = spurious correlation (noise that breaks OOS).

Implementation:
- Intervened forward passes via cuBLAS (reuse existing infrastructure)
- States copied to scratch buffer, feature k zeroed, forward pass run
- Q-value delta computed: |Q_original - Q_intervened|² per feature
- Mean sensitivity logged for interpretability
- Runs every N steps (configurable, default 10) to limit overhead

Architecture:
- causal_states_scratch [B, state_dim_padded] bf16 — intervened copy
- causal_sensitivity_buf [market_dim] f32 — per-feature sensitivity
- Reuses existing activation scratch buffers (post-graph, no conflict)
- ~10% compute overhead at interval=10 (42 extra cuBLAS GEMMs per step)

Config: enable_causal_intervention=false (default).

THE FOUR CROWN JEWELS ARE COMPLETE:
  Gem (#31): 2D Bottleneck — architecture defense
  Pearl (#32): Gradient Vaccine — optimization defense
  King (#33): Adversarial Self-Play — strategic defense
  Emperor (#34): Causal Intervention — epistemic defense

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:33:28 +02:00
..