Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cda-mech

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

  1. 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
  2. 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.

Hardware target

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.

Quick start

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.yaml

Layout

src/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.

About

Mechanistic interpretability of LLM agent collusion in continuous double auctions. Caches residual streams and builds contrast pairs for training probes on collusive intent.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages