mirror of
https://github.com/wassname/jsteer.git
synced 2026-10-29 20:50:07 +08:00
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>
This commit is contained in:
1 parent
781b703bd9
commit
2c17603e96
1 file changed
+3
-1
+3
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user