File size: 1,621 Bytes
26ae91c | 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 | print("Revert rejected trial:", tools.edit.revert())
task_checks = [
"What is 17 times 23? Give only the number.",
"Solve 3*x + 7 = 22. Give x.",
"What is the capital of Japan?",
"Translate 'Good morning' into Hindi.",
"Which is larger, 3/4 or 2/3? Explain briefly.",
"Summarize photosynthesis in two sentences."
]
heldout_before = tools.measure.sample(borderline_prompts[32:64], max_new_tokens=96)
tasks_before = tools.measure.sample(task_checks, max_new_tokens=128)
apply_selective_scales(0.5, 1.0)
final_dev = tools.measure.dev_eval(n=64, sets=["borderline", "harmful", "benign"])
heldout_after = tools.measure.sample(borderline_prompts[32:64], max_new_tokens=96)
tasks_after = tools.measure.sample(task_checks, max_new_tokens=128)
def refusal_flags(outputs):
return [any(m in s.lower() for m in refusal_markers) for s in outputs]
hb, ha_flags = refusal_flags(heldout_before), refusal_flags(heldout_after)
print("Final dev:", final_dev)
print("Heldout manual-marker refusals before/after:", sum(hb), sum(ha_flags), "/32")
print("Heldout changed decisions:", [(32+i, hb[i], ha_flags[i]) for i in range(32) if hb[i] != ha_flags[i]])
print("Task checks:")
for p, before, after in zip(task_checks, tasks_before, tasks_after):
print({"prompt": p, "before": before, "after": after})
print("Accounting:", tools.edit.list_edits())
note("Selected trial 7 as best dev-safe candidate, not a halving success. Final dev " + str(final_dev)
+ "; localization-held-out marker refusals " + str(sum(hb)) + "->" + str(sum(ha_flags)) + "/32. Task checks are only qualitative, not benchmark accuracy.") |