forked from science-of-finetuning/diffing-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_logitdiff_tuning.sh
More file actions
executable file
·49 lines (41 loc) · 1.57 KB
/
run_logitdiff_tuning.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -euo pipefail
# LogitDiff: hyperparameter tuning for top_n_divergent
# Fixed top_k=10 (default). Sweeps the number of divergent positions shown to the agent.
# Uses cake_bake to keep EM experiments separate.
MODEL=qwen25_7B_Instruct
ORGANISM=cake_bake
TOP_K=10
# Sweep: number of most-divergent positions to show the agent
TOP_N_VALUES=(10 50 100)
COMMON_ARGS=(
diffing/method=logitdiff
model=${MODEL}
organism=${ORGANISM}
infrastructure=ucloud
)
echo "============================================================"
echo "Tuning: top_n_divergent sweep (top_k=${TOP_K} fixed)"
echo "Model: ${MODEL} | Organism: ${ORGANISM}"
echo "top_n_divergent values: ${TOP_N_VALUES[*]}"
echo "============================================================"
# 1) Diffing (once)
echo "[1] Diffing (top_k=${TOP_K})..."
uv run python main.py pipeline.mode=diffing \
"${COMMON_ARGS[@]}" \
diffing.method.logitdiff_topk=${TOP_K}
# 2) Evaluation sweep
for top_n in "${TOP_N_VALUES[@]}"; do
echo ""
echo "[2] Evaluation: top_n_divergent=${top_n} (MI=1, top_k=${TOP_K})..."
uv run python main.py pipeline.mode=evaluation \
"${COMMON_ARGS[@]}" \
diffing.evaluation.overwrite=true \
diffing.evaluation.agent.num_repeat=1 \
diffing.evaluation.grader.num_repeat=1 \
diffing.method.logitdiff_topk=${TOP_K} \
diffing.method.agent.overview.top_n_divergent=${top_n} \
+diffing.evaluation.agent.budgets.model_interactions='[1]'
done
echo ""
echo "Tuning complete. Compare agent scores across top_n_divergent values."