From 2c17603e96a503e12f66ddebc699a40a14a0ab7c Mon Sep 17 00:00:00 2001 From: wassname <1103714+wassname@users.noreply.github.com> Date: Sun, 12 Jul 2026 08:47:59 +0800 Subject: [PATCH] demo: edge-search probes at demo generation length (was overshooting) The search used max_new_tokens=min(_,200) but the demo generated 256, so at a length- sensitive boundary the search called C coherent that the demo then showed as degenerate (persona_pinv +2.0 demo rep=0.41). Search at the same length as the demo. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- jsteer/demo.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jsteer/demo.py b/jsteer/demo.py index e736241..a9cf3e3 100644 --- a/jsteer/demo.py +++ b/jsteer/demo.py @@ -306,8 +306,10 @@ def show_steer(jac: Jacobian, model, tok, vec, user_msg: str, *, apply_span=apply_span), vec.shared, vec.stacked) if Cs is None: # auto-search the coherent range (needs a probe) probe = rubric if rubric is not None else user_msg + # search at the SAME generation length as the demo -- coherence (repetition) is + # length-sensitive, so a shorter search probe overshoots the real edge. Cs = steer_anchors(model, tok, vec, probe, readout=readout, budget=budget, - max_new_tokens=min(max_new_tokens, 200)) + max_new_tokens=max_new_tokens) logger.info(f"searched coherent anchors: C = {Cs}") prompt = chat_input(tok, user_msg) enc = tok(prompt, return_tensors="pt").to(model.device)