TL;DR
Large language models (LLMs) notoriously struggle to reason over continuous time series data, often hallucinating or relying on memorized trivia rather than real numerical computation. TS-Agent solves this by letting a lightweight LLM act purely as a reasoning coordinator that queries dedicated analytical tools via an iterative ReAct loop, guarded by a step-wise critic and a verification quality gate. By keeping raw numeric series in their native format, TS-Agent beats proprietary multimodal LLMs on complex multi-series reasoning benchmarks while delivering fully auditable evidence traces.
What Problem Does This Paper Address?
While LLMs excel at step-by-step reasoning in natural language and code, their ability to reason over sequential time series remains brittle. Prior attempts generally force time series into text tokens, line-plot images, or learned multimodal embeddings. These approaches suffer from severe drawbacks:
- Tokenizing continuous values leads to loss of precision and numerical calculation errors.
- Vision-language models lack the granularity needed for subtle statistical shifts.
- Standard LLMs frequently suffer from knowledge leakage—answering questions correctly from pretraining memory alone without actually inspecting the data—or hallucinating unsupported inferences over long reasoning chains.
The authors also highlight a crucial distinction between time series understanding (extracting a direct feature like trend, seasonality, or an anomaly) and time series reasoning (synthesizing multiple underlying dynamics, such as evaluating causality between two distinct signals to make an operational decision).
Methods
Rather than teaching LLMs to "perceive" raw numbers, TS-Agent adopts a reason-with-tools paradigm using gpt-4o-mini as its reasoning backbone:
[ Natural Language Query + Time Series Data ]
│
▼
┌───────────────────┐
┌───►│ Iterative LLM │◄─── (Critic Feedback)
│ │ Reasoner │
│ └─────────┬─────────┘
│ │ (Selects Tool & Args)
│ ▼
│ ┌───────────────────┐
│ │ Analytical Tools │ (Segment, Anomaly,
│ │ & Custom Synthesis│ Stats, DTW, Granger)
│ └─────────┬─────────┘
│ │ (Observation)
│ ▼
│ ┌───────────────────┐
└────│ Evidence Log │
└─────────┬─────────┘
│
▼
┌───────────────────┐
│ Step-wise Critic │ ── (Backtracks / Refines)
└─────────┬─────────┘
▼
┌───────────────────┐
│ Final Quality Gate│ ── Reject / Loop back
└─────────┬─────────┘
│ Accept
▼
[ Final Answer ]
- Iterative LLM Reasoner: Operates via a ReAct (Thought-Action-Observation) loop. It adaptively decides the next analytical step based on the evolving context and an explicit Evidence Log ($L_k$).
- Modular Tool Library: An array of typed, domain-specific Python functions covering:
- Data Processing: Slicing, segmenting, and temporal resampling.
- Detection & Classification: Detecting trends, anomalies, regimes, and seasonality.
- Numerical Operations: Quantiles, autocorrelation, rolling statistics, and volatility.
- Cross-Series Relations: Dynamic Time Warping (DTW), Pearson/Spearman correlation, and Granger causality.
- Custom Operator Synthesis: Dynamically writing bespoke operators on the fly when built-in tools fall short.
- Step-wise Critic: Reviews every action against extracted question intents, flagging execution errors, implausible values, or inappropriate tool selection (e.g., catching when an isolated anomaly detector is mistakenly used to find multi-week cloud coverage).
- Final Quality Gate ($\Gamma$): Maps the question into required semantic predicates. It rejects proposed answers unless all required predicates are mathematically verified in the evidence log, virtually eliminating ungrounded hallucinations.
Datasets
The authors evaluated TS-Agent on three established benchmarks:
- TimeSeriesExam: 763 multiple-choice questions assessing pattern recognition, noise understanding, anomaly detection, similarity, and Granger causality.
- Time Series Feature Understanding Benchmark: 200 MCQs per task covering univariate properties (trend, seasonality, structural breaks) and multivariate relationships (fixed, lagged, and changing correlations).
- Time Series Reasoning Benchmark (Merrill et al., 2024): Tests zero-shot multi-step reasoning, including etiological explanation, single-series question answering, and comparative multi-series reasoning.
Key Insights and Ideas
- Decouple Thinking from Perception: LLMs are superior high-level coordinators but mediocre numerical calculators. Offloading calculation to native statistical functions preserves full floating-point precision without requiring costly multimodal alignment.
- Auditable Evidence Prevents "Cheating": Standard LLMs often perform well on time series Q&A benchmarks even when the data is entirely removed, proving they rely on memorization. TS-Agent's quality gate requires that every claim be provably derived from an entry in the Evidence Log.
- Iterative Self-Correction Beats One-Shot Plans: Static decomposers fail when initial assumptions are wrong. In the paper's solar-panel case study, the agent initially tried an anomaly detector, recognized its failure via the critic's feedback, and dynamically pivoted to weekly segment-level aggregation to successfully identify cloudy periods.
Key Results
Despite using a lightweight backbone (gpt-4o-mini), TS-Agent matched or outperformed larger models across understanding and reasoning:
- Complex Causality: On TimeSeriesExam, TS-Agent scored 0.55 on causality analysis, beating GPT-o1 (0.37) and GPT-4o (0.29). It also led on pattern recognition (0.71 vs. GPT-o1's 0.65).
- Feature Understanding: Outperformed or matched GPT-4 on multivariate dependencies, achieving 0.55 F1 on lagged correlation (vs. GPT-4's 0.54) and 0.53 on changing correlation (vs. 0.48).
- Multi-Series Reasoning: On the Merrill et al. benchmark, TS-Agent surpassed all proprietary baselines on two-series reasoning with 57.3% accuracy (GPT-4-Vision scored 53.6%, GPT-4 scored 52.7%, and open-source models scored ~25–27%), closing the gap toward human annotator performance (67%).
Limitations and Future Work
- Step-Budget Failures: If the reasoner fails to satisfy all required intent predicates within a predetermined step budget, it emits an
AGENT_FAILURErather than guessing. - Domain-Specific Tooling: While the agent can synthesize custom operators, complex industrial domains (e.g., high-frequency order books or biomedical telemetry) may require specialized tool libraries.
- Backbone Generalization: Experiments exclusively used
gpt-4o-mini. Exploring open-weight models (e.g., Llama 3, DeepSeek) as the reasoning core remains an open direction.
Summary updated