# Soft-MSM: Differentiable Context-Aware Elastic Alignment for Time Series

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

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 17 of its 42 references that are in the map.
- First posted on arXiv 30 Apr 2026.

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

- [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)
- [Should we really use post-hoc tests based on mean-ranks?](https://mlsanity.com/paper/1505.02288/) (2015)
- [Shape and Time Distortion Loss for Training Deep Time Series Forecasting Models](https://mlsanity.com/paper/1909.09020/) (2019)
- [aeon: a Python toolkit for learning from time series](https://mlsanity.com/paper/2406.14231/) (2024)
- [A review on distance based time series classification](https://mlsanity.com/paper/1806.04509/) (2018)
- [shapeDTW: shape Dynamic Time Warping](https://mlsanity.com/paper/1606.01601/) (2016)
- [An Approach to Multiple Comparison Benchmark Evaluations that is Stable Under Manipulation of the Comparate Set](https://mlsanity.com/paper/2305.11921/) (2023)
- [Differentiable Divergences Between Time Series](https://mlsanity.com/paper/2010.08354/) (2020)
- [A Review and Evaluation of Elastic Distance Functions for Time Series Clustering](https://mlsanity.com/paper/2205.15181/) (2022)
- [Nonsmooth Analysis and Subgradient Methods for Averaging in Dynamic Time Warping Spaces](https://mlsanity.com/paper/1701.06393/) (2017)
- [Elastic Similarity and Distance Measures for Multivariate Time Series](https://mlsanity.com/paper/2102.10231/) (2021)
- [Series2Vec: Similarity-based Self-supervised Representation Learning for Time Series Classification](https://mlsanity.com/paper/2312.03998/) (2023)
- [ShapeDBA: Generating Effective Time Series Prototypes using ShapeDTW Barycenter Averaging](https://mlsanity.com/paper/2309.16353/) (2023)
- [Proximity Forest 2.0: A new effective and scalable similarity-based classifier for time series](https://mlsanity.com/paper/2304.05800/) (2023)
- [On time series clustering with k-means](https://mlsanity.com/paper/2410.14269/) (2024)
- [Rock the KASBA: Blazingly Fast and Accurate Time Series Clustering](https://mlsanity.com/paper/2411.17838/) (2024)

## Abstract (arXiv)

Elastic distances like dynamic time warping (DTW) are central to time series machine learning because they compare sequences under local temporal misalignment. Soft-DTW is an adaptation of DTW that can be used as a gradient-based loss by replacing the hard minimum in its dynamic-programming recursion with a smooth relaxation. However, this approach does not directly extend to elastic distances whose transition costs depend on the local alignment context. Move-Split-Merge (MSM) is one such distance: it uses context-aware split and merge penalties and has often outperformed DTW in supervised and unsupervised time series machine learning tasks such as classification and clustering. We introduce Soft-MSM, a smooth relaxation of MSM and an elastic alignment loss with context-aware transition costs. Central to the formulation is a smooth gated surrogate for MSM's piecewise split/merge cost, which enables gradients through both the dynamic-programming recursion and the local transition structure. We derive the forward recursion, backward recursion, soft alignment matrix, closed-form gradient, limiting behaviour, and divergence-corrected formulation. Experiments on 112 UCR datasets show that Soft-MSM gives lower MSM barycentre loss than existing MSM barycentre methods, and yields significantly better clustering and nearest-centroid classification performance than Soft-DTW-based alternatives. An implementation is available in the open-source textttaeon toolkit.
