TL;DR
When you adapt a Time Series Foundation Model (TSFM) for a specific classification task, standard fine-tuning throws away the original pretraining data and relies entirely on fuzzy memories compressed into the model's weights. This paper introduces Retrieval-to-Recognition (R2R), essentially an "open-book exam" protocol for time series classification. By plugging in a lightweight query encoder to fetch explicit, similar numerical patterns from the pretraining corpus during fine-tuning, R2R helps existing foundation models recall what they learned—boosting classification accuracy across 158 datasets without pretraining a single new model from scratch.
What Problem Does This Paper Address?
Foundation models are taking over time series analysis. To build one for Time Series Classification (TSC)—telling a healthy heartbeat from an arrhythmic one, or a normal factory vibration from a failing bearing—researchers pretrain massive neural networks on millions of multi-domain sequences.
Once pretrained, how do we adapt these models to a specific downstream task? Right now, the standard playbook is supervised parameter fine-tuning. We discard the massive pretraining dataset and tweak the model's weights on our small target dataset.
The problem is that a foundation model’s parameter space is a noisy, tangled web. Useful, task-relevant shapes are compressed alongside millions of irrelevant variations. Simply scaling up model parameters hasn't consistently improved classification accuracy, and while Retrieval-Augmented Generation (RAG) has become standard in text and time series forecasting (predicting future trends), classification requires something totally different: spotting subtle, discriminative shapes inside fixed windows, often buried in noise. Can we give fine-tuning direct access to explicit, data-level examples from the pretraining set without drowning in millions of raw sequences?
Methods
Instead of building a new foundation model, the authors propose R2R, a plug-and-play post-training framework that bolts onto existing TSFMs. It consists of three stages:
- Knowledge Extraction (What's new): Rather than training a heavy neural encoder to search the database, R2R uses a fast, gradient-free backbone (like frozen random convolutional kernels from MiniRocket) paired with lightweight feature engineering. For any time series, it extracts three perspectives without backpropagating through the extractor:
- Local patterns: Raw backbone features plus an amplitude "envelope" to catch energy spikes.
- Global patterns: Multi-scale strided downsampling (widening the receptive field) gated by the density of "turning points" (sign changes) so fine transitions aren't lost.
-
Positional patterns: Where the peak amplitude actually occurs in time—crucial when identical shapes mean different things depending on when they happen. These features pass through a tiny, trainable linear projection layer to create compact embeddings.
-
Knowledge Retrieval: Using a GPU-accelerated Faiss index (IVFPQ), R2R finds the Top-$K$ nearest neighbors from the pretraining knowledge base in milliseconds. Instead of simple averaging, it uses Optimal Transport (OT) distances to weight the retrieved neighbors, combining the weighted sum and the residual difference from the query into an augmented embedding.
- Knowledge Enhancement: Finally, a gated residual fusion layer blends three signals: the TSFM’s standard parametric class token, the query embedding, and the retrieved numerical embedding. During fine-tuning, gradients flow through the TSFM and the lightweight projection/fusion layers simultaneously.
Datasets
R2R introduces no new raw datasets, instead curating existing benchmarks:
- Knowledge Base: Constructed from the multi-domain pretraining corpora of NuTime, Mantis, and UniShape (1.89 million samples total). From this pool, the authors extract a class-balanced subset of 100,000 univariate samples to act as the retrieval database.
- Supervised Evaluation: 128 univariate datasets from the standard UCR Time Series Classification Archive.
- Zero-Shot Evaluation: 30 additional univariate datasets used to test frozen feature representations with a Random Forest classifier.
- Preliminary Multivariate Test: 10 datasets from the UEA multivariate archive (via a linear channel adapter).
Key Insights and Ideas
- Forecasting RAG fails at classification: When the authors tested TS-RAG (a retrieval method designed for forecasting) using the exact same 100K knowledge base, it underperformed standalone classification TSFMs. Forecasting looks for trend continuations; classification needs local, global, and positional shape matching.
- Retrieval beats stochastic data augmentation: Standard time series augmentations (jittering, warping, slicing) actually degraded performance compared to raw fine-tuning across 18 test datasets, likely because random distortions warp delicate class-defining shapes. Retrieving real, class-relevant patterns from a knowledge base acts like "smart, non-destructive augmentation."
- An unexpected cure for catastrophic forgetting: When models were continually fine-tuned from Dataset A to Dataset B, standard parameter-only fine-tuning suffered massive accuracy drops on Dataset A (losing up to 63% accuracy). R2R cut forgetting substantially (e.g., reducing the accuracy drop from 47.7% to 18.3% on one pair), because external retrieved features anchor the model's representations.
- More data isn't always better—balance is: Scaling the retrieval database from 100K to the full 1.89M samples increased retrieval overhead 4.5$\times$ (from ~92s to ~415s per dataset) while slightly hurting average rank. A smaller, class-balanced 100K pool hit the sweet spot.
Key Results
Across 21 total methods on the 128 UCR datasets (fully supervised), plugging R2R into three state-of-the-art TSFMs (NuTime, Mantis, and UniShape) improved every single one:
- $\text{R2R}_{\text{UniShape}}$ took first place overall, improving UniShape’s average rank from 4.47 to 3.01 and winning outright on 48 datasets (up from 31), with statistically significant gains over all baselines ($p < 0.05$).
- Similarly, Mantis improved in rank from 8.07 to 6.18, and NuTime jumped from 10.26 to 7.90.
In the zero-shot feature extraction setting (no TSFM weight updates, just feeding frozen embeddings to a Random Forest across 30 datasets), R2R dominated 11 baselines with an average rank of 1.73 and 21 wins (compared to second-place TS-RAG at 3.97 rank and 5 wins). Ablations confirmed that neither the Rocket-based query encoder nor the TSFM alone drives this; magic happens only when parameter transfer and feature retrieval are fused.
Limitations and Future Work
- Post-training only: R2R does not improve how foundation models are pretrained or propose new backbone architectures; it strictly optimizes downstream adaptation.
- Univariate bottleneck: The current retrieval pipeline and knowledge base are built strictly from single-variable (univariate) time series. While the authors hacked together a promising multivariate test on 10 UEA datasets using a trainable linear adapter at the input, the retrieved patterns themselves don't capture cross-channel relationships.
- Future directions: Building natively multivariate knowledge bases and retrieval mechanisms so that complex dependencies between sensors or variables are captured directly during search.
Summary updated