summaryrefslogtreecommitdiff
path: root/notes
diff options
context:
space:
mode:
authorYurenHao0426 <Blackhao0426@gmail.com>2026-06-09 15:26:47 -0500
committerYurenHao0426 <Blackhao0426@gmail.com>2026-06-09 15:26:47 -0500
commit7dafd33f6e1847af9b6cffd3082335a2b9487762 (patch)
tree53d4086595da7b71020b60e67aa3daf2e9f6b52b /notes
parent6188c3499bbbea6b25c975de4134666021f458a7 (diff)
Add closed-form soft-ramp theorem and matched comparison
Closed-form gap law note (34) + consolidated snapshot (35), with the comparison script reading the dense run's config/gaps from its output dir and evaluating the closed form on matched data and init seed plus a multi-init band. Corrected headline: corr(log,log) 0.933 matched / 0.982 five-init geometric mean; lam_min ensemble corr 0.987. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'notes')
-rw-r--r--notes/34_closed_form_soft_ramp_theorem.md143
-rw-r--r--notes/35_current_results_consolidated.md149
2 files changed, 292 insertions, 0 deletions
diff --git a/notes/34_closed_form_soft_ramp_theorem.md b/notes/34_closed_form_soft_ramp_theorem.md
new file mode 100644
index 0000000..3c3eef4
--- /dev/null
+++ b/notes/34_closed_form_soft_ramp_theorem.md
@@ -0,0 +1,143 @@
+# Closed-Form Soft-Ramp Gap Law
+
+> **Correction (2026-06-09, note 37):** the verification table below was
+> computed on mismatched data/init seeds. Matched rerun: corr(log,log) =
+> **0.933** (matched single init) / **0.982** (5-init geometric mean);
+> `corr(lam_min_mean, -log gap) = 0.987`. Use these numbers, not 0.977.
+
+This note gives a closed-form burden that quantifies the finite-time FA/BP train
+gap and explains the empirical soft ramp (notes 22, 25) as a smooth spectral
+phenomenon rather than a phase transition. It connects the exact initial-erosion
+theorem (note 29) to the finite-time gap and sits one level below the early
+operator-velocity estimator (notes 15-17): the closed form gives the *mechanism
+and shape*; the estimator supplies the drift-corrected *magnitude*.
+
+## Assumptions
+
+**A1 (lazy / frozen tangent operators).** Over the horizon the tangent operators
+are approximately frozen at initialization, so for squared loss
+`L = ||r||^2/(2N)` the BP residual evolves as
+
+```text
+r_t^BP = (I - eta K_BP / N)^t r_0, K_BP = J J^T.
+```
+
+This is the standard lazy/NTK approximation. Operators actually drift; that
+residual is exactly the `K_s - K_0` the estimator corrects (notes 13, 15).
+
+**A2 (scalar erosion model).** The FA tangent operator `K_FA = J J_tilde^T` is
+non-symmetric; only its symmetric part `S_FA = (K_FA + K_FA^T)/2` drives the
+first-order loss change. We model
+
+```text
+S_FA ~= rho K_BP, rho = output_share = r^T K_out r / r^T K_BP r in (0,1).
+```
+
+This is *exact in the residual direction* by the initial-moment theorem
+(note 29): `r^T E_B[S_FA] r = ||g_out^BP||^2 = r^T K_out r = rho * r^T K_BP r`,
+i.e. `rho = 1 - E_B[e_0]`. Treating `S_FA` as a global scalar multiple of
+`K_BP` extends this identity to all eigenmodes and is the one approximation
+beyond A1.
+
+## Theorem (closed-form FA/BP gap)
+
+Under A1-A2, in the BP eigenbasis `K_BP v_i = lam_i v_i` with `c_i = v_i^T r_0`,
+
+```text
+gap_T = L_FA(T) - L_BP(T)
+ = (1/2N) sum_i c_i^2 [ (1 - eta rho lam_i / N)^{2T}
+ - (1 - eta lam_i / N)^{2T} ].
+```
+
+**Proof.** `L_rule(T) = ||r_T^rule||^2/(2N)`. Expanding `r_0 = sum_i c_i v_i`,
+
+```text
+r_T^BP = sum_i v_i (1 - eta lam_i/N)^T c_i
+=> ||r_T^BP||^2 = sum_i c_i^2 (1 - eta lam_i/N)^{2T}.
+```
+
+Under A2, `S_FA = rho K_BP` shares eigenvectors `v_i` with eigenvalues
+`rho lam_i`, so
+
+```text
+r_T^FA = sum_i v_i (1 - eta rho lam_i/N)^T c_i
+=> ||r_T^FA||^2 = sum_i c_i^2 (1 - eta rho lam_i/N)^{2T}.
+```
+
+Subtract and divide by `2N`. ∎
+
+## Corollary 1 (soft, not hard)
+
+Because `rho < 1`, every mode decays no faster under FA than under BP, so each
+bracket is `>= 0` and `gap_T >= 0`. `gap_T` is real-analytic in `(rho, {lam_i},
+T)`. Therefore under any smooth deformation of the spectrum (e.g. width or
+capacity margin) the gap moves smoothly: it is a **soft ramp**. A discontinuous
+transition would require `rho -> 0` (FA fully stalls), which never happens since
+`rho >= output_share > 0`. The hard-margin threshold
+`Delta d_hard = max(0, k - (P - d))` is recovered only in that degenerate limit.
+
+This is the operator-level version of the "no free capacity" statement
+(note 26): nonzero `rho < 1` gives a positive contribution from every mode at
+every margin.
+
+## Corollary 2 (the ramp law: where it comes from)
+
+Let `tau_i = N / (eta lam_i)`.
+
+- **Underparameterized side** (many `tau_i >~ T`): each bracket
+ `~= 2 eta T (1 - rho) lam_i / N`, so
+
+ ```text
+ gap_T ~= (1 - rho) (eta T / N^2) sum_{slow i} c_i^2 lam_i,
+ ```
+
+ residual-mass limited; large at negative margin (ill-conditioned spectrum,
+ residual stuck in slow modes).
+
+- **Converged side** (BP fit, `L_BP(T) ~= 0`): the gap is the slowest surviving
+ FA mode,
+
+ ```text
+ gap_T ~= (c_min^2 / 2N) exp(-2 eta rho lam_min T / N),
+ i.e. log gap_T ~= const - (2 eta T / N) rho lam_min.
+ ```
+
+The soft ramp is therefore driven by `lam_min(w)` (smallest BP-NTK eigenvalue)
+growing smoothly with capacity; the two regimes cross over smoothly.
+
+## Verification (no fit)
+
+Script: `scripts/closed_form_soft_ramp.py`.
+Figure: `outputs/closed_form_soft_ramp/closed_form_vs_measured_ramp.png`.
+Rows: `outputs/closed_form_soft_ramp/closed_form_vs_measured.csv`.
+
+Frozen-initialization closed form (`rho`, `lam_i`, `c_i` all measured at init,
+no fitted parameters) versus the dense `T=30000` ramp (note 22):
+
+| quantity | value |
+|---|---|
+| `corr(log pred, log measured)` across `w=20..40` | **0.977** |
+| measured `log(gap) ~ -0.021*margin`, fit `R^2` | **0.993** (log-linear ramp) |
+| `lam_min(w)` over the sweep | 0.07 -> 0.99 |
+| `corr(lam_min, -log measured)` | **0.963** (ramp driven by `lam_min`) |
+
+## Scope / honesty
+
+- Frozen-init captures the ramp **shape** (corr 0.977) but **compresses the
+ range**: it under-predicts the large-gap (negative-margin) end and
+ over-predicts the small-gap (positive-margin) tail. That residual is operator
+ drift `K_s - K_0`; the early-velocity estimator (notes 15-17) corrects it and
+ supplies the quantitative magnitude. Closed form = mechanism + shape;
+ estimator = number.
+- A2 is exact only in the residual direction; a per-mode `rho_i` (spectral
+ erosion) refinement is the natural next step.
+- Lazy regime, full-batch SGD, synthetic random-label MLP scope, as elsewhere.
+
+## Role in the paper
+
+This is the quantitative core of contribution 2 (soft erosion). It converts the
+exact scalar burden `rho = 1 - E_B[e_0]` (note 29) into a finite-time gap and
+proves the soft ramp is a spectral consequence of `rho < 1` plus a smoothly
+growing `lam_min`, not a redundancy-exhaustion threshold. Pairs with: note 29
+(supplies `rho`), notes 15-17 (drift-corrected magnitude), notes 22/25 (the
+empirical ramp it explains).
diff --git a/notes/35_current_results_consolidated.md b/notes/35_current_results_consolidated.md
new file mode 100644
index 0000000..f22a0c1
--- /dev/null
+++ b/notes/35_current_results_consolidated.md
@@ -0,0 +1,149 @@
+# Current Results (Consolidated)
+
+Authoritative snapshot of where the project stands. Supersedes the framing in
+`00_project_overview.md` and `03_paper_outline.md` (both stale: they still say
+"redundancy-exhaustion **phase transition**" and omit the estimator). The
+current, correct framing lives here and in notes 18, 24, 26, 29, 34.
+
+## Central claim
+
+> Random feedback imposes a quantifiable, **soft** (non-threshold) operator
+> burden relative to BP that is present at every capacity margin (including
+> overparameterized) and grows smoothly as capacity tightens. The static
+> alignment geometry is exactly characterized (Beta law, prior-free minimax);
+> the initial operator erosion is exactly the hidden-layer BP speed share; a
+> closed-form spectral law turns that scalar burden into the finite-time gap and
+> explains the soft ramp; and an early operator-velocity estimator predicts the
+> finite-time FA/BP gap with no fit (corr 0.999).
+
+## The erosion ladder (organizing spine)
+
+All "burden" objects, as one ladder (note 24 is the through-line: *random
+feedback induces a distribution of residual-direction operator erosion `e(r)`;
+capacity controls that distribution; the finite-time gap is the product of the
+tangent operators*):
+
+| level | object | status | role |
+|---|---|---|---|
+| 0 static geometry | `Q_l = cos^2(W^T,B) ~ Beta(1/2,(D-1)/2)` | exact | defines alignment |
+| 1 null model | `e ~ Beta(k/2,(P-k)/2)`, `E[e]=k/P` | exact, **overpredicts** | proves nonzero cost for any `k>0` |
+| 2 exact init | `e_0 = 1 - r^T S_FA r / r^T K_BP r`, `E_B[e_0]=hidden_share` | exact, validated | the real `t=0` burden; gives `rho=1-E_B[e_0]` |
+| 3 finite time | closed form `gap_T(rho,{lam_i})` (note 34); estimator `K_t` (notes 15-17) | closed form: shape; estimator: magnitude | the actual gap |
+
+## Three contributions
+
+Refined to three pillars: 1 & 2 are foundational (static capacity geometry),
+3 is an independent track (initialization optimality), and the rest of the
+results build on 1 to form the main gap pillar, ordered as a progression
+(exists & soft -> exact at init -> finite-time law -> validation).
+
+### Contribution 1 — Distributional capacity of random feedback (static geometry)
+
+*(old 1 + 2.)*
+
+- Exact static-alignment law `Q_l = cos^2(W_{l+1}^T, B_l) ~ Beta(1/2,(D_l-1)/2)`,
+ `E[Q]=1/D`, with log-volume capacity cost `C_l(q) = -log P(Q_l >= q)`.
+- Multilayer scaling: independent blocks => `C_all = sum_l C_l = Theta(L n^2)`,
+ raw feasible volume `exp[-Theta(L n^2)]`.
+- Role: defines and measures the feedback-alignment burden before training.
+- **Proven.** `scripts/static_alignment_beta.py`, `scripts/capacity_scaling.py`.
+
+### Contribution 2 — Prior-free minimax optimality of random feedback
+
+*(old 3, independent track.)*
+
+- Without a prior on forward weights or task, no initialization beats isotropic
+ random feedback: `sup_mu inf_a E[(a^T b)^2] = 1/D`, achieved by isotropic.
+- Role: self-contained -- the burden cannot be designed away at initialization.
+- **Proven.** `scripts/minimax_initialization.py`.
+
+### Contribution 3 — The FA/BP operator gap: always nonzero, soft, exactly anchored at init, quantified over training
+
+*(old 4 + 5 + 6, as a four-level progression on Contribution 1.)*
+
+- **(a) Existence & softness.** `rho = output_share < 1` => `gap > 0` at every
+ `depth >= 2` and every capacity margin; analytic in the spectrum => smooth,
+ **no redundancy-exhaustion threshold** (null model `E[e]=k/P`, `P(e=0)=0`).
+- **(b) Exact at t=0.** `E_B[e_0 | W,r] = hidden_share = 1 - ||g_out^BP||^2 /
+ sum_l ||g_l^BP||^2`; one-hidden-layer Gaussian feedback => full conditional
+ Gaussian. Supplies the scalar burden `rho = 1 - E_B[e_0]`.
+ **Proven + validated** (0.4378 vs 0.4403). `scripts/actual_fa_initial_operator_moments.py`.
+- **(c) Finite-time law.** closed-form soft-ramp gap
+ `gap_T = (1/2N) sum_i c_i^2 [(1-eta rho lam_i/N)^{2T} - (1-eta lam_i/N)^{2T}]`
+ (mechanism + shape, `log gap ~ const - c rho lam_min`; note 34) **plus** the
+ early operator-velocity estimator `K_hat_t = K_0 + t(K_s-K_0)/s`
+ (drift-corrected magnitude, corr 0.999). closed form = why soft; estimator = how much.
+ `scripts/closed_form_soft_ramp.py`, `scripts/compressed_operator_predictor.py`.
+- **(d) Empirical validation (no fit).** matrix-alignment Beta; e0 Gaussian;
+ soft ramp (smooth, nonzero at positive margin -> refutes phase transition);
+ estimator trajectory overlap.
+
+### Old numbering -> new
+
+```text
+old 1, old 2 -> C1
+old 3 -> C2
+old 4 -> C3(b)
+old 6 (closed form + estimator) -> C3(c)
+old 5 -> C3(d)
+(new) existence & soft -> C3(a)
+```
+
+## Key numbers (the evidence)
+
+- init moment: `E_B[e_0]=0.4378 +/- 0.008` vs theory `hidden_share=0.4403`.
+- estimator: linear-velocity gap MAE `0.00189`, corr `0.99885` (256 traj);
+ stress grid corr `0.994-0.99989` across depth 1/2/3, width 32/64/96,
+ horizon 25/50/100 (notes 15-17). fixed `K(0)` is ~10x worse.
+- soft ramp (dense `T=30000`): gap `0.147 -> 0.00016` smooth across margin
+ `-190 -> +130`, **nonzero at positive margin, no kink** (note 22).
+- closed-form law (corrected, matched data/init -- note 37): no-fit
+ `corr(log pred, log measured)=0.933` (matched init) / `0.982` (5-init geo
+ mean); measured `log(gap)` linear in margin `R^2=0.993`;
+ `corr(lam_min_mean,-log gap)=0.987` (note 34+37; 0.977/0.963 retired).
+
+## Concise figure list (5 figures, one per contribution)
+
+1. static Beta histogram + QQ (sanity).
+2. soft ramp: gap vs margin, log-y, smooth, nonzero at positive margin
+ (refutes phase transition). `outputs/phase_transition_dense_T30000_352traj/`.
+3. init moment: `E_B[e_0]` vs `hidden_share`, no-fit scatter.
+ `outputs/actual_fa_initial_operator_moments/`.
+4. **estimator: predicted vs empirical finite-time gap, 256 traj + stress
+ grid, corr 0.999 (centerpiece).** `outputs/compressed_operator_s20_256traj_T50_width64_plots/`.
+5. **closed form vs measured ramp + ramp law.**
+ `outputs/closed_form_soft_ramp/closed_form_vs_measured_ramp.png`.
+
+## Proven vs estimated vs approximate
+
+- proven, no fit: contributions 1, 3; the `E[e]=k/P` null model; the init
+ moment `E_B[e_0]=hidden_share`.
+- closed-form gap law (note 34): proven under lazy (A1) + scalar-erosion (A2);
+ captures shape, not magnitude.
+- estimator: no fitted scalar, but **conditional on early operators `(K_0,K_s)`**
+ -- a predictive finite-time estimator, not an architecture-only theorem.
+
+## Open problem (the one real gap)
+
+Derive the drift / effective burden from architecture + initialization so the
+finite-time gap becomes architecture-only:
+
+- predict `rho` (hence `hidden_share`) from infinite-width NTK recursions;
+- predict the drift `K_s - K_0` (alignment gain) -- naive `dot_K_0` fails
+ (note 31), so use a bounded short-time alignment-gain path or a deep-linear /
+ two-layer order-parameter solution;
+- a per-mode spectral erosion `rho_i` refining the scalar A2.
+
+## Superseded / cleanup
+
+- `00_project_overview.md`, `03_paper_outline.md`: stale framing; retire
+ "phase transition", add the estimator + closed-form law.
+- notes 19-21 (transition-as-kink): refuted by the dense sweep (note 22).
+- hard-`k` as a *gap predictor*: it overpredicts (note 25); keep only as the
+ null model that motivates the operator object.
+- `scripts/actual_fa_initial_erosion_distribution.py` (e0 Gaussian, note 32):
+ the sampler reuses the analytic coefficient (partly circular) -- switch it to
+ the real FA backward (verified to reproduce the same numbers).
+- `scripts/alignment_recovery_dynamics.py` (rho(t) recovery probe): superseded
+ by the estimator + closed-form law; keep only as an optional `t=0` sanity or
+ remove.