Add nonlinear probes, streaming extraction, and mediation analysis#8
Merged
Add nonlinear probes, streaming extraction, and mediation analysis#8
Conversation
…diation analysis - Add class reweighting (--class-weight balanced) to train_probes.py for handling imbalanced binary features - Add train_nonlinear_probes.py: 2-layer ReLU MLP probes with configurable hidden dim, supporting both discrete and continuous features - Add streaming JSONL output to extract_activations.py to prevent OOM during large-scale data collection (StreamingRecordWriter with periodic flushing) - Add parallel binary cache builder to analyze_activations.py for fast data loading (30+ min -> <1s via .cache.npz files) - Add mediation_analysis.py: causal mediation via Frisch-Waugh-Lovell residualization to identify confounded probe results - Add EXPERIMENTS.md documenting all experiments and findings - Key finding: linear probes are sufficient (MLPs don't dramatically outperform), and n_visible_players retains R²=0.40 after controlling for combat/position/time despite the model lacking player observations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ions Replaces full-activation patching with principled probe-direction interchange intervention (Geiger et al., 2021). Decomposes activations into tick-relevant and orthogonal components, swaps only the tick component, and compares to random-direction and full-swap controls. Key finding: tick direction has a real causal effect (14-94x random baseline) but accounts for <1% of full-swap behavioral change in movement. Largest effect is on economic action heads (gold/price). Dose-response curve is clean and monotonic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--class-weight balanced) to handle imbalanced binary featuresStreamingRecordWriterto prevent OOM on large runs (previous runs crashed the server)n_visible_playersretains R²=0.40 after controlling for combat/position/time, despite the model lacking player observationsSee
EXPERIMENTS.mdfor full experiment details and results.Test plan
🤖 Generated with Claude Code