Skip to content

[WIP] autoresearch-inspired attempt at solving this - #47

Closed
calmdentist wants to merge 4 commits into
openai:mainfrom
calmdentist:main
Closed

calmdentist wants to merge 4 commits into
openai:mainfrom
calmdentist:main

Conversation

@calmdentist

Copy link
Copy Markdown

No description provided.

@0hq 0hq closed this Mar 19, 2026
jzmyres pushed a commit to jzmyres/parameter-golf that referenced this pull request May 19, 2026
…ture

iter158 (reverse-KL on corrected baseline) result: K=16 final_full_validation
val_bpb 1.475130, K=24 final_full_validation 1.474375 (Option C re-eval per
user directive: gate on the model's K_best, not arbitrary deq_k_eval=16).
Both miss iter152's 1.471820 promotion gate (Δ +0.0033 / +0.0026).  K=24 IS
better than K=16 by Δ -0.0008, validating Option C as the principled gate
methodology — recommend permanent productization in a follow-up commit.

Routing health: only ONE failure (router_collapse: attn_min_share=0.0327
< 0.0375).  Expert_collapse + local_contraction_failed both PASS.  This is
the first iter in the project's history with a confirmed asymptotic FP
convergence certificate: rho_F = 0.86 at K=128 (well under 1.0), vs
lip_ub_F = 15.07 at the same K — a 17× σ-vs-ρ gap empirically validating
the Tier 1+2 framework that lip_ub_F was an over-restrictive proxy for
the necessary-AND-sufficient ρ(J_F) < 1 condition.

Reverse-KL hypothesis CONFIRMED principled but BPB-NEUTRAL on the corrected
baseline — i.e., it doesn't move BPB vs iter152 at the K=16 gate but holds
all other gates iter155 failed.  Routing balance (attn_min_share) is the
actual remaining bottleneck; iter162 (doubled ortho + entropy coefs) and
iter160 (per-expert inverse-popularity NTP) are the two principled
escalation paths.

Queue restructure (5 new task entries, 2 closures):

  iter160 (formerly iter154): inverse-popularity per-expert NTP on iter158
    base; conditional on iter158 promoting BPB but not min-share (which
    iter158 didn't, so iter160 may be deferred unless iter162 also misses).
  iter161: H94 GPTQ+LQER + H96 per-group artifact compression bundled as
    a single multi-day "artifact-shrink program" (saves ~1-2 days vs
    sequential).
  iter162 (NEW): doubled ortho (0.30→0.60) + entropy (0.10→0.20) coefs
    targeting routing-quality push.  Per user directive 2026-05-14 the
    0.30 cap on entropy_coef was REMOVED, so future iters can push
    higher if 0.20 underperforms.
  iter163 (NEW): Final-K-as-GT consistency loss — the principled
    architecture-agnostic mechanism for natural FP convergence learning.
    Forward to FINAL K (no-grad) → ground-truth FP target z_GT; TBPTT to
    K_train; consistency loss anchors each TBPTT iteration to z_GT.
    Implicitly enforces ρ(J_F) < 1 (necessary for the consistency loss
    to minimize) without any direct rho_F penalty.  Avoids iter144 IFT
    failure and iter155 Lyapunov failure.  ~3× step time vs baseline.
  iter164 (NEW, far-future): anytime-K routing — per-K output heads,
    inference picks best K per token via learned confidence.  Connection
    to anytime DEQ literature.

Closures:
  iter142 deep K (32, 48): subsumed by the K-jitter extension shipped in
    commit d0bcade (16, 24, 32, 64, 96, 128).
  iter156 hard contraction governor: closed because the entire iter156
    design was based on the false premise that σ_max(J_F) < 1 is required.
    The principled framework (Tier 1+2 + iter158 K-sweep evidence) is
    rho(J_F) < 1, which iter158 satisfies WITHOUT any contraction
    intervention.  "Contraction debt" was a measurement artifact.
    Re-open ONLY if a future iter shows rho_F >= 1 AND iter_conv_rel
    >= 0.05 — currently no such evidence anywhere.

Future cleanup (task openai#47, deferred): remove lip_ub_F + lip_ub_S +
_run_spectral_norm_power + _lip_ub_at_saved_fp.  rho_F is necessary AND
sufficient; lip_ub_F is just a looser upper bound (17× gap on iter158
empirically).  Keep lip_ub_T as opt-in decomposition diagnostic for
potential iter156 re-opening.  ~250 lines removed, ~50 updated.  Done
as a single focused cleanup commit between iter162 and iter163 to avoid
mid-research log inconsistencies.

Final-K-as-GT Durable Rule + arch-agnostic constraint added to
hypotheses.md and CLAUDE.md: any iteration mechanism (alternative DEQ
solvers, refinement loops, recurrent layers) is gated on rho(J) < 1 AND
the principled fix path is Final-K-as-GT consistency, NOT spectral
normalization (rejected as arch-specific) and NOT pure IFT (rejected by
iter144 empirical refutation).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jzmyres pushed a commit to jzmyres/parameter-golf that referenced this pull request May 19, 2026
Two scoped cleanups between iter165 closure and iter163 launch.

(1) Add `rho_F` to fast-val emission. The principled FP-convergence
gate metric (necessary AND sufficient per Hartman-Grobman) was only
emitted in the K-sweep until now; iter163's promotion gate (which
will demote `lip_ub_F` to advisory entirely) needs fast-val signal.
The new probe sits in the same `if run_fp_lip_probe_F:` branch as
`lip_ub_F` — sharing its always-on policy. New focused test
`test_rho_F_is_emitted_in_fast_val_alongside_lip_ub_F` enforces
both the call-site placement AND the log-string formatting,
mirroring the existing `test_lip_ub_F_is_always_probed_...`.

(2) Refute `_prescribe_failure_fix.router_collapse` after the iter165
3-iter closure (iter158/162/165 all confirmed routing-balance push
ACTIVELY HURTS BPB at iter152's operating point). Category renamed
`router_collapse → router_collapse_advisory` (now ends in `_advisory`,
satisfying the Root-cause-fix-preference test gate). `config_change`
is now empty; the fix string explains the empirical refutation
inline. `test_arch.py` contract updated: required-keys becomes
empty set, forbidden-keys explicitly lists `router_bias_update` and
`router_load_cv_coef_floor` to prevent the refuted recommendations
from quietly returning.

NOT included (intentionally): full removal of `router_load_cv_coef`
field (already 0.0; would touch 6+ files for a dead-code cleanup —
defer to task openai#50), and full removal of `lip_ub_T/S/F` (Banach-paired
with `fp_bound`, ~1200 LOC — defer to task openai#47). These are larger
cleanups that warrant their own commit cycles.

All 157 tests pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jzmyres pushed a commit to jzmyres/parameter-golf that referenced this pull request May 19, 2026
…ator (rho_F is sole spectral gate)

FAILED Principled per the CLAUDE.md most-principled-simplest-general
directive: operator-norm proxies (lip_ub_*) and the Banach error bound
(fp_bound) are over-restrictive for non-symmetric J_F. iter152 baseline
has sigma_max ≈ 17 yet iter_conv_rel ≈ 0.02 (clearly converging) — the
gap between the principled gate (rho_F < 1, Hartman-Grobman necessary
AND sufficient) and the operator-norm proxy is huge for the Parcae
two-state cycle. iter155 (Lyapunov-on-F + lip_ub_F) was NOT-PROMOTED
which directly refuted the operator-norm framing.

Removed surface (~1200 LOC net):
- Hyperparameters: fp_lip_fast_val_every, fp_lip_power_iters,
  fp_lip_ub_safety, fp_lip_ub_margin (replaced by fp_rho_power_iters=8).
- EvalProfile.lip_probe_set + _should_probe_lip_for_k (probe scope no
  longer parameterized; rho_F probes every row).
- Helpers: _run_spectral_norm_power (~114 LOC Hutchinson power iter on
  J^T J), _lip_ub_at_saved_fp (~48 LOC wrapper),
  _lipschitz_upper_bound_metric (~16 LOC safety/margin scaler),
  _fixed_point_error_bound_metric (~8 LOC Banach bound).
- Fast-val + K-sweep: lip_ub_T/S/F probe calls, log emission, K-sweep
  table columns + dict accumulators.
- Post-int gate: legacy attribution string referencing lip_ub_F.
- Prescriptions: lip_ub_f/lip_ub_t/lip_ub_s/fp_bound branches collapsed
  into a single `operator_norm_advisory` category (legacy failure
  strings from pre-2026-05-15 logs still route here for backward
  compatibility); rho_F branch unchanged.
- Lyapunov-on-F `power_jvp_F` estimator branch (relied on
  _run_spectral_norm_power for worst-direction probe). Lyapunov is
  still flagged (lyapunov_coef=0 default, refuted by iter155 but
  retained for ablation); only the power_jvp_F estimator is gone —
  random_fd remains. Validator now rejects power_jvp_F explicitly.
- 14 lip_ub-specific tests in experiments/test_lip_ub_fix.py; file
  renamed to experiments/test_rho_F.py and rewritten with 2 focused
  tests (rho_F finite-float + always-on fast-val emission). Negative
  assertions in the always-on test guard against lip_ub_* coming back
  via copy-paste regression.

Kept:
- rho_F machinery: _run_spectral_radius_power (~115 LOC straight power
  iter on J directly with geometric-mean averaging for complex-
  eigenvalue robustness), _rho_F_at_saved_fp wrapper, fast-val + every
  K-sweep row emission, post-int gate (rho_F >= 1.0 triggers
  fp_convergence_failed).
- fp_residual_F (joint two-state-cycle residual, paired with rho_F).
- iter_conv_rel (z-only step residual, empirical convergence signal).
- Legacy attribute names _lyapunov_z_star / _lyapunov_x0 (kept because
  the rho_F probe consumes them; rename is a separate concern).
- plot_metrics.py log parsing: legacy lip_ub_T/S/F + fp_bound keys
  retained as no-ops for backward compatibility with pre-2026-05-15
  archived training_logs/.

CLAUDE.md updated:
- Standing Directive about rho_F always-on (replaces the lip_ub_F
  always-on directive); test enforcement points at the new
  experiments/test_rho_F.py.
- DEQ-diagnostics-by-definition principle reworded to drop the lip_ub_F
  reference; rho_F is the sole principled spectral gate.

All 158 tests pass. 3-step GPU smoke confirms rho_F=0.86 in fast-val
(no lip_ub_* fields in step log) and K-sweep table emits rho_F +
fp_residual_F + iter_conv_rel only.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
jzmyres pushed a commit to jzmyres/parameter-golf that referenced this pull request May 19, 2026
…ode sync

Post-production review of the three preceding commits (iter163 promotion +
cleanup openai#47 + cleanup openai#50) using coderabbit, pr-review-toolkit, and four
exploration agents found ~25 drift items that the prior cleanups missed.

iter163 correctness fixes:
  - bf16 invariant: _consistency_extend_no_grad cast Parcae coefficients
    to z.dtype so the no-grad extension target follows the same bf16
    trajectory as the actual training-time DEQ solve (was silently fp32
    because _parcae_a_bar/_parcae_b_bar return fp32). Without this, the
    consistency target was biased relative to what the model produces.
  - Split _consistency_*_loss_raw (with-grad, used in assembly) from
    _consistency_*_loss_t (detached log copy) to match the convention
    used by every other loss component.

iter163 P0 sibling-fanout DRY fix:
  - The iter163 promotion commit emitted consistency_anchor_loss /
    consistency_ext_loss to run.log but had no entries in plot_metrics.py
    parse_log, tests/test_training_contracts.py required_fields, or any
    plot fixture. Added a CONSISTENCY_LOSS_FIELDS registry in
    plot_metrics.py driving both the out-dict initializer and the parser
    loop; added the fields to the contract-test required_fields.

opg_doc.tex doc-code sync:
  - Parameter table: dropped stale router_load_cv_coef / mos_load_cv_coef
    rows (cleanup openai#50 removed the fields but left the rows with
    arithmetically wrong values); replaced with the new
    multi_k_consistency_anchor_coef / extension_coef / extension_delta
    rows (loss-form-triple-touch compliance).
  - Loss equation block: dropped the λ_rcv·CV² and λ_mcv·CV² terms that
    the cleanup commit removed from code but left in equations, while
    the prose two paragraphs later claimed they were "gone" — internally
    inconsistent.
  - Feature table: flipped deq_prefix_anchors from false to true to match
    CLAUDE.md (default-on since iter152 promotion, 2026-05-13).
  - Local Stability Guarantee section: rewrote the lip_ub_F-as-gate
    paragraphs to point at rho_F (necessary AND sufficient by
    Hartman-Grobman); annotated the historical narrative paragraphs with
    'removed 2026-05-15'.
  - Bumped document date 2026-05-06 -> 2026-05-15.

train_gpt.py docstring sweep:
  - Annotated or rewrote ~10 stale lip_ub_F / fp_bound / power_jvp_F
    references in _collect_routing_losses, _prescribe_failure_fix,
    _parcae_cycle_F, _joint_F_residual_at_saved_fp, the Hyperparameters
    Lyapunov section, and the Lyapunov FD branch comments.
  - Removed the redundant docstring bullet listing mos_load_cv_coef as a
    prescription lever (the prescription itself correctly notes the
    removal).

New audit-checklist row (the user's explicit ask for a prevention
principle): 'Removal-symmetry sweep' in CLAUDE.md. When removing a
Hyperparameter / loss term / diagnostic, the same commit MUST drop the
field from Hyperparameters + CLI + opg_doc.tex (equation AND parameter
table), annotate every train_gpt.py docstring that names the field, and
preserve intentional backward-compat parsing with a co-located comment.
The worst failure mode is removing the implementation but leaving the
equation in opg_doc.tex and a paragraph two pages later saying 'removed'
— that produces an internally contradictory paper.

Enforced by NEW tests/test_removal_symmetry.py (5 tests, all passing):
  - Greps opg_doc.tex, train_gpt.py, CLAUDE.md for an explicit ledger of
    removed names (REMOVED_NAMES tuple); asserts each occurrence is in
    an annotated 3-line context window (REMOVAL_ANNOTATIONS markers).
  - Asserts removed Hyperparameters fields are absent from the dataclass
    body.
  - Asserts iter163 log fields are in plot_metrics.py + contract test
    (the addition-direction analogue of the same DRY rule).

EXPERIENCE.md gains #removal-symmetry-sweep section with the full
incident write-up and index row.

Verification:
  - 158 tests pass across tests/ + experiments/test_*.py.
  - LaTeX compiles cleanly (pdflatex exit 0).
  - grep verification: all remaining lip_ub_* / fp_bound mentions in
    opg_doc.tex and train_gpt.py are in annotated context windows.

Simplify pass (post-review): consolidated cv_sum/mos_cv detach to single
site at assignment (removed redundant aggregation-side detach);
condensed verbose iter163 anchor-loss comment (cross-references
opg_doc.tex Section 7 instead of restating the math); merged
required/optional loss-tensor assertion loops in
test_loss_component_logging.py; replaced O(N*M) line+name scan in
test_removal_symmetry.py with a single compiled combined regex.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants