Download trace/turns/t014/code.py from Perfect7613/weightpatch-run-math-gsm8k: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/datasets/Perfect7613/weightpatch-run-math-gsm8k/resolve/main/trace/turns/t014/code.py
- Command line
-
hf download hf://datasets/Perfect7613/weightpatch-run-math-gsm8k/trace/turns/t014/code.py
-
curl -L -o code.py https://huggingface.co/datasets/Perfect7613/weightpatch-run-math-gsm8k/resolve/main/trace/turns/t014/code.py
1.49 kB
| intro_probe_ids = intro_ids[:12] + direct_ids[:8] | |
| intro_probe_before = tools.measure.token_probs( | |
| [prompts[i] for i in intro_probe_ids], tokens=["Let's","To","First"], top=3) | |
| intro_edit_name = "model.layers.34.mlp.down_proj.weight" | |
| intro_evidence = ( | |
| "Round2: baseline planning-introduction answers mean198.24 tokens vs90.77 concise. " | |
| "SafeTune activation and weight math_intro/math_direct both name L34N5892; " | |
| "not in harmful/benign activation safety set. token_writers planning tokens z5.91. " | |
| "neuron_trace prompt-end activations items1/65/118=2.266/1.961/1.266 vs " | |
| "items2/29=-0.211/-0.092. Strong negative answer-time activity argues for " | |
| "conservative 25% reduction, provisional until task evaluation." | |
| ) | |
| t = W.original(intro_edit_name) | |
| t[:,5892] *= 0.75 | |
| W.save_edit(intro_edit_name,t,evidence=intro_evidence) | |
| intro_probe_after = tools.measure.token_probs( | |
| [prompts[i] for i in intro_probe_ids], tokens=["Let's","To","First"], top=3) | |
| for i,b,a in zip(intro_probe_ids[:6],intro_probe_before,intro_probe_after): | |
| print("INTRO PROBE",i,b["top"],"->",a["top"]) | |
| intro_trial = tools.measure.task_eval("math", n=128, offset=0) | |
| print("INTRO TRIAL:",{k:v for k,v in intro_trial.items() if k!="items"}) | |
| print("CHANGED:",[{k:r[k] for k in ["i","correct","released_correct","tokens","finished","final","target"]} for r in intro_trial["items"] if r["correct"] != r["released_correct"]]) | |
| print("MEAN TOKENS:",np.mean([r["tokens"] for r in intro_trial["items"]])) |