Source-linked AI summary
ButterMamba: Butterworth-Enhanced Spatial-Temporal Mamba for Efficient Traffic Flow Prediction
Limiao Zhang, Yuhui Lu, Jie Gao, Hao Jiang, Haiping Ma, Xingyi Zhang
TL;DR
Traffic forecasting faces quadratic attention costs and high-frequency sensor noise, limiting efficient and reliable prediction. ButterMamba combines Butterworth Spectral Filtering with a parallel Spatial-Temporal State Mixer built on Mamba, and experiments report superior accuracy with reduced training time and memory usage. The paper also identifies static graphs and fixed filtering frequencies as current scope boundaries.
Problem
Traffic forecasting must address quadratic attention complexity and high-frequency sensor noise, which challenge real-time deployment and prediction reliability.
Method
ButterMamba decouples Butterworth-based noise filtering from a parallel Mamba Spatial-Temporal State Mixer for modeling long-range temporal and spatial dependencies.
Results
Experiments on three public benchmarks report that ButterMamba significantly outperforms state-of-the-art baselines while reducing training time and memory usage.
Takeaways & Limitations
ButterMamba provides an accuracy-and-efficiency-oriented framework for traffic flow prediction by separating signal preprocessing from spatial-temporal dependency learning.
Takeaways & Limitations
The model currently relies on a static graph structure and a fixed filtering frequency.
Abstract
from arXiv · showhide
Accurate traffic flow prediction is fundamental to intelligent transportation systems, playing a pivotal role in urban mobility optimization and smart city development. While Graph Neural Networks (GNNs) integrated with time series forecasting have emerged as promising solutions, two critical limitations persist: (1) the quadratic complexity of attention-based architectures hinders real-time deployment in large-scale networks, and (2) high-frequency noise in sensor data significantly degrades prediction reliability. These challenges are particularly acute in metropolitan scenarios where both computational efficiency and noise robustness are paramount. To address these limitations, we introduce \textbf{ButterMamba}, a novel and efficient framework based on State Space Models (SSMs). ButterMamba consists of two key components: (1) a Butterworth Spectral Filtering module that preprocesses the data by removing high-frequency noise, allowing the model to focus on significant underlying trends, and (2) a Spatial-Temporal State Mixer that uses a parallel Mamba architecture to efficiently capture both long-range temporal dependencies and complex spatial correlations across the road network. By decoupling noise filtering from spatial-temporal modeling, ButterMamba achieves superior predictive accuracy with linear computational complexity. Extensive experiments on three public datasets demonstrate that ButterMamba not only outperforms existing state-of-the-art models in terms of prediction accuracy but also considerably reduces training time and memory usage.
1 Introduction
Traffic forecasting must balance accuracy with efficiency while handling substantial high-frequency sensor noise. ButterMamba addresses both challenges by combining Butterworth filtering with a linear-complexity spatial-temporal Mamba architecture.
- Self-attention captures long-range dependencies but has quadratic sequence-length complexity, creating an efficiency bottleneck for long-term forecasting and large networks.
- Traffic sensors show periodic patterns alongside location-dependent high-frequency fluctuations that can obscure trends needed for accurate forecasting.
- ButterMamba combines Butterworth Spectral Filtering for noise suppression with a Spatial-Temporal State Mixer for temporal and spatial dependency modeling.
- ButterMamba maintains linear computational complexity O(n) while achieving state-of-the-art forecasting accuracy on three public datasets.
- ButterMamba uses State Space Models and parallel Mamba processing to target efficient, robust traffic flow prediction.
2 Related Work
Traffic forecasting research progressed from statistical and recurrent models toward graph-based and Transformer architectures, while State Space Models offer an efficient alternative for long sequences. Mamba extends this paradigm with input-dependent selection and linear-time computation, motivating its use in spatial-temporal forecasting.
- Early traffic forecasting used CNNs and RNNs to extract spatial and temporal information, but CNNs poorly represent non-Euclidean graph structure.
- GCNs and Transformers were combined with temporal models to capture traffic-related spatial-temporal features, including dynamic spatial dependencies.
- High-complexity models make continual training with newly arriving urban traffic data increasingly costly.
- State Space Models provide a computationally efficient paradigm for long-sequence modeling through continuous linear time-invariant systems that can be discretized for deep learning.
- Mamba makes SSM parameters input-dependent, allowing selective focus on relevant information while retaining linear-time complexity with respect to sequence length.
- Recent ST-Mamba and STG-Mamba models apply SSM-based architectures to spatial-temporal traffic forecasting, with and without graph structures.
3 Preliminaries
The paper formulates traffic forecasting on a sensor graph and introduces State Space Models as recurrent or convolutional sequence operators. Discretization enables sequence-data use, while the dual representation supports parallel training and efficient autoregressive inference.
- 3.1 Road Network Definition: The road network is represented as a graph G = (V, E, A), with nodes as traffic sensors and a weighted adjacency matrix encoding sensor connections.
- 3.2 Problem Definition: At each time step, the traffic state is an N × C feature matrix, and forecasting maps historical graph traffic sequences to future sequences.
- 3.3 State Space Models: An SSM maps a one-dimensional input signal to an output through a latent state vector using continuous linear ordinary differential equations.
- 3.3 State Space Models: Discretization with a timescale parameter and Zero-Order Hold converts continuous SSM parameters for discrete sequence data.
- 3.3 State Space Models: The discrete SSM can be computed recurrently step-by-step or in parallel as a convolution using a structured kernel.
- 3.3 State Space Models: This recurrent-convolutional duality enables parallel training like a CNN and efficient autoregressive inference like an RNN.
4 Methodology
ButterMamba processes traffic data through spectral filtering, contextual embedding, a parallel spatial-temporal mixer, and a final output layer. Its Butterworth filter reduces high-frequency noise, while separate Mamba pathways model temporal and spatial dependencies.
- The framework sequentially applies spectral filtering, contextual embedding, spatial-temporal mixing, and final output projection.This defines the overall data flow through ButterMamba.
- 4.1 Butterworth Spectral Filtering (BSF): The Butterworth Spectral Filtering module acts as a low-pass filter that preserves low-frequency trends while attenuating high-frequency noise.The Butterworth design provides a maximally flat passband response with minimal amplitude distortion.
- 4.1 Butterworth Spectral Filtering (BSF): A second-order IIR filter is applied independently to each node’s time series, balancing frequency cutoff, computational efficiency, and stability.Higher-order filters may sharpen the cutoff but increase complexity and potential instability.
- 4.1 Butterworth Spectral Filtering (BSF): The filtered output Xfiltered is a denoised feature tensor that provides a cleaner, more stable input for subsequent model layers.The filter coefficients depend on the normalized cutoff frequency relative to the Nyquist frequency.
- 4.2 Feature Embedding and Fusion: Temporal and spatial embeddings are concatenated with Xfiltered and projected through a linear layer to create Xemb.Temporal embeddings encode time of day and day of week, while spatial embeddings use Laplacian Eigenmaps; the implementation sets k = 3.
- 4.3 Spatial-Temporal State Mixer (STSM): The STSM uses two independent parallel Mamba blocks, concatenating distinct temporal and spatial representations into Xhid.Temporal Mamba uses Xemb, whereas Spatial Mamba uses denoised non-embedded traffic values; their state dimensions are 128D and 16D, respectively.
- 4.4 Output Layer: A final linear projection maps Xhid to the multi-step forecast tensor ˆX ∈ R^N×C×L.N denotes sensors, C traffic features, and L the prediction horizon.
5 Experiments
The experiments evaluate ButterMamba on three public traffic datasets using standardized preprocessing, implementation settings, and accuracy metrics. Comparisons include classical, recurrent, convolutional, graph, transformer, and Mamba-based baselines.
- Experiments use the PeMS04, PeMS07, and PeMS08 public real-world traffic datasets.PeMS denotes the Caltrans Performance Measure System.
- The comparison includes 22 baselines spanning ARIMA, VAR, SVR, LSTM, TCN, Transformer, graph, transformer, and Mamba-based methods.The listed baselines include DCRNN, STGCN, GWNet, PDFormer, STAEformer, ST-Mamba, and STG-Mamba.
- Each dataset is split into training, validation, and test sets with a 6:2:2 ratio, and filtering is performed separately on each subset to prevent leakage.The forecasting task uses one hour of historical data, represented by 12 five-minute time steps.
- Evaluation reports Mean Absolute Error, Mean Absolute Percentage Error, and Root Mean Squared Error across compared methods.These metrics quantify prediction accuracy for traffic flow forecasting.
5.4 Performance Comparison
ButterMamba outperforms statistical, graph-convolutional, Transformer-based, and recent Mamba-based baselines across the evaluated traffic datasets and metrics. Its results include lower MAE than representative competing models and improvements across all three reported metrics on PeMSD4.
- ButterMamba consistently outperforms traditional statistical and early deep learning baselines, including ARIMA, VAR, LSTM, and TCN.
- ButterMamba achieves an MAE of 17.94 on PEMS07, compared with 26.85 for GWNet.
- The STSM module uses sequential node scanning via Mamba to capture spatial correlations more effectively than standard graph convolution or diffusion operations.
- On PEMS04, ButterMamba reduces MAE by 8.7% versus PDFormer and 7.1% versus DTRformer.
- On PeMSD4, ButterMamba records 16.71 MAE, 26.72 RMSE, and 11.21 MAPE, outperforming STG-Mamba and ST-Mamba on all three metrics.
5.5 Efficiency Study
ButterMamba has substantially lower training time and GPU memory usage than the compared Transformer, graph-based, and Mamba-based models under consistent experimental settings. Its efficiency advantage remains when accounting for total training time rather than epoch count.
- ButterMamba trains in approximately 1.3 seconds per epoch, over 60 times faster than PDFormer, 50 times faster than DSTAGNN, and 8 times faster than AGCRN.
- ButterMamba uses 1260 MB of peak GPU memory, nearly 80% less than PDFormer’s 6286 MB.
- Compared with STG-Mamba, ButterMamba uses half the GPU memory and approximately one-quarter of the training time per epoch.
- Despite using 250 versus 200 epochs, ButterMamba’s total training time is 325s versus 1,020s and its GPU memory consumption is 54% lower than STG-Mamba’s.
5.6 Ablation Study
The ablation study on PeMS04 finds that Butterworth filtering and spatial modeling are central to performance, while the temporal component contributes complementary information. The full model performs best among the tested variants.
- Removing the BSF module causes severe degradation across all metrics, supporting the role of high-frequency-noise filtering.
- Removing spatial modeling produces the worst performance, whereas removing the temporal block causes only a minor increase in MAE.
- Concurrent traffic conditions across the network provide more predictive power than a node’s isolated history for predicting its future state.
- Both STSM components benefit prediction, with the spatial component dominant and the temporal Mamba block providing complementary information.
- The full ButterMamba model outperforms the ablated variants, indicating that combining both STSM modules yields the best observed performance.
5.7 Parameter Sensitivity Study
The cutoff frequency balances noise suppression against retention of informative traffic signals, with best performance at 14 Hz and stable results across 10–18 Hz.
- The study normalizes cutoff frequency using a nominal 500 Hz sampling frequency because the traffic data lacks a physically defined sampling rate.This normalization simulates different filtering strengths.
- At 14 Hz, ButterMamba achieves an MAE of 16.54, RMSE of 26.55, and MAPE of 11.25%.These are the best reported values in the cutoff-frequency sensitivity study.
- Prediction errors first decrease and then increase as the cutoff frequency varies from 5 to 22 Hz.
- Across 10–18 Hz, all metrics fluctuate by less than 0.3, indicating robustness to reasonable cutoff choices.
5.8 Case Study
The case study compares ButterMamba predictions with ground truth across nodes exhibiting volatile, abrupt, and periodic traffic patterns, showing trend capture without overfitting noise.
- The visualization covers three representative nodes with different traffic patterns and compares predictions against ground truth.
- For highly volatile Node #99, ButterMamba captures the primary diurnal trend without overfitting high-frequency fluctuations.
- Node #200’s smooth periodic signal is closely tracked throughout the morning peak and evening trough.
- These observations indicate that ButterMamba prioritizes macroscopic regularities over microscopic perturbations in traffic signals dominated by periodicity and trends.
6 Conclusion
ButterMamba combines Butterworth denoising with a parallel Mamba-based spatial-temporal mixer to address computational cost and sensor noise. Experiments report improved accuracy alongside lower training time and memory usage, while the current model remains limited by static graphs and fixed filtering.
- ButterMamba integrates Butterworth Spectral Filtering for denoising with a parallel Spatial-Temporal State Mixer based on Mamba.
- Experiments on three public benchmarks report that ButterMamba outperforms state-of-the-art baselines while reducing training time and memory usage.
- The model’s current limitations are its reliance on a static graph structure and a fixed filtering frequency.
- Future directions include dynamic graph learning and adaptive filtering to broaden robustness and applicability.