Decoding Time Series with LLMs: A Multi-Agent Framework for Cross-Domain Annotation

Minhua Lin, Zhengzhang Chen, Yanchi Liu, Xujiang Zhao, Zongyu Wu, Junxiang Wang, Xiang Zhang, Suhang Wang, Haifeng Chen

TL;DR

The paper introduces TESSA, a novel multi-agent framework that leverages Large Language Models (LLMs) to automatically annotate complex time series data across different domains. By separating general pattern recognition from domain-specific jargon extraction, TESSA generates highly accurate, context-aware annotations that significantly improve performance on downstream tasks like forecasting and data imputation.

What Problem Does This Paper Address?

Time series data is ubiquitous in fields like finance, healthcare, and manufacturing, yet interpreting its complex, multivariate patterns typically requires deep domain expertise. While high-quality text annotations can help general users understand this data and boost the performance of machine learning models, creating them manually is expensive, time-consuming, and prone to inconsistency.

Directly applying LLMs to generate these annotations falls short: they often produce generic descriptions, miss subtle temporal patterns, or hallucinate. Furthermore, transferring annotation knowledge across domains is incredibly difficult because specialized terminology (jargon) varies wildly—for instance, a pattern called an "arrhythmia" in healthcare might share geometric similarities with a "resistance level" in stock market data, but a standard LLM cannot easily bridge that gap.

Figure 1: How to annotate time series across different domains?

Methods

TESSA tackles cross-domain annotation using a multi-agent architecture consisting of two primary components:

  1. General Annotation Agent: This agent extracts core, domain-independent temporal patterns.
  2. Domain Decontextualization: It takes abundant annotations from source domains and strips away specific jargon using an LLM, translating them into common language (e.g., converting "arrhythmia" to "cyclic patterns with irregular spikes").
  3. Multi-Modal Feature Extraction: It extracts both statistical time-series features (via methods like STL decomposition and Fast Fourier Transforms) and text-wise features from the decontextualized text.
  4. Adaptive Feature Selection: To prevent LLM information overload and minimize API costs, TESSA uses a hybrid feature selection method. For dynamic data, it employs an incremental Reinforcement Learning (RL) framework (built on top of a lightweight, partially frozen GPT-2 model) to select the top-$k$ most important features without needing to re-query old data.
  5. General Annotator: An LLM synthesizes these top features into a clear, domain-independent description.
  6. Domain-Specific Annotation Agent: This agent refines the general annotation for the target domain using limited target-domain examples.
  7. Domain-Specific Term Extractor: It learns specialized jargon from a small pool of target annotations.
  8. Domain-Specific Annotator & Reviewer: It injects this jargon back into the general annotation. A critic LLM (the Reviewer) provides a feedback loop to ensure the final text aligns perfectly with both the raw data and domain expectations.
Figure 2: Overall framework of TESSA. It consists of two main agents: a general annotation agent, which generates domain-independent annotations by selecting salient time-series and textual features, and a domain- specific annotation agent, which refines these annotations by incorporating domain-specific terminology.

Datasets

The authors evaluated TESSA across seven distinct domains:

  • Real-World Datasets: Stock (a custom-collected dataset of 1,935 US stocks spanning 6 years) and Health served as source domains. Energy, Environment, Social Good, Climate, and Economy (sourced from the public Time-MMD benchmark) served as target domains.
  • Synthetic Dataset: A custom dataset of 100 time series explicitly generated by mixing trends, seasonality (sine waves), Fourier features, rolling windows, lag features, and Gaussian noise, complete with mathematically precise ground-truth annotations.

Key Insights and Ideas

  • Jargon is a Barrier to Transfer Learning: Raw domain-specific text hinders an LLM's ability to find cross-domain commonalities. "Decontextualizing" the text into geometric and structural descriptions is the secret to successful cross-domain knowledge transfer.
  • Less is More for LLM Prompts: Flooding an LLM with every single extracted statistical feature degrades annotation clarity. Curating a concise "top-$k$" list of features via adaptive selection yields significantly better text.
  • RL Saves Compute in Evolving Environments: Rather than re-running expensive LLM queries across an entire historical dataset when new data arrives, training a lightweight RL policy network to select features incrementally provides a highly scalable, cost-effective alternative.

Key Results

TESSA was evaluated by feeding its generated annotations into multimodal downstream models for time series forecasting and imputation, as well as via "LLM-as-a-judge" and human evaluations.

  • Downstream Task Performance: In time series forecasting, using TESSA annotations dramatically reduced Mean Squared Error (MSE) compared to using no text or direct LLM generation. For example, in the Environment domain, TESSA achieved an MSE of 0.4629, outperforming the DirectLLM baseline (0.7714) and the No-Text baseline (1.2542).
  • Annotation Quality: When evaluated by GPT-4o on Clarity, Comprehensiveness, and Domain Relevance, TESSA consistently outperformed DirectLLM, achieving an overall score of 4.64/5.0 vs. DirectLLM's 3.41/5.0 on the Environment dataset.
  • Human Validation: In a blind study, 20 researchers and professors overwhelmingly favored TESSA, rating 88.3% of its general annotations and 93.3% of its domain-specific annotations as more informative and useful than the baselines.

Limitations and Future Work

While TESSA minimizes the need for massive target datasets, it still fundamentally relies on having some initial target-domain annotations to extract relevant jargon. If a target domain is entirely unannotated, the domain-specific agent cannot function effectively. Additionally, the framework's performance is bounded by the quality of the source domain annotations; low-quality or noisy source texts can degrade the decontextualization process.

Future work could explore completely unsupervised jargon extraction or zero-shot domain adaptation techniques to eliminate the target-annotation bottleneck entirely.

Summary updated

BibTeX
@misc{lin2024decoding,
  author = {Minhua Lin and Zhengzhang Chen and Yanchi Liu and Xujiang Zhao and Zongyu Wu and Junxiang Wang and Xiang Zhang and Suhang Wang and Haifeng Chen},
  title = {{Decoding Time Series with LLMs: A Multi-Agent Framework for Cross-Domain Annotation}},
  year = {2024},
  eprint = {2410.17462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.17462},
}
Figure