# Fast Gradient-Based Approximation of Continuous Dynamic Time Warping

arXiv: https://arxiv.org/abs/2610.13129 · HTML: https://mlsanity.com/paper/2610.13129/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 11 of its 20 references that are in the map.
- First posted on arXiv 9 Oct 2026.

## Builds on (most cited first, 11 of 11)

- [The UCR Time Series Archive](https://mlsanity.com/paper/1810.07758/) (2018)
- [Soft-DTW: a Differentiable Loss Function for Time-Series](https://mlsanity.com/paper/1703.01541/) (2017)
- [Unconstrained Monotonic Neural Networks](https://mlsanity.com/paper/1908.05164/) (2019)
- [Constrained Monotonic Neural Networks](https://mlsanity.com/paper/2205.11775/) (2022)
- [Differentiable Divergences Between Time Series](https://mlsanity.com/paper/2010.08354/) (2020)
- [Time Series Continuous Modeling for Imputation and Forecasting with Implicit Neural Representations](https://mlsanity.com/paper/2306.05880/) (2023)
- [A General Optimization Framework for Dynamic Time Warping](https://mlsanity.com/paper/1905.12893/) (2019)
- [Computing Continuous Dynamic Time Warping of Time Series in Polynomial Time](https://mlsanity.com/paper/2203.04531/) (2022)
- [Match-And-Deform: Time Series Domain Adaptation through Optimal Transport and Temporal Alignment](https://mlsanity.com/paper/2308.12686/) (2023)
- [TimewarpVAE: Simultaneous Time-Warping and Representation Learning of Trajectories](https://mlsanity.com/paper/2310.16027/) (2023)
- [Approximating CDTW Distance of Piecewise Algebraic Curves](https://mlsanity.com/paper/2609.04294/) (2026)

## Abstract (arXiv)

Dynamic Time Warping (DTW) is a common choice for measuring the discrepancy between time series. It proceeds by finding an optimal warping between timestamps through dynamic programming, which can be slow and is not differentiable. Consequently, several variants have been proposed. Among them, Soft-DTW proposes a smooth formulation of DTW, amenable to gradient computation, while Continuous-DTW (CDTW) introduces a continuous formulation through parametrizable warping functions. Yet, computational costs remain high for both methods and impractical for large datasets in modern machine learning pipelines. This paper revisits CDTW in several ways. After establishing its differentiability under mild conditions, we introduce FastCDTW, which is an efficient approximate solver with two different computational strategies: an exact closed-form scheme for piecewise-linear warping functions, and an unbiased Monte Carlo estimator for smooth ones, such as implicit neural networks. Both strategies provide gradients with respect to the warping function and the input time series, and the resulting algorithm is GPU-friendly. We demonstrate its benefits through its integration into more complex learning problems, including time series averaging, classification and deep domain adaptation.
