Reversible instance normalization (RevIN) is a small wrapper that most modern time-series forecasters now use. Each input window is rescaled to zero mean and unit variance, the network forecasts in that normalized space, and the forecast is then scaled back using the window's own mean and standard deviation. The training loss is almost always computed after this rescaling back. That means every window's error is multiplied by that window's variance. In effect, the wrapper quietly reweights the training objective toward volatile windows. This note argues that the reweighting is a curvature effect with predictable consequences for optimization. It sets the largest learning rate that gradient descent tolerates. It decides which windows the optimizer flattens the loss against. For linear forecasters, RevIN's two learnable "affine" parameters are the only thing that makes the loss non-quadratic at all.
That last point connects RevIN to the edge of stability (EoS). EoS is the observation that gradient descent on neural networks drives the largest curvature of the loss (the top Hessian eigenvalue, or "sharpness") up to about $2/\eta$ for learning rate $\eta$, and then hovers there with bounded oscillations instead of diverging. Pure quadratic losses cannot behave this way: above $2/\eta$ they simply blow up. RevIN with a linear backbone is therefore a clean, real-data case where the ingredients of EoS can be switched on and off one at a time. We propose to derive and test this picture on standard forecasting benchmarks. We will also check whether choosing how strongly the loss weights volatile windows, a knob that nobody currently treats as one, changes accuracy under distribution shift.
Core Claim
Consider a single channel. Let $\hat x_i \in \mathbb{R}^L$ be the normalized look-back window of instance $i$ and let $(\mu_i, \sigma_i)$ be its mean and standard deviation. Let $\gamma, \beta$ be RevIN's learnable scale and shift, and let $W \in \mathbb{R}^{H \times L}$ be a linear forecaster with horizon $H$. The RevIN output then simplifies to
$$y_i = \sigma_i \Big( W \hat x_i + c\,(W\mathbf{1}_L - \mathbf{1}_H) \Big) + \mu_i, \qquad c = \beta/\gamma .$$
The scale $\gamma$ cancels on the data term. The affine parameters survive only through a scalar-times-vector product between $c$ and the row sums of $W$. With the affine parameters frozen, the loss is quadratic in $W$. Its Hessian is $\frac{1}{N}\sum_i \sigma_i^2\, \hat x_i \hat x_i^\top$ (tensored with the identity over horizons), a covariance of normalized windows weighted by variance. The largest stable learning rate is therefore fixed by the high-variance tail of the training windows, and it can be computed before training.
With learnable affine parameters, the model contains an embedded scalar-vector factorization. This is the class of model in which Gradient Descent with Large Step Sizes: Chaos and Fractal Convergence Region shows that large-step dynamics are bounded but sensitive to initialization. Our prediction is concrete. EoS-style oscillation in RevIN-linear forecasters should appear only when $\beta$ is trainable. It should be concentrated on the direction that couples $c$ to $W\mathbf{1}_L$. Without it, full-batch gradient descent above the computed threshold should diverge as classical theory predicts.
For nonlinear backbones, we expect the same variance weighting to decide which windows dominate the top Hessian eigenvector. That in turn decides which part of the data the EoS flat-minimum bias acts on.
Relation to Prior Work
The closest analysis is Understanding the Generalization Benefit of Normalization Layers: Sharpness Reduction. It shows that internal BatchNorm or LayerNorm plus weight decay makes the loss scale-invariant. Gradient descent then behaves like descent on a sphere with a rising effective learning rate, which pushes it into EoS and reduces sharpness. RevIN breaks this story, because denormalization multiplies the output by the raw $\sigma_i$, so the loss is not invariant to rescaling the weights. We do not try to rescue scale invariance. Instead we identify the structure RevIN actually has: variance-weighted curvature plus a low-dimensional bilinear term.
Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability supplies the measurement method: full-batch gradient descent on data subsets, with the top eigenvalue tracked during training. It also supplies the finding that normalization does not prevent progressive sharpening. That paper never studied instance-dependent output scaling or forecasting models.
Two mechanistic papers set our expectations for what the trainable affine term should do. Kwangjun Ahn et al. attribute non-divergence to higher-order terms of the loss acting as a brake. Lei Chen et al. describe period-2 orbits, in which the iterate bounces between the two walls of a valley. Shuo Chen et al. show that oscillation aligns with the top eigenvector. That result is what lets us test whether the eigenvector lies on the $c$–$W\mathbf{1}_L$ coupling.
On the forecasting side, Reversible Instance Normalization for Accurate Time-Series Forecasting against Distribution Shift defines the wrapper and motivates it purely as a fix for distribution shift. Are Transformers Effective for Time Series Forecasting? supplies the linear backbones DLinear and NLinear. NLinear subtracts and restores the last value with no learnable parameters. Our algebra implies it is exactly quadratic, which makes it a built-in control.
Three papers constrain the design. APT: Affine Prototype-Timestamp for Time Series Forecasting Under Distribution Shift needed an extra regularizer to stop affine parameters becoming "trivial or unstable." That is indirect evidence that the affine subspace is where the trouble lives. Adaptive Normalization for Non-stationary Time Series Forecasting: A Temporal Slice Perspective (SAN) trains its statistics predictor separately to avoid instability. Non-stationary Transformers: Exploring the Stationarity in Time Series Forecasting explains a Transformer failure under normalization as a loss of expressive power, without looking at optimization. We leave that Transformer question aside so that the linear case, where we can predict exactly, is not muddied.
Research Program
The first component is analytic. We extend the formula above to the multichannel case and to DLinear's trend/seasonal split, which gives two linear maps sharing one RevIN wrapper. For each case we write down the predicted stability threshold $\eta^\star = 2/\lambda_{\max}$ from the variance-weighted covariance, computed from training data alone. For the trainable-affine case, we linearize around the quadratic optimum and derive the extra curvature that the $c$ term contributes, as a function of $\|W\mathbf{1}_L - \mathbf{1}_H\|$.
The second component is measurement. We run full-batch gradient descent on fixed subsets of forecasting windows, following Cohen et al.'s protocol. We track the top Hessian eigenvalue by power iteration using Hessian-vector products. We also record the top eigenvector's overlap with the $(c, W\mathbf{1}_L)$ subspace. For nonlinear backbones we additionally decompose the eigenvalue into per-window contributions, so we can see whether high-$\sigma$ windows dominate it.
The third component is an intervention: a "tempered" loss that replaces each window's weight $\sigma_i^2$ with $\sigma_i^{2(1-\alpha)}$. At $\alpha=0$ this is the standard RevIN loss in the original scale. At $\alpha=1$ it is the loss computed entirely in normalized space. Intermediate values interpolate between the two. Sweeping $\alpha$ moves the curvature budget between calm and volatile windows. The sweep tests whether that movement explains differences in test error on windows whose volatility differs from training.
Baselines
The naive reference points are a backbone trained without any normalization and the persistence ("Repeat") forecast. Are Transformers Effective for Time Series Forecasting? reports that Repeat beats Transformers on Exchange-Rate, so it is a meaningful floor there.
The strongest existing reference is standard RevIN: affine parameters trainable, loss in the original scale, Adam, with learning rate tuned on validation data. It is the method whose behavior we claim to explain, and it is what practitioners actually run. The only reported number in the file is from the RevIN paper: on ETTh2 at horizon 960, N-BEATS MSE drops from 6.408 without RevIN to 0.471 with it. For DLinear or NLinear combined with RevIN there is no reported result found on Lacuna. We will produce our own numbers under a shared protocol.
SAN is included as the strongest competing normalizer. It reports an average 21.29% MSE reduction on ETTh2 with DLinear and 11.13% on ILI.
The ablations that isolate our key ingredient are four variants:
- RevIN with $\gamma$ and $\beta$ frozen, which is exactly quadratic for linear backbones.
- RevIN with only $\beta$ trainable, which by our formula should behave identically to fully trainable RevIN.
- NLinear, which has no learnable parameters in its normalizer.
- The tempered-loss sweep over $\alpha$.
Every arm shares the same splits, look-back and horizon grid, epoch budget, and a learning-rate sweep with the same number of trials. The dynamics study uses full-batch gradient descent on identical window subsets.
Our analytic claim beats "no explanation" if two things hold across datasets and look-back lengths. First, the predicted $\eta^\star$ matches the observed divergence onset of frozen-affine gradient descent within 10%. Second, EoS hovering appears only in arms with trainable $\beta$. The tempered loss beats standard RevIN only if some fixed $\alpha$, chosen on validation data, lowers test MSE on held-out high-shift windows across at least three of ETTh1, ETTh2, Exchange, and ILI without hurting Weather.
Why not just…?
Why not just compute the loss in normalized space and skip the analysis? This is a real threat to the practical half of the proposal. It is the $\alpha=1$ endpoint of our sweep. If $\alpha=1$ wins everywhere, the practical result collapses to "change one line of code." The analysis would still explain why that works: it removes the domination of the threshold by the variance tail. We will report that outcome plainly rather than promote intermediate $\alpha$. Its likely weakness is that it weights calm windows equally, even though MSE in the original scale is the evaluation metric. The sweep measures that tradeoff directly.
Why not just lower the learning rate or rely on Adam? For the frozen-affine linear model the loss is convex. A small enough step converges, and nothing about EoS matters there. We accept that. The claim that matters in that case is only the pre-computable threshold. Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability reports that step sizes kept below the classical bound are far slower for nonlinear networks. Non-Euclidean Gradient Descent Operates at the Edge of Stability indicates that the same ceiling reappears under other geometries. For that reason we repeat the eigenvalue tracking under Adam, using the curvature of the Adam-rescaled update, rather than assuming Adam escapes the effect.
Why not just set RevIN's affine to off, as many codebases already do? Our formula predicts this removes every source of EoS behavior in linear forecasters. The frozen-affine arm tests exactly this. If turning the affine off costs no accuracy, that is a useful negative result: the affine parameters are an optimization liability with no forecasting benefit, consistent with APT's need to regularize them.
Proposed Experiments
We use ETTh1, ETTh2, Exchange-Rate, ILI, and Weather. The first four are strongly non-stationary. Weather is the stationary control, where Be Wary of Your Time Series Preprocessing and SAN both suggest normalization helps little. Look-back lengths are 96, 336, and 720, and horizons are 96 to 720. Backbones are Linear, DLinear, and NLinear, plus a small MLP (a reduced N-BEATS) as the nonlinear case.
The first decisive check is the threshold prediction for frozen affine parameters. We sweep $\eta$ around the predicted $\eta^\star$ and record where full-batch gradient descent starts to diverge.
The second decisive check is the on/off test. With trainable $\beta$, sharpness should rise to about $2/\eta$ and hover there. Oscillation energy should sit mostly in the $(c, W\mathbf{1}_L)$ subspace, and $c$ should show period-2 alternation. With $\beta$ frozen, or with NLinear, gradient descent should diverge at the same $\eta$.
The third check is the attribution test for the MLP backbone. The share of the top eigenvalue coming from the top decile of windows by $\sigma$ should be large under $\alpha=0$ and shrink as $\alpha$ grows.
The fourth check is the accuracy test. We compare MSE and MAE across $\alpha$, broken down by how far the test window's $\sigma$ lies from the training distribution. The question is whether reallocating curvature, rather than capacity, is what separates the arms.
Any of these checks can falsify the account. The account fails if thresholds do not match the prediction, if EoS appears without trainable affine parameters, or if eigenvalue attribution ignores window volatility.
References
- Gradient Descent with Large Step Sizes: Chaos and Fractal Convergence Region
- Understanding the Generalization Benefit of Normalization Layers: Sharpness Reduction
- Gradient Descent on Neural Networks Typically Occurs at the Edge of Stability
- Understanding the unstable convergence of gradient descent
- On Gradient Descent Convergence beyond the Edge of Stability
- On the Convergence Direction of Gradient Descent
- Reversible Instance Normalization for Accurate Time-Series Forecasting against Distribution Shift
- Are Transformers Effective for Time Series Forecasting?
- APT: Affine Prototype-Timestamp for Time Series Forecasting Under Distribution Shift
- Adaptive Normalization for Non-stationary Time Series Forecasting: A Temporal Slice Perspective
- Non-stationary Transformers: Exploring the Stationarity in Time Series Forecasting
- Non-Euclidean Gradient Descent Operates at the Edge of Stability
- Be Wary of Your Time Series Preprocessing