Papers
Topics
Authors
Recent
Search
2000 character limit reached

Frequency Improved Legendre Memory Model (FiLM)

Updated 16 March 2026
  • FiLM integrates Legendre polynomial-based memory with Fourier denoising and low-rank methods, achieving up to 22.6% MSE reduction in forecasts.
  • Its modular design allows easy plug-in with existing models, boosting performance on both multivariate and univariate benchmarks.
  • Empirical evaluations demonstrate significant efficiency gains with 80% fewer parameters and linear scaling in memory usage and training time.

The Frequency Improved Legendre Memory Model (FiLM) is a neural architecture for long-term time series forecasting that integrates Legendre polynomial projections, Fourier-based denoising, and low-rank parameterization. FiLM systematically enhances the representation and utilization of historical information within deep time-series models, delivering accuracy and efficiency gains over contemporary alternatives such as FEDformer, Autoformer, and S4. Its modular design enables direct integration as a plug-in layer for existing deep learning forecasters, and empirical results demonstrate significant improvements in both multivariate and univariate forecasting benchmarks (Zhou et al., 2022).

1. Legendre Memory Model: Theoretical Foundations

FiLM builds upon the Legendre Memory Model (LMM), which encodes the recent history of an input time series x(t)x(t) via projection onto a fixed number of shifted-and-scaled Legendre polynomials. For a time window [t−θ,t][t-\theta, t], the model compresses the historical segment into a vector of coefficients c(t)∈RNc(t) \in \mathbb{R}^N as: cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-1 where PnP_n denotes the Legendre polynomial of degree nn.

The coefficient dynamics follow an ODE: ddtc(t)=−1θAc(t)+1θBx(t)\frac{d}{dt}c(t) = -\frac{1}{\theta}A c(t) + \frac{1}{\theta}B x(t) with A,BA, B determined by Legendre recurrence. Discretization yields the update: ct=Adct−1+Bdxtc_t = A_d c_{t-1} + B_d x_t where

Ad=(I+Δt2θA)−1(I−Δt2θA),Bd=(I+Δt2θA)−1ΔtθBA_d = \left(I+\frac{\Delta t}{2\theta}A\right)^{-1}\left(I-\frac{\Delta t}{2\theta}A\right), \quad B_d = \left(I+\frac{\Delta t}{2\theta}A\right)^{-1} \frac{\Delta t}{\theta} B

Analytic forms for [t−θ,t][t-\theta, t]0 and [t−θ,t][t-\theta, t]1 are given by: [t−θ,t][t-\theta, t]2 At inference, an approximation of the original signal is reconstructible as: [t−θ,t][t-\theta, t]3

2. Frequency Improvement via Fourier-Based Denoising

While Legendre projection preserves all frequencies—including noise—FiLM introduces a Fourier-based denoising module (Frequency Enhanced Layer, FEL). For each feature channel, an FFT is computed along the Legendre-index axis: [t−θ,t][t-\theta, t]4 Only the lowest [t−θ,t][t-\theta, t]5 modes are retained, weighted by learnable parameters [t−θ,t][t-\theta, t]6: [t−θ,t][t-\theta, t]7 Higher modes ([t−θ,t][t-\theta, t]8) are zeroed, and inverse FFT reconstructs a denoised memory representation: [t−θ,t][t-\theta, t]9 This process robustly suppresses high-frequency noise while maintaining salient long-term components.

3. Low-Rank Parameterization for Efficiency

Naïvely, the learnable weights c(t)∈RNc(t) \in \mathbb{R}^N0 grow prohibitively large for high-dimensional problems. FiLM addresses this via tensor factorization: c(t)∈RNc(t) \in \mathbb{R}^N1 with c(t)∈RNc(t) \in \mathbb{R}^N2, c(t)∈RNc(t) \in \mathbb{R}^N3, c(t)∈RNc(t) \in \mathbb{R}^N4, and c(t)∈RNc(t) \in \mathbb{R}^N5 the low-rank. For each mode c(t)∈RNc(t) \in \mathbb{R}^N6: c(t)∈RNc(t) \in \mathbb{R}^N7 This reduces parameter count from c(t)∈RNc(t) \in \mathbb{R}^N8 to c(t)∈RNc(t) \in \mathbb{R}^N9. Empirically, cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-10 (0.41% of full size) yields negligible loss in MSE; even cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-11 provides strong compression with minor performance reduction.

4. Model Architecture and Training Protocols

4.1 Single-Layer Block

A one-layer FiLM block consists of:

  • Legendre Projection Unit (LPU): Produces Legendre coefficient sequence cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-12.
  • Frequency Enhanced Layer (FEL): Applies the Fourier mask described above, yielding denoised cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-13.
  • LPU_R: Reconstructs the forecast using the inverse Legendre-basis mapping.

4.2 Multiscale Mixture-of-Experts

FiLM processes histories at several time resolutions (e.g., cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-14), with each block forecasting separate future windows; outputs are combined via a learned gating mechanism, capturing information from both medium- and long-range dependencies.

4.3 Optional Pre/Post-Processing

Per-series Instance Normalization (RevIN) can be applied before and after FiLM to enhance robustness to distribution shift. Its use is dataset-dependent.

4.4 Default Hyperparameters

Component Default Value Notes
Legendre dim. cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-15 256 Number of polynomial bases
Fourier modes cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-16 32 Number of frequencies retained
Low-rank cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-17 4 Tradeoff param.
Scales 3 cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-18
Batch size 32–256 Task dependent
Optimizer Adam Learning rate schedule cn(t)=⟨x(s),Pn(2(s−t)θ+1)⟩,n=0,…,N−1c_n(t) = \langle x(s), P_n\left(\frac{2(s-t)}{\theta} + 1\right) \rangle, \quad n = 0, \dots, N-19 over 15 epochs

4.5 Training Objective

The model is trained using Mean Squared Error (MSE): PnP_n0 No curriculum schedules or special warm-up phases are used. MSE is the primary loss; Mean Absolute Error (MAE) is reported but not optimized.

5. Empirical Evaluation and Ablation Analysis

5.1 Comparative Benchmarks

Across six real-world datasets (Traffic, Electricity, Exchange, Weather, ILI, ETTm/ETTh) and a range of forecast horizons, FiLM demonstrates substantial error reductions relative to prior SOTA models:

Task MSE Reduction vs Best Prior
Multivariate 20.3% (vs FEDformer)
Univariate 22.6%

Seven competitive baselines are evaluated, including FEDformer, Autoformer, Informer, S4, LogTrans, and Reformer.

5.2 Module Drop-In and Substitution

  • Substituting the LPU for a linear layer degrades all architectures tested.
  • Augmenting existing MLP, LSTM, CNN, or Transformer networks with LPU and FEL offers consistent and large MSE improvements (8–120% relative gain).

5.3 Component Ablations

  • Replacing FEL by standard MLP, LSTM, CNN, or vanilla Attention yields 5–300% worse performance.
  • Reducing low-rank PnP_n1 from 256 to 4 compresses weights to 0.41% of baseline with <1% MSE increase; PnP_n2 achieves within 5% of full performance.
  • Limiting to lowest PnP_n3 Fourier modes is robust; some datasets benefit from including a small fraction of higher modes.

5.4 Efficiency

  • Parameter count: FiLM PnP_n4 uses 80% fewer trainable weights than FEDformer.
  • Memory usage and training time scale linearly in input length, outperforming deeper competitors by ca. 50% per epoch.

6. Integration with Existing Time Series Forecasters

FiLM's memory and denoising modules can be embedded into arbitrary forecasting architectures:

  1. Prepend LPU: Replace raw series PnP_n5 with Legendre state PnP_n6.
  2. Apply FEL: Perform the Fourier-based denoising as described.
  3. Decode: Use reconstructed features or pass PnP_n7 to the backbone forecaster.

Empirical evidence shows up to 120% MSE reduction as a plug-in to existing MLP, LSTM, CNN, and vanilla attention models, with negligible parameter overhead (ca. 0.5% of full model).

7. Significance and Implications

FiLM demonstrates that Legendre polynomial-based memory, augmented with frequency selection and low-rank adaptation, offers a principled and practical approach for long-term sequence modeling. It balances expressiveness and regularization, efficiently attenuates overfitting to noise, and is broadly applicable as a module across network architectures. FiLM's empirical performance on real-world datasets and its ablation support the centrality of structured memory and frequency-aware denoising in advancing time-series forecasting (Zhou et al., 2022).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

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 Frequency Improved Legendre Memory Model (FiLM).