# Forecasting the Past: Gradient-Based Distribution Shift Detection in Trajectory Prediction

Source: [Forecasting the Past: Gradient-Based Distribution Shift Detection in Trajectory Prediction](<https://www.sota2.com/research/paper/69df1b797d0172140ec7b82c>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-04-16T05:00:04.684Z

Authors: Michele De Vita, Julian Wiederer, Vasileios Belagiannis

Published: 2026-04-14T08:15:45.000Z

## Abstract

Trajectory prediction models often fail in real-world automated driving due to distributional shifts between training and test conditions. Such distributional shifts, whether behavioural or environmental, pose a critical risk by causing the model to make incorrect forecasts in unfamiliar situations. We propose a self-supervised method that trains a decoder in a post-hoc fashion on the self-supervised task of forecasting the second half of observed trajectories from the first half. The L2 norm of the gradient of this forecasting loss with respect to the decoder's final layer defines a score to identify distribution shifts. Our approach, first, does not affect the trajectory prediction model, ensuring no interference with original prediction performance and second, demonstrates substantial improvements on distribution shift detection for trajectory prediction on the Shifts and Argoverse datasets. Moreover, we show that this method can also be used to early detect collisions of a deep Q-Network motion planner in the Highway simulator. Source code is available at https://github.com/Michedev/forecasting-the-past.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Distribution Shift Detection on Shifts](<https://www.sota2.com/research/sota/distribution-shift-detection-on-shifts.md>): Distribution Shift Detection; Shifts; AUROC: 71.

- [Behavioral Anomaly Detection on Argoverse Turn right](<https://www.sota2.com/research/sota/behavioral-anomaly-detection-on-argoverse-turn-right.md>): Behavioral Anomaly Detection; Argoverse Turn right; AUROC: 71.3.

- [Behavioral Anomaly Detection on Argoverse Turn left](<https://www.sota2.com/research/sota/behavioral-anomaly-detection-on-argoverse-turn-left.md>): Behavioral Anomaly Detection; Argoverse Turn left; AUROC: 70.3.

- [Behavioral Anomaly Detection on Argoverse Max Velocity](<https://www.sota2.com/research/sota/behavioral-anomaly-detection-on-argoverse-max-velocity.md>): Behavioral Anomaly Detection; Argoverse Max Velocity; AUROC: 79.2.

- [Distribution Shift Detection on Highway Intersection (test)](<https://www.sota2.com/research/sota/distribution-shift-detection-on-highway-intersection-test.md>): Distribution Shift Detection; Highway Intersection (test); AUROC: 96.1.

- [Distribution Shift Detection on Highway Roundabout (test)](<https://www.sota2.com/research/sota/distribution-shift-detection-on-highway-roundabout-test.md>): Distribution Shift Detection; Highway Roundabout (test); AUROC: 95.8.

- [Distribution Shift Detection on Highway Merge (test)](<https://www.sota2.com/research/sota/distribution-shift-detection-on-highway-merge-test.md>): Distribution Shift Detection; Highway Merge (test); AUROC: 99.9.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2604.12425>)

[PDF](<https://arxiv.org/pdf/2604.12425.pdf>)
