Papers
Topics
Authors
Recent
Search
2000 character limit reached

HiPPO-LegS Matrix: Online Projection Operator

Updated 20 December 2025
  • HiPPO-LegS matrix is an online L²-projection operator that compresses continuous signal history onto a rescaled Legendre polynomial basis for robust sequential modeling.
  • Its formulation leverages a closed-form, lower-triangular structure and Legendre recurrence relations to update memory states without requiring explicit timescale priors.
  • The operator demonstrates strong stability, controlled approximation error, and improved performance over related methods like LMU in tasks with long-range dependencies.

A HiPPO-LegS matrix arises within the HiPPO (High-order Polynomial Projection Operators) framework as a closed-form, lower-triangular state-space operator for maintaining the online L2L^2-projection of past continuous input signals onto a degree-NN Legendre polynomial basis supported on [0,t][0, t] under a uniform measure. The HiPPO-LegS memory update mechanism provides a theoretically robust, efficient, and timescale-agnostic solution for compressing cumulative signal history in sequential or trajectory data. Its formulation delivers essential advancements in recurrent state space models (SSMs), especially for modeling long-range temporal dependencies in deep learning.

1. The HiPPO Framework and the LegS Specialization

The HiPPO framework seeks the optimal online projection of the truncated input history f≤tf_{\leq t} onto an NN-dimensional polynomial space with respect to a time-varying measure μ(t)\mu^{(t)}. At each instant tt, given an orthonormal polynomial basis {pn(t)}n=0N−1\{p_n^{(t)}\}_{n=0}^{N-1} on [0,t][0, t],

g(t)(x)=∑n=0N−1cn(t)pn(t)(x),cn(t)=⟨f≤t,pn(t)⟩μ(t)g^{(t)}(x) = \sum_{n=0}^{N-1} c_n(t) p_n^{(t)}(x), \qquad c_n(t) = \langle f_{\leq t}, p_n^{(t)} \rangle_{\mu^{(t)}}

For HiPPO-LegS, the measure is uniform on NN0: NN1, yielding rescaled Legendre polynomials. The projection coefficients NN2 evolve according to a linear, time-varying ODE, which underpins the HiPPO-LegS matrix structure (Gu et al., 2020).

2. Formulation of the HiPPO-LegS Matrix

The continuous-time HiPPO-LegS state equation is

NN3

where NN4 is the scalar input, NN5, and NN6 are time-invariant matrices given by:

NN7

This closed-form, lower-triangular structure emerges from differentiating the orthogonal projection and exploiting Legendre polynomial recurrence relations (Gu et al., 2020, Gu et al., 2022, Park et al., 2024). The update dynamics optimally compress the entire signal history onto the polynomial basis at all timescales, avoiding explicit timescale priors.

3. Dynamics, Singularities, and Well-Posedness

Letting NN8 denote standard Legendre polynomials on NN9, the normalized basis on [0,t][0, t]0 is

[0,t][0, t]1

The projected state [0,t][0, t]2 satisfies

[0,t][0, t]3

where [0,t][0, t]4 and [0,t][0, t]5 are derived from Legendre recurrence integrals. At [0,t][0, t]6, [0,t][0, t]7 develops a singularity, precluding arbitrary initial conditions. The only permissible initial state is [0,t][0, t]8 for all [0,t][0, t]9, corresponding to zero prior history. Under this requirement, the ODE is well-posed on f≤tf_{\leq t}0 for Riemann-integrable inputs (Park et al., 2024).

4. Discretization and Numerical Analysis

Time discretization converts the continuous ODE to a discrete recurrence suitable for algorithmic implementation. For unit steps (f≤tf_{\leq t}1), forward Euler yields:

f≤tf_{\leq t}2

Alternative schemes such as backward Euler and midpoint (second-order Runge-Kutta) have also been shown to converge, with respective global accuracy f≤tf_{\leq t}3 and f≤tf_{\leq t}4 for step size f≤tf_{\leq t}5 and suitable resolution near f≤tf_{\leq t}6. Stability is enhanced for implicit schemes due to the stiffness introduced by the f≤tf_{\leq t}7 scaling (Park et al., 2024). Each matrix-vector update can be performed in f≤tf_{\leq t}8 time by leveraging the sparsity and structure of f≤tf_{\leq t}9 (Gu et al., 2020).

5. Theoretical Properties and Memory Capacity

HiPPO-LegS exhibits several key properties critical for sequential modeling:

  • Timescale robustness: The evolution is equivariant to time dilations: if NN0, then NN1, ensuring invariance to sampling rate changes and obviating timescale hyperparameter tuning (Gu et al., 2020).
  • Stability: The gradient decay in the mapping from inputs to memory coefficients is NN2, avoiding vanishing or exploding gradients typical in recurrent networks.
  • Approximation error: For Lipschitz or smoother NN3, the error in the NN4 projection decays as NN5 or NN6 for NN7-smooth NN8, reflecting classical Legendre approximation bounds (Gu et al., 2020).
  • Spectral structure: The underlying NN9 is nearly skew-Hermitian under the Legendre norm, leading to eigenvalues on the imaginary axis and precluding exponential growth of the homogeneous flow μ(t)\mu^{(t)}0. The condition number of the eigenvector matrix scales polynomially with μ(t)\mu^{(t)}1, ensuring practical stability for moderate μ(t)\mu^{(t)}2 (Park et al., 2024).

The Legendre Memory Unit (LMU, also referenced as LegT) projects onto a fixed-length window μ(t)\mu^{(t)}3 using a translated Legendre polynomial basis, yielding an ODE

μ(t)\mu^{(t)}4

This approach introduces a timescale hyperparameter μ(t)\mu^{(t)}5, requires nontrivial boundary treatment, and is less robust under varying sampling rates. HiPPO-LegS eliminates the need for such priors by adapting the window to μ(t)\mu^{(t)}6 at all timescales and empirically outperforms LMU/LegT in benchmarks targeting long-range dependency (Gu et al., 2020). HiPPO-LegS matrices also play a crucial foundational role in state space models (notably S4), where they serve as initialization for the state matrix, enabling effective modeling of long sequences (Gu et al., 2022).

7. Implementation and Empirical Performance

HiPPO-LegS matrices can be precomputed for fixed μ(t)\mu^{(t)}7. The memory update at each timestep is performed as:

tt4

or with optimized prefix-sum kernels for the lower-triangular matvec. These updates yield RNN memory cells that optimally track the Legendre coefficients of the ongoing input history (Gu et al., 2020).

Empirically, HiPPO-LegS achieves state-of-the-art results on tasks such as permuted MNIST (98.3% accuracy) and trajectory classification, with substantial margins over RNN and neural ODE baselines, especially in regimes requiring timescale robustness or with missing data (Gu et al., 2020).


Table 1: HiPPO-LegS and LMU Matrix Structures

Operator Measure/Window μ(t)\mu^{(t)}8 Pattern (closed form)
HiPPO-LegS Uniform on μ(t)\mu^{(t)}9 Lower triangular, tt0, tt1
LMU (LegT) Uniform on tt2 Alternating sign, explicit tt3 dependence

For further technical details and proofs, see (Gu et al., 2020, Gu et al., 2022), and (Park et al., 2024).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to HiPPO-LegS Matrix.