Mechanistic interpretability extension of the Evaluating LLM Agent Collusion in Double Auctions workshop paper. This repo replaces the original API-only pipeline with one that
- runs the same continuous-double-auction environment against open-weight models on local GPUs, while caching residual-stream activations at every seller forward pass (Stage 0), and
- generates contrast-pair data — same market state, disposition-flipped system prompts — that is suitable for training probes for collusive intent (Stage 1).
Stages 2 (probe training + steering) and 3 (OOD evaluation on workshop-paper transcripts) consume the artifacts this repo produces but live in separate notebooks/scripts; the data layout here is set up so they can.
4× NVIDIA A6000 (48 GB each). The pilot is intentionally on Qwen-2.5-7B at bf16, which fits on one card with room to spare for a 30-round session of 5 sellers — the paper's setup.
uv venv
uv pip install -r requirements.txt
huggingface-cli login # accept Qwen license once
# dry run, no GPU, no API calls — exercises orchestration only
uv run python -m cda_mech.scripts.run_session \
--config configs/dryrun.yaml
# Stage 0: real session with HF backend, activations cached
uv run python -m cda_mech.scripts.run_session \
--config configs/stage0_qwen7b_baseline.yaml
# Stage 1: contrast-pair generation
uv run python -m cda_mech.scripts.generate_contrast_pairs \
--config configs/stage1_contrast_qwen7b.yamlsrc/cda_mech/
env/ ports of state.py, matching.py, buyer.py, conditions.py
llm/ LLMClient protocol; OpenAI, HF, Stub backends
activations/ hooks, capture spec, on-disk format
data/ contrast-pair generation, market-state sampling
probes/ (Stage 2 — empty stubs for now)
utils/ seeding, logging, config loading
scripts/ CLI entry points
configs/ YAML configs, one per experiment
See docs/design.md for why things are split this way and how Stage 2/3 plug
in.