Non-Stationary Drift Elimination, the Blessing of Dimensionality, and Adaptive Deep Learning Optimization
Full Typeset Research Paper:
paper/HigherDimensional_EWMA_BiasCorrection_Paper.pdf(also available as Overleaf/arXiv LaTeX inpaper/main.texand Typst inpaper/main.typ)
Predecessor 1D Study: Builds upon, audits, and generalizesEWMABiasCorrectionResearch(2023) to arbitrary higher-dimensional contraction operators$\mathbf{B} \in \mathbb{R}^{d \times d}$ .
Standard Exponentially Weighted Moving Average (EWMA) bias correction —
-
Zero initialization (
$v_0 = 0$ ), -
Stationary expectations (
$\mathbb{E}[x_k] \equiv \mu$ , zero trend or curvature), and - Dense, synchronous updates across every coordinate at every step.
In this repository and accompanying paper, we lift EWMA from scalar sequences to arbitrary contraction operators python/verify_proofs.py):
-
Theorem 1 — Affine-Invariant Operator Bias Correction & Cumulative-Mean Duality:
Derives the exact arbitrary-initialization estimator$\hat{\mathbf{v}}_t^{(0)} = (\mathbf{I}_d - \mathbf{B}^t)^{-1}(\mathbf{v}_t - \mathbf{B}^t\mathbf{v}_0)$ , its closed-form finite-$t$ covariance, and proves that for any anisotropic generator$\mathbf{B}(\epsilon) = e^{-\epsilon\mathbf{H}}$ ($\operatorname{Re}\lambda_i(\mathbf{H}) > 0$ ),$\hat{\mathbf{v}}_t^{(0)}$ continuously interpolates between the instantaneous signal$\mathbf{x}_t$ ($\mathbf{B} \to \mathbf{0}$ ) and the exact isotropic cumulative mean$\bar{\mathbf{x}}_t = \frac{1}{t}\sum_{k=1}^t \mathbf{x}_k$ ($\epsilon \to 0^+$ ), whereas uncorrected EWMA collapses to$\mathbf{v}_0$ . -
Theorem 2 — Exact Non-Stationary Drift Lag, Anisotropic Vector Rotation, &
$O(1)$ Trend Correction:
Proves that under drift$\boldsymbol{\mu}_k = \boldsymbol{\mu}_t - (t-k)\mathbf{g}$ , standard bias correction retains a permanent asymptotic lag$-\mathbf{B}(\mathbf{I}_d - \mathbf{B})^{-1}\mathbf{g}$ that rotates vectors off-manifold in$\mathbb{R}^d$ when$\mathbf{B}$ is anisotropic ($8.52^\circ$ permanent angular error in$\mathbb{R}^{64}$ ). Cascading$\mathbf{u}_t = \mathbf{B}\mathbf{u}_{t-1} + (\mathbf{I}_d - \mathbf{B})\mathbf{v}_t$ yields an$O(1)$ -time closed-form finite-$t$ Trend-Corrected Operator EWMA (ExactTC-EWMA) with exact zero bias for all$t \ge 2$ and arbitrary$(\mathbf{v}_0, \mathbf{u}_0)$ . -
Theorem 3 — The Blessing of Dimensionality (
AdaTC-EWMA):
Coupling$\hat{\mathbf{v}}_t^{(0)}$ andExactTC-EWMAvia an online trend-invariant second-difference noise estimator$\hat{\sigma}_{t,i}^2 = \mathrm{EWMA}_{\mathrm{BC}}\!\left(\frac{1}{6}(\Delta^2 x_{t,i})^2\right)$ yields a hyperparameter-free James–Stein / Wiener shrinkage gate$\hat{\gamma}_t \in [0, 1]$ . By Hanson–Wright concentration in$\mathbb{R}^d$ , its excess MSE over the unachievable Oracle$\gamma_t^*$ vanishes at rate$O(d^{-1})$ —reaching+0.02%excess risk at$d = 1024$ and slashing MSE by 73.2%–95.4% across non-stationary manifolds while preserving stationary noise suppression. -
Theorem 4 — Sparse Exposure Mass & Curing the Rare-Token Wakeup Shock in
AdamW:
In dense-gradientAdamWon Zipfian LLM token embeddings (nn.Embedding(sparse=False)) or gated Mixture-of-Experts (MoE), global step$t$ extinguishes bias correction ($1 - \beta_2^t \to 1$ ) while dormant rows remain zero—inflicting an uncalibrated$\frac{1-\beta_1}{\sqrt{1-\beta_2}} = 3.16\times$ –$10.0\times$ step shock when rare tokens wake up. Per-row exposure tracking eliminates this shock and reduces rare-token fine-tuning corruption by 8.8%–14.8%. -
Theorem 5 — Three-Way Bias-Correction Asymmetry Across Batch Sizes:
Proves and quantifies why omitting bias correction causes cold-start under-stepping$(1-\beta_1^t)$ in Momentum SGD ($2.35\times$ full-batch loss penalty),$31.6\times$ step-1 explosion$(1-\beta_2^t)^{-1/2}$ in textbook RMSprop ($+28.0%$ higher MLP loss), and ratio distortion in Adam.
| Aspect | Prior 1D Baseline (EWMABiasCorrectionResearch) |
This Work (HigherDimensionalEWMABiasCorrection) |
|---|---|---|
| Dimensionality & Decay | Scalar |
General vectors/tensors in |
| Step Index vs. Coordinate |
Passed continuous abscissa |
Fixed to exact 1-based discrete step EWMA.cs and AverageCalculator.cs
|
| Non-Zero Initial State |
|
Exact affine-invariant |
| Non-Stationary Curve Lag | Observed lag empirically on Sigmoid/Exponential curves; unsolved | Exact AdaTC-EWMA) |
| Inverted prose for |
Rigorous operator proofs, corrected Momentum/RMSprop recursions, and exact Theorem 5 batch-size scaling | |
| Deep Learning Deployment | Qualitative appendices only | Drop-in CUDA PyTorch AdaTCAdamW validated up to 281.6k-param GPU MoE Transformers
|
| Trajectory Family ( |
Uncorrected EWMA MSE | Standard Bias-Corr ( |
Exact Trend-Corr ( |
Blind AdaTC-EWMA (Ours) MSE |
Gain vs. Std BC | Gain vs. Exact TC |
|---|---|---|---|---|---|---|
| Constant + Noise (Stationary Control) | 504.91 | 9.72 | 24.72 | 9.91 | -1.9% (matches) | +59.9% |
| Sigmoid Transition | 146.00 | 142.24 | 17.28 | 16.11 | +88.7% | +6.8% |
| Exponential Drift | 974.69 | 783.35 | 36.74 | 35.67 | +95.4% | +2.9% |
| Polynomial Curve | 76.81 | 62.41 | 9.21 | 7.69 | +87.7% | +16.4% |
| Sinusoidal Manifold | 577.19 | 399.11 | 108.26 | 107.14 | +73.2% | +1.0% |
| Alternating Plateaus & Ramps | 365.70 | 280.83 | 62.56 | 61.29 | +78.2% | +2.0% |
| Dimension |
Std BC ( |
Full TC ( |
Blind AdaTC-EWMA MSE |
Unachievable Oracle |
Excess Risk Over Oracle |
|---|---|---|---|---|---|
| 2 | 1.9833 | 0.5230 | 0.5643 | 0.4953 | +13.93% |
| 8 | 1.7719 | 0.5174 | 0.4986 | 0.4828 | +3.28% |
| 32 | 1.7453 | 0.5207 | 0.4890 | 0.4851 | +0.81% |
| 128 | 1.7331 | 0.5225 | 0.4865 | 0.4856 | +0.18% |
| 1024 | 1.7414 | 0.5247 | 0.4891 | 0.4890 | +0.02% |
-
Zipfian Embedding Fine-Tuning (
$d = 64{,}000$ , 5 seeds): Eliminates the$2.02\times$ –$2.29\times$ ($3.16\times$ –$10\times$ asymptotic) rare-token wakeup shock, cutting tail MSE corruption by +8.8% ($\beta_2=0.999$ ) and +14.8% ($\beta_2=0.9999$ ). -
Non-Stationary 2-Layer ReLU MLP (
$d = 17{,}668$ , 5 seeds): Bias-correctingRMSpropcuts loss by +28.0% (0.8355 → 0.6013);AdaTC-AdamWbeats standardAdamWon overall loss (0.6206vs.0.6484), post-shift recovery (1.4549vs.1.5622, +6.9%), and final convergence (0.6406vs.0.6559). -
PyTorch CUDA GPU
TinyMoETransformer($d = 281{,}608$ on NVIDIA RTX 5060, 3 seeds):AdaTCAdamWconsistently improves overall cross-entropy (6.0871vs.6.0938), mid-training curriculum shift (6.5305vs.6.5468), and final convergence (5.7458vs.5.7477) overtorch.optim.AdamW.
from python.torch_ada_tc_adamw import AdaTCAdamW
optimizer = AdaTCAdamW([
{"params": dense_params, "row_wise_exposure": False}, # High-D AdaTC + Shift-Aware Moments
{"params": [model.tok_emb.weight, model.moe_experts], "row_wise_exposure": True}, # Per-Row Lazy Exposure
], lr=3e-4, betas=(0.9, 0.999), weight_decay=0.01)import numpy as np
from python.ewma_hd import AdaTCOperatorEWMA
tracker = AdaTCOperatorEWMA(d=128, beta=np.linspace(0.80, 0.99, 128))
out = tracker.step(x_t) # out["adatc"] -> R^128 estimate, out["gamma_hat"] -> shrinkage gate in [0, 1]using EWMABiasCorrectionResearch;
var tracker = new VectorAdaTCEWMA(dimension: 128, beta: 0.92);
double[] estimate = tracker.Step(observationVector);pip install -r python/requirements.txt
python python/verify_proofs.py # SymPy symbolic + non-symmetric matrix verification
python python/test_all.py # Automated edge-case & stability suite
python python/benchmark_signals_hd.py # Reproduces Figures 1-4 & R^d benchmarks
python python/benchmark_optimizers_nn.py # Reproduces Figure 5 & neural benchmarks
python python/benchmark_gpu_transformer.py # CUDA GPU MoE Transformer validation
dotnet build csharp/EWMABiasCorrectionResearch.csproj # Interactive WinForms GUI + C# library@misc{rober2026adatcewma,
title={Generalized Higher-Dimensional EWMA Bias Correction: Non-Stationary Drift Elimination, the Blessing of Dimensionality, and Adaptive Deep Learning Optimization},
author={Rober, Andrew},
year={2026},
url={https://github.com/AndrewRober/HigherDimensionalEWMABiasCorrection}
}



