SpecFlow: Flow Matching in the Acceleration Spectrum for Multi-Agent Trajectory Forecasting

Ziyang Xu, Peng Han, Hai ZhouarXiv 2026

Predicting where a group of people—or a team of basketball players—will move next is a balancing act. You need to capture the "multimodality" of human intent (will they turn left or right?) without producing "jittery" paths that defy the laws of physics. Most current models try to predict future positions frame-by-frame, often leaving the underlying relationship between position, velocity, and acceleration to be learned implicitly.

A new paper, SpecFlow, proposes a shift in perspective: instead of predicting positions, why not model the acceleration spectrum?

TL;DR

SpecFlow is a multi-agent trajectory forecasting framework that uses conditional flow matching to generate coefficients of the Discrete Cosine Transform (DCT) for future accelerations. By reconstructing velocity and position through fixed analytical integration, it ensures dynamical coherence and achieves state-of-the-art results on major pedestrian and sports benchmarks.

What Problem Does This Paper Address?

Traditional generative forecasters typically evolve frame-wise positions directly. This approach has a few drawbacks:

  1. Kinematic Inconsistency: Relationships between position, velocity, and acceleration are often implicit, leading to trajectories that might look plausible frame-to-frame but are physically unrealistic over time.
  2. Error Accumulation: Small errors in position prediction can compound, leading to significant "drift" in long-term forecasts.
  3. Destination Uncertainty: Without knowing the intended endpoint, models struggle to choose between diverse but plausible future paths.

SpecFlow tackles these by moving the generative process into a structured "phase-space" where physics is baked into the architecture.

Methods

The core innovation of SpecFlow is treating the DCT coefficients of future accelerations as the generative state.

Figure 1: SpecFlow generates acceleration spectra and re- constructs future trajectories.

1. The Acceleration Spectrum

The model uses a Discrete Cosine Transform (DCT-II) to represent acceleration. By retaining only the first $K$ coefficients, the model naturally focuses on low-frequency components, which correspond to smooth, intentional motion, while filtering out high-frequency noise.

2. Conditional Flow Matching (CFM)

SpecFlow learns a continuous transport from simple Gaussian noise to the distribution of these acceleration coefficients. Unlike diffusion models that require many iterative steps, flow matching regresses a continuous probability path, allowing for efficient sampling via ODE integration.

3. Fixed Kinematic Reconstruction

This is the "physics" part. Once the model generates an acceleration sample, it uses fixed, non-learnable cumulative-sum operators (double integration) to recover velocity and position. This ensures that the predicted position is mathematically consistent with the predicted acceleration and the last observed state.

4. Endpoint Conditioning & Alternating Attention

To handle destination uncertainty, an Endpoint Predictor generates candidate goals from the observed context. The best candidate then conditions the spectral denoiser. To capture interactions between multiple agents, the model uses a backbone that alternates attention between different trajectory hypotheses and the agents themselves.

Figure 2: Observed trajectories and Gaussian noise enter the endpoint predictor and acceleration-spectrum flow model. Fixed reconstruction maps M joint acceleration hypotheses to future trajectories. Ground-truth futures select the endpoint condition and spectral target only during training.

Datasets

The authors evaluated SpecFlow on three diverse benchmarks:

  • ETH/UCY: The standard for pedestrian trajectory forecasting in various social settings.
  • NBA SportVU: High-dynamic, coordinated multi-agent motion involving 10 players and a ball.
  • Stanford Drone Dataset (SDD): Heterogeneous outdoor trajectories (pedestrians, bikers, cars) captured from an aerial view.

Key Insights and Ideas

  • Higher-Order Supervision Wins: The authors found that supervising the model at the highest kinematic order (acceleration) and integrating down is more effective than predicting positions and differentiating up.
  • Spectral Truncation as Regularization: By limiting the number of DCT coefficients, the model is forced to learn "smooth" trajectories. The authors found a "U-shaped" pattern where using too few coefficients misses important turns, but using too many introduces high-frequency noise that hurts accuracy.
  • Joint Phase-Space Objective: Training with a loss that combines position, velocity, and acceleration errors (Equation 11 in the paper) is crucial. Velocity provides a constraint on local displacement, while acceleration penalizes abrupt changes in that displacement.

Key Results

SpecFlow established new state-of-the-art (SOTA) performance across several metrics:

  • ETH/UCY: Achieved an average minADE/minFDE of 0.15/0.22, significantly outperforming the previous best of 0.19/0.31. It ranked first in every single scene of the benchmark.
  • NBA: At the 4-second horizon, it reached a 0.69 ADE, the lowest reported for this dataset, while tying for the best FDE (0.86).
  • Efficiency: The model is surprisingly robust to sampling speed. Reducing the ODE solver from 100 steps to just 20 steps preserved accuracy to two decimal places while cutting latency by nearly 80% (down to ~3.68ms per scene on NBA).
Figure 4: Observed trajectories for ten players and the ball are input to SpecFlow. The model outputs a joint forecast. Ground-truth futures are shown for comparison.

Limitations and Future Work

While SpecFlow is a powerful motion-only forecaster, it has some clear boundaries:

  • Lack of Visual Context: The model does not currently incorporate scene imagery (e.g., maps of sidewalks, walls, or curbs). This explains why its lead on the Stanford Drone Dataset (SDD) was smaller than on ETH/UCY; in complex outdoor environments, "where you can walk" is as important as "how you are moving."
  • Probability Calibration: The current evaluation focuses on "best-of-20" metrics, which measure coverage but don't necessarily reflect how well the model's predicted probabilities match real-world frequencies.

The authors suggest that extending this structured generative state with scene-aware conditioning is the natural next step for the field.

Summary updated

Abstract

Multimodal trajectory forecasting must cover diverse future behaviors without sacrificing dynamical coherence. Most generative forecasters evolve frame-wise positions directly, leaving the relationships among position, velocity, and acceleration implicit. We present SpecFlow, a conditional flow-matching framework that treats the Discrete Cosine Transform (DCT) coefficients of future accelerations as its generative state. SpecFlow learns a transport from Gaussian noise to acceleration spectra and reconstructs velocity and position through fixed analytical integration initialized by the last observed state. A joint phase-space objective supervises all three kinematic levels. To represent destination uncertainty without future information, an endpoint predictor produces candidate destinations and confidence scores solely from observed context, and the highest-confidence candidate conditions the spectral denoiser. Alternating attention over trajectory hypotheses and agents captures multimodality and interaction. Under best-of-20 evaluation, SpecFlow achieves average minADE/minFDE of 0.15/0.22 on ETH/UCY, 0.69/0.86 at four seconds on NBA, and 7.38/11.57 on SDD. It establishes state-of-the-art results across all five ETH/UCY scenes and achieves the lowest four-second ADE on NBA with a tied-best FDE, while remaining competitive on SDD. Together, these results demonstrate that acceleration-spectrum flow matching provides an effective structured generative state across smooth pedestrian motion, coordinated multi-agent sports dynamics, and heterogeneous outdoor trajectories. Code will be made publicly available.
BibTeX
@misc{xu2026specflow,
  author = {Ziyang Xu and Peng Han and Hai Zhou},
  title = {{SpecFlow: Flow Matching in the Acceleration Spectrum for Multi-Agent Trajectory Forecasting}},
  year = {2026},
  eprint = {2611.26390},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.26390},
}
Figure