From d5414bec253dd5bf0301a4b22a3797f48264ed65 Mon Sep 17 00:00:00 2001 From: jgrusewski Date: Tue, 14 Apr 2026 23:46:27 +0200 Subject: [PATCH] =?UTF-8?q?spec:=20Component=206=20early=20termination=20?= =?UTF-8?q?=E2=80=94=20PLATEAU=5FEXHAUSTED=20after=2012=20attempts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3 rewinds × 4 routes = 12 max attempts. Failed = improvement rate below threshold over 10 epochs. On exhaustion: save best model, exit cleanly, log "structural change needed". Saves ~3 hours H100 vs frozen training. Co-Authored-By: Claude Opus 4.6 (1M context) --- ...s-pollinated-branch-intelligence-design.md | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/superpowers/specs/2026-04-14-cross-pollinated-branch-intelligence-design.md b/docs/superpowers/specs/2026-04-14-cross-pollinated-branch-intelligence-design.md index 6981c8a67..19e9040d5 100644 --- a/docs/superpowers/specs/2026-04-14-cross-pollinated-branch-intelligence-design.md +++ b/docs/superpowers/specs/2026-04-14-cross-pollinated-branch-intelligence-design.md @@ -293,10 +293,33 @@ Each rewind attempt uses a different strategy, cycling through: - Liquid tau EMAs reset on rewind (stale velocity from pre-plateau) - Compatible with CUDA graph (params_buf pointer unchanged, only data changes via HtoD) +### Early Termination (PLATEAU_EXHAUSTED) +When all rewinds × all routes are exhausted without breaking through: + +``` +rewind 1 (best checkpoint) → 4 routes → all failed (no improvement > threshold) +rewind 2 (2nd best) → 4 routes → all failed +rewind 3 (3rd best) → 4 routes → all failed +→ STOP. Save best model. Exit with status PLATEAU_EXHAUSTED. +``` + +**Exit criteria:** `rewind_count >= max_rewinds (3) && route_idx >= max_routes (4)` for the current rewind. + +**"Failed" route definition:** improvement rate over M=10 epochs is below `min_improvement_rate` threshold (e.g. 0.1 val_Sharpe/epoch). A route that improves but slowly still counts as success. + +**On termination:** +1. Save the best checkpoint across ALL attempts (highest absolute val_Sharpe) +2. Log: `"PLATEAU_EXHAUSTED: {rewinds}×{routes}={total} attempts. Best val_Sharpe={best} at epoch {ep}. Structural change needed."` +3. Exit training loop cleanly (not a crash — the Argo workflow sees success with the best model saved) + +**Benefit:** train-w6qfd ran 200 epochs frozen from epoch 22 = 178 wasted epochs (~3 hours H100). With backtracking: worst case ~142 epochs with a definitive answer. Best case: breaks through and continues improving. + ### Implementation - `BacktrackingState` struct in `crates/ml/src/trainers/dqn/trainer/mod.rs` +- `TrajectoryCheckpoint` struct for checkpoint data - Checkpoint save/restore methods in `training_loop.rs` - Plateau detection reads liquid tau velocity (already computed) +- Early termination returns `Ok(TrainingResult::PlateauExhausted { best_epoch, best_sharpe })` - ~150 lines total, no new files ---