Skip to content

Record: Sliding Window Eval (stride=64), val_bpb=1.1925 - #50

Merged
0hq merged 1 commit into
openai:mainfrom
mattqlf:submission/sliding-window-eval
Mar 19, 2026
Merged

0hq merged 1 commit into
openai:mainfrom
mattqlf:submission/sliding-window-eval

Conversation

@mattqlf

@mattqlf mattqlf commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Sliding window evaluation with stride=64 on the baseline 9x512 SP-1024 architecture
  • val_bpb: 1.1925 (post-quant int8+zlib), improving on the Naive Baseline's 1.2244 by 0.032
  • Training is identical to the baseline; the improvement comes entirely from the evaluation strategy
  • Each token is scored with 960+ tokens of context instead of 0-1023
  • Eval takes 70s on 8xH100 (well within the 10-minute eval budget)
  • Total artifact size: 15,874,829 bytes (under 16MB cap)

Test plan

  • Trained and evaluated on 8xH100 SXM (RunPod)
  • final_int8_zlib_roundtrip_exact val_bpb:1.19250007
  • Artifact size verified under 16,000,000 bytes
  • train_gpt.py compiles and runs within the records folder

@mattqlf
mattqlf force-pushed the submission/sliding-window-eval branch 2 times, most recently from 928069f to de24caf Compare March 19, 2026 05:39

@0hq 0hq left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@0hq
0hq merged commit d84a3e8 into openai:main Mar 19, 2026
@0hq

0hq commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

One nit: Can you double check that the tail can't be silently dropped in the eval? window_starts only keeps windows where ... >= stride, so the last partial segment of validation data is not scored if it is shorter than stride. This can bias the metric downward or upward depending on what was skipped.

@mattqlf

mattqlf commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Good catch — the final partial window was indeed silently dropped. Fixed in #124: changed the filter to >= 1 and clamped wlen - stride to avoid negative indexing on short windows.

maxivione pushed a commit to maxivione/parameter-golf that referenced this pull request Mar 20, 2026
scottspace pushed a commit to scottspace/parameter-golf that referenced this pull request Mar 21, 2026
leonardcser added a commit to leonardcser/parameter-golf that referenced this pull request Mar 22, 2026
Sliding window eval (credit @mattqlf PR openai#50) with configurable stride.
Muon weight decay 0.04 (credit @notapplica PR openai#60).
Orthogonal init with muP scaling (credit @raahilshah PR openai#162).
Gradient clipping at 0.3.

int8 roundtrip val_bpb: 1.2653. Sliding window would add ~0.03 on 8xH100.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
nedcut pushed a commit to nedcut/parameter-golf that referenced this pull request Mar 26, 2026
felix-ab pushed a commit to felix-ab/parameter-golf that referenced this pull request May 4, 2026
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
…V-as-loss → diagnostic-only)

Both router and MoS CV-as-loss are subsumed by other mechanisms; the
loss-side multiplication is dead weight per the CLAUDE.md
most-principled-simplest-general directive (FAILED Simplest test —
contributing nothing but adding state):

- router_load_cv_coef = 0.0 since iter146; balance fully covered by the
  EMA-anchored balance loss (router_ema_balance_coef=0.30, reverse-KL
  form since iter153). The default 0.0 means no behavior change.
- mos_load_cv_coef = 0.15 BUT at iter163 step 1000 the contribution
  was 0.000242 = 0.08% of router_reg_loss (0.31) — noise. MoS head
  balance is maintained for free by the routing softmax + small head
  count, not by mos_load_cv_coef. Removal does not change behavior
  measurably (verified by 5-step smoke: rho_F 1.30 → 0.82 in 5 steps
  with iter163 mechanism intact, router_reg_loss in normal range).

CV (router and MoS) remains computed and emitted as diagnostic
tensors: `_router_cv_loss_t`, `_mos_cv_loss_t`, and `attn_cv` /
`mlp_cv` / `pool_cv` step-log fields. Only the loss multiplication
and the per-coef effective tensors (`_router_cv_coef_eff_t`,
`_mos_cv_coef_eff_t`) are gone.

Removed sites across 10 files:
- train_gpt.py: Hyperparameters fields, GPT.__init__ args + body,
  loss assembly multiplications, coef diagnostic tensors,
  regularizer-warmup annealing lines, log emission, CLI tunable
  knobs entry, model construction call, docstring/comment cleanup.
- _prescribe_failure_fix: `router_load_cv_coef_floor` recommendation
  already removed in 4af904f; `mos_router_collapse` now also returns
  empty config_change with category `mos_router_collapse_advisory`
  (same advisory pattern as router_collapse_advisory).
- Tests: test_loss_component_logging (constructor args + tensor
  field list), test_training_contracts (parser field list),
  test_submission (constructor arg), test_cli_parser (positional
  parser tests now use router_pertoken_entropy_coef), test_arch
  (invariant_keys, prescription cases, defaults checker now asserts
  the fields are GONE).
- plot_metrics: registry entries, term-derivation specs (router_cv_term
  and mos_cv_term removed), aux_coef_series.
- test_plot_metrics_parse: fixture strings + assertions updated.
- CLAUDE.md "Routing/loss stack" bullet updated.
- opg_doc.tex: Loss section coefficient list ($\lambda_{\rm rcv}$ and
  $\lambda_{\rm mcv}$ removed), router/CV discussion paragraphs
  rewritten to clarify CV is diagnostic-only.

All 170 tests pass. 5-step GPU smoke validates iter163 mechanism still
functions correctly with no CV-as-loss.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants