Label-free candidate pooling — discover behaviorally distinct steering directions in an LLM's activation space without supervised labels.
Adapted from Tommaso Giovannini's unpublished writeup on Candidate Pooling.
- Mine — top-k token positions by
‖∇_h L‖per example, per layer → candidate steering vectors. - Fingerprint — apply each candidate on a probe set, record loss-Δ and entropy-Δ.
- Cluster — column-standardize + row-normalize, then KMeans on fingerprints.
- Select basis — one candidate per cluster, ranked by strength × alignment.
- Evaluate — geometric vs. behavioral diversity scatter.
- BYU ORC account. src/launch.py:30-32 is configured for one H100 on the
csQoS, which requires CS-department access to thecs/cs2partitions. If you don't have that, edit theSlurmConfigto a partition/qos you can use. uvinstalled.
uv sync # creates .venv from uv.lock
mamba create --yes -f environment.yml -p ./.env # messy, but required because mirror's slurm launcher activates this on the compute nodeTo update the mamba env later: mamba env update --file environment.yml --prune -p ./.env.
.env/is a separate mamba environment from the.venv/thatuv synccreates. Mirror's slurm launcher activates./.envon the compute node, so it has to be a working environment — not just an empty directory.
The launcher does login-node prefetch, then submits a SLURM job that runs the pipeline on a compute node:
# On a login node:
uv run python src/launch.py --prefetchOutputs cache land in ~/nobackup/autodelete/candidate-pooling/. SLURM stdout/stderr go to slurm_logs/.
Knobs:
MODEL_ID, prefetch dataset → src/launch.pyn_train,n_probe→run_pipeline(...)call in src/launch.py- Layer / top-k → src/candidate_pooling/mining.py
- SLURM resources (time, GPU, QoS, memory) →
SlurmConfigin src/launch.py
After the pipeline finishes, the fingerprint / cluster / basis artifacts are cached and can be poked at interactively:
- src/candidate_pooling/analysis/analysis.py — load cached pipeline outputs.
- src/candidate_pooling/analysis/dashboard.py — Reacton widgets (attention-delta, steering-curve, etc.).
- src/candidate_pooling/analysis/analysis-testing.ipynb — example notebook.
src/launch.py # SLURM entry point
src/candidate_pooling/
pipeline.py # braided wiring of all stages
mining.py fingerprint.py cluster.py basis.py evaluate.py
model.py data.py types.py
lib/ # dataset / tensor caching helpers
analysis/ # post-run interactive analysis