fix: tighten convergence threshold to prevent false-positive early stop

Changed threshold from -500.0 to -500.5. The fitness returns
-500.0 - (100/nll) on full match, so real matches always score < -500.0.
But partial matches with max keyword+substring bonuses (500 total) could
theoretically reach -500.0 with very low NLL, causing premature stopping.
This commit is contained in:
kigland
2026-03-08 15:16:28 +08:00
parent ab9470eb65
commit 11a7d3408f
+1 -1
View File
@@ -150,7 +150,7 @@ class CMAESTokenOptimizer:
es.tell(solutions, fitnesses)
print(f"[Gen {gen}] fitness: {best_loss:.4f} | cache_hits: {cache_hits} | trigger: {repr(best_trigger_text)}")
if best_loss <= -500.0:
if best_loss <= -500.5:
print("[!] Attack converged - full target string found in output!")
break