"""Offset-sine sweep: dip the wave deeper into safe/coherent territory than it peaks into entropy-chasing territory, to see if it keeps the occasional surprise from tune_alpha.py's best run (period=16 amp=0.6) without ever grazing the +0.3-and-above coherence cliff found there. """ from entropy_sampler import EntropySampler, sine_alpha_schedule from tune_alpha import PROMPT, MAX_NEW_TOKENS, run_labeled CONFIGS = [ {"period_tokens": 16, "amplitude": 0.6, "offset": -0.2}, # peak +0.4 / trough -0.8 {"period_tokens": 16, "amplitude": 0.7, "offset": -0.3}, # peak +0.4 / trough -1.0 {"period_tokens": 12, "amplitude": 0.8, "offset": -0.2}, # shorter period, same bias {"period_tokens": 16, "amplitude": 0.6, "offset": 0.0}, # unbiased baseline for comparison ] if __name__ == "__main__": sampler = EntropySampler(top_k=12, top_n_future=20, n_ctx=4096) try: for cfg in CONFIGS: schedule = sine_alpha_schedule(**cfg) label = ( f"sine period={cfg['period_tokens']} amp={cfg['amplitude']} " f"offset={cfg['offset']}" ) run_labeled(sampler, label, schedule) finally: sampler.close()