Beyond Task-Specific Classifiers: In-Context Inference for Time Series Classification Foundation Models

Juntao Fang, Shifeng Xie, Shengbin Nie, Yuhui Ling, Yuming Liu, Zijian Li, Keli Zhang, Lujia Pan, Themis Palpanas, Ruichu CaiFMSD @ ICML 2026

TL;DR

TIC-FM introduces a training-free, in-context inference framework for time series classification, moving away from the traditional "frozen backbone + task-specific classifier" pipeline. By treating labeled examples as a prompt rather than optimization data, it achieves state-of-the-art accuracy on the UCR archive—particularly in low-label regimes—while eliminating the need for per-dataset hyperparameter tuning or classifier fitting at deployment.

What Problem Does This Paper Address?

The current standard for evaluating Time Series Foundation Models (TSFMs) is the "frozen-backbone" pipeline: you take a pretrained model, extract features, and then fit a task-specific classifier (like an SVM, Random Forest, or MLP) on top for every new dataset.

The authors argue this approach has three major flaws:

  1. Entanglement: It’s hard to tell if a model is good because of its representations or because you spent hours tuning the classifier on top.
  2. Instability: In "low-shot" scenarios (where you only have a few labeled examples), parametric classifiers like MLPs are prone to overfitting or failing entirely.
  3. Deployment Friction: In privacy-sensitive or latency-critical applications (like on-device medical monitoring), retraining a new classifier head for every task is often impractical or impossible.

The question they tackle is: Can we build a model that "understands" a new classification task simply by looking at a few examples in its input, without any parameter updates?

Methods

The authors propose TIC-FM (Time Series In-Context Classification Foundation Model). Its architecture consists of three main stages:

  • Time-Series Feature Encoder: A ViT-style Transformer that converts raw time series into instance-level embeddings. It uses a "patching" strategy that combines local temporal dynamics with statistical features (mean/std dev) to handle diverse data scales.
  • Projection Adapter: A lightweight MLP that aligns the encoder’s embeddings with the specific token space required by the in-context classifier.
  • In-Context Classifier: This is the "brain" of the system. It takes a sequence of labeled support tokens (the context) and unlabeled query tokens.
  • Latent Context Consolidation: It uses a Perceiver-style latent memory to summarize long contexts into a fixed number of "latent tokens," making the model efficient even with many support examples.
  • Split-Masked Reasoning: To prevent "label leakage," the model uses a specific attention mask. Context tokens only look at each other, while query tokens look at the context but not at other queries. This allows for safe, parallel prediction of multiple query labels in a single forward pass.

Training Strategy: The model is trained in stages. Interestingly, the feature encoder and the ICL module are pretrained primarily on synthetic data (using structural causal models and synthetic generators), proving that the model can learn the mechanics of classification without seeing real-world datasets first.

Datasets

  • UCR Time Series Archive: The primary benchmark, consisting of 128 diverse univariate datasets.
  • Synthetic Data: Used for pretraining. Specifically, they use Cauker (for contrastive representation learning) and data drawn from Structural Causal Models (SCMs) to teach the model how to perform in-context reasoning.

Key Insights and Ideas

  • Classifier Sensitivity is a Real Problem: The authors show that using the same backbone (like MOMENT) but switching from an SVM to an MLP can cause accuracy to swing from ~78% down to ~44%. This proves that the "standard" way of evaluating models is highly dependent on the choice of the "head."
  • ICL as an Optimizer: The paper provides a theoretical "proof sketch" showing that a Transformer using linear attention can mathematically emulate a single step of Gradient Descent. This provides a mechanistic justification for why "training-free" models can still "learn" from context.
  • Synthetic-to-Real Transfer: One of the most surprising findings is TIC-FM (Syn.). This version of the model uses zero real-world labels for training or calibration, yet it still outperforms many baselines that were fitted directly on UCR data. This suggests that "learning how to classify" is a meta-skill that can be learned synthetically.

Key Results

  • Superior Accuracy: On the full UCR archive, TIC-FM achieved an average accuracy of 80.01%, outperforming established baselines like Mantis + SVM (79.06%) and MOMENT + SVM (77.98%).
  • Low-Shot Champion: In extreme scenarios where only 10% of the data is labeled, TIC-FM's lead grows significantly, showing it is much more robust than traditional classifiers when data is scarce.
  • Efficiency: Because it avoids the "fitting" step, TIC-FM has lower end-to-end latency (ms/query) than classifier-fitting pipelines, despite having a more complex forward pass.
  • Monotonic Scaling: Unlike traditional classifiers which can be erratic with small data changes, TIC-FM shows a consistent, smooth improvement in accuracy as more labeled context is added.

Limitations and Future Work

  • Class Limit ($C_{max}$): The base model is designed for a maximum of 10 classes. While they implement a "hierarchical class-extension" strategy to handle more, this adds complexity to the inference process.
  • Memory Overhead: While faster in terms of time, TIC-FM requires more GPU memory than simple linear classifiers because it must process the entire context-query sequence in the Transformer's attention layers.
  • Theoretical Scope: The current theoretical proofs for in-context learning are largely limited to linear attention; extending this to the standard softmax attention used in the actual model remains an open research challenge.

Future work could involve scaling the context window even further and exploring how this paradigm handles multi-modal or multivariate time series in more complex industrial settings.

Summary updated

BibTeX
@inproceedings{fang2026beyond,
  author = {Juntao Fang and Shifeng Xie and Shengbin Nie and Yuhui Ling and Yuming Liu and Zijian Li and Keli Zhang and Lujia Pan and Themis Palpanas and Ruichu Cai},
  title = {{Beyond Task-Specific Classifiers: In-Context Inference for Time Series Classification Foundation Models}},
  booktitle = {FMSD @ ICML},
  year = {2026},
  url = {https://openreview.net/forum?id=HVvARHEA9M},
}
Figure