Files
experiments_codebase/AGENTS.md
T
gloamxun e0feabec8f Initialize optimizer research workspace with official baselines and history-free coverage
Vendor pinned MeZO, AGZO, LOZO and LoREN sources with independent environments. Add direct in-place fix/adjust/node training, derived history-free basis gradients, development-best checkpoints and experiment tooling. Keep models, datasets, caches and credentials outside Git.

Validation: 93 project tests passed; 521 vendored author files verified.
2026-11-12 23:32:33 +08:00

24 lines
5.4 KiB
Markdown

# Project instructions
- User instruction (2026-11-12): align checkpoint selection with MeZO: save by minimum post-update development loss, restore development-best weights before final official-validation evaluation, retain earlier checkpoint on ties. Short-run learning-rate selection also uses development-best loss. Existing final-iterate experiments and source snapshots must remain recoverable; restarted best-checkpoint studies use new output directories. HF exports remain inference-only, not exact training-resume checkpoints.
- User authorization (2026-11-12): implement and train history_free_coverage_gradient_v1 via --node_update history_free. Use the derived current-batch gradient 2 Pi r n v, one joint node forward plus the two reused training forwards; apply old-basis SGD before installing normalize(d+rho*gradient). No historical gradient, sign/fixed-angle replacement, curvature term or gate. All untied Linear bases; refresh every 128 updates; short learning-rate search then fresh long run, with complete query/source/data records. Default original node remains recoverable.
- User clarification (2026-11-12): engineering experiments may use explicitly documented local-curvature approximations without a global upper-bound certificate. Keep magnitude-based basis gradients, validate the estimator, record the exact variant and query costs, and use theory to interpret observations without claiming certified descent. This authorizes local_curvature_gradient_v1; historical sign/fixed-angle proxy results remain ineligible.
- Do not commit or push until explicitly requested by the user.
- Preserve vendored official files. Put device/API adapters outside author files and document every numerical change as a distinct variant.
- Each baseline owns pyproject.toml, uv.lock and .venv. Our methods use the root environment. Never mix site-packages across environments.
- Shared assets default to /mnt/e/Experiments/Assets/{models,data,results}. Check the live E mount before writes; no model/data/result output on C or NAS by default.
- Fix/adjust/node use direct_weights_inplace_v2: apply rank-1 Gaussian SGD updates directly to Linear weights W, with dense auxiliary updates. Keep algorithms and basis construction in trainer.py; no separate subspace state or B/C/warm decomposition. Preserve tied weights once; switching bases must not change W. Internal historical reference modules remain in src/experiments_codebase.
- Keep the experimental flows minimal: fix uses a fixed basis; adjust_single_probe_v1 compares one old/new virtual update. User rollback (2026-11-12): default node restores node_unconditional_refresh_control_v1, using the historical EMA/node proposal every 128 updates without old/new gating. Its ideal node sketch estimates G^T p, not the scalar s; reassess stale proposal directions and update costs before new experiments. Retain the explicitly selected local_curvature variant for review. Do not add interpolation search, repeated trials, SEM gates, or independent confirmation unless requested. Default refresh-event costs are adjust=6 and node<=7 main forwards, plus the normal 2-forward training step.
- All basis construction and detection forwards count against the main budget. Evaluation counts are separate. Do not use diagnostic gradients in training updates.
- Perturb weights in place and regenerate per-parameter noise from the same seed for inverse restoration, as in AGZO. Do not snapshot the full model or retain full-model noise. Restoration allows FP32 rounding error; do not claim bitwise equality. Three-point monitoring of an existing direction costs one extra forward; candidate construction/comparison/confirmation costs must be reported separately.
- Save effective hyperparameters, source/data fingerprints, query counts, loss/accuracy curves, timing and memory. Progress updates must identify actual evaluation query counts.
- Native author Trainer results and common task-adapter results are different protocols. Do not claim paper reproduction from smoke checks or reuse mismatched cache/data hashes.
- Follow the Karpathy Guidelines; keep changes scoped and verify the affected behavior.
- No proxy implementations: map research code to the agreed derivation, or finish a complete implementation-and-test plan first. Never silently replace gradient magnitudes with sign/fixed-angle steps, normalize sampling directions without the derived scaling, or substitute measured local curvature for a required quadratic upper bound. Derive and validate stochastic estimators and assumptions before formal experiments. If required theory or quantities are unavailable, document the gap instead of running a substitute. Historical proxy results do not validate or refute the intended theory.
- Own methods use methods/large_models (MeZO-style Framework/OurTrainer), with one run.py entry and --trainer fix|adjust|node. Keep method documentation in methods/README.md; do not reintroduce separate method wrapper or provenance directories. Default all three methods to data_protocol=mezo, using author sampling/templates/objectives and HF RandomSampler with tail batches retained. Explicit legacy selects the historical data protocol, not the historical coefficient parameterization. Never mix caches across protocols or parameterizations.
- Current checkpoints are standard HF model directories. Removed legacy entries and their dedicated regression helpers must not be used for current validation; old .pt checkpoints are unsupported.