Natural language querying for time series databases aims to let users find what they need in long histories of data by asking in plain language. Shape queries ask how a series moves. They are the main challenge of this task. Recent work makes them feasible by using symbolization as a bridge between the query and the long history. However, existing symbolizations were designed for compression, similarity indexing, or classification. What a symbolization should provide for natural language querying has not been systematically studied. We therefore examine the definitions of six classical symbolizations against this task and identify three limitations. (1) Direction is missing from the string, (2) direction is measured at too small a scale, and (3) the letters are arbitrary. Three design principles follow. We follow these principles and make a minimal redesign of SAX called TT-SAX (two-track SAX). The level letters stay. Each segment gains a trend letter. It is measured across neighboring segments rather than inside one, and graded to match the adjectives that queries use. We conduct extensive experiments on the public NLQTSBench benchmark, comparing TT-SAX with the six classical symbolizations across six LLMs. TT-SAX outperforms all six on shape queries, and ablations trace its gains back to the three limitations one by one. This paper is the first systematic study of time series symbolization with natural language querying as the design goal. It provides a foundation for future research on this task. Our code is available at https://github.com/Atlamtiz/tt-sax.
Figures & tables
Figure 1: How symbolization serves a natural language shape query, illustrated with SAX. (1) Each window of the series is symbolized into a short string of letters. (2) An LLM compiles the query into a regular expression over the letters. (3) The regex runs over every window’s string.
Figure 2: An illustration of TT-SAX. Each window is written as two words, a trend word with one trend letter per segment, and the level word.
Figure 3: The evaluation pipeline. The only variable is the orange slot, the symbolization. It determines both the symbol strings and the encoding card the model reads.
w/o skills
w/ skills
Symbolization
Recall ↑
Cand. ↓
Lift ↑
Recall ↑
Cand. ↓
Lift ↑
SAX
0.43
35%
1.00
0.59
36%
1.56
ESAX
0.47
34%
1.19
0.49
28%
1.53
1d-SAX
0.73
51%
1.42
0.83
49%
2.11
TFSAX
0.55
38%
1.39
0.59
33%
2.16
TSAX
0.62
50%
1.01
0.65
43%
1.78
Table 1: Main results of TT-SAX. Best in bold, second best underlined. n=220 queries; every metric is averaged over queries; the results with skills average three skill-learning seeds, the results without skills are single runs.
Variant
Recall ↑
Cand. ↓
Lift ↑
TT-SAX
0.71
32%
2.42
w/o trend word
0.43
35%
1.00
w/o level word
0.55
26%
2.03
Table 2: Ablation of the two words.
Figure 4: Recall (left) and candidates (right) as the trend measurement widens, for TT-SAX and the three baselines that also write a trend letter.
Figure 5: Ablation of the trend letters. Group I letters are the initials of direction words, e.g., FfsrR . Group II letters pair by case but carry no meaning, e.g., KkxmM . Group III letters are plain alphabet runs, e.g., vwxyz . In the case-swapped alphabets the uppercase and lowercase of every case-paired letter are exchanged, so FfsrR becomes fFsRr .
Figure 6: Skills transfer results of TT-SAX.
Figure 7: Lift of every symbolization under six LLMs, without skills (arrow tail) and with skills (arrow head).
Figure 8: Stress test on a fresh set of 1,000 queries.
Natural Language Querying for Time Series Databases (NLQ4TSDB) aims to assist non-expert users retrieve meaningful events, intervals, and summaries from massive temporal records. However, existing Text-to-SQL methods are not designed for continuous morphological intents such as shapes or anomalies, while time series models struggle to handle ultra-long histories. To address these challenges, we propose Sonar-TS, a neuro-symbolic framework that tackles NLQ4TSDB via a Search-Then-Verify pipeline. Analogous to active sonar, it utilizes a feature index to ping candidate windows via SQL, followed by generated Python programs to lock on and verify candidates against raw signals. To enable effective evaluation, we introduce NLQTSBench, the first large-scale benchmark designed for NLQ over TSDB-scale histories. Our experiments highlight the unique challenges within this domain and demonstrate that Sonar-TS effectively navigates complex temporal queries where traditional methods fail. This work presents the first systematic study of NLQ4TSDB, offering a general framework and evaluation standard to facilitate future research.
Zhao Tan, Yiji Zhao, Shiyu Wang +5
Jiangxi University of Finance and Economics · Griffith University · Yunnan University +2
Large language models (LLMs) have significantly advanced natural language querying over relational databases, yet their ability to query time-series databases (TSDBs) remains largely unassessed. Existing benchmarks fail to adequately capture the non-unified query syntaxes, diverse application domains, and unique time-specific query intents inherent to TSDBs. To address this gap, we introduce TQTS-BENCH, a multi-syntax benchmark for evaluating text-to-query capabilities over TSDBs. TQTS-BENCH contains 6,125 high-quality question-answering (QA) pairs spanning 97 TSDBs, 23 distinct query syntaxes, 22 application domains, and 4 types of time-specific query intents. It is constructed through a human-centric AI-assisted workflow, where all QA pairs are carefully reviewed and revised by domain experts to ensure quality and correctness. Extensive evaluations of advanced LLMs and state-of-the-art text-to-query methods reveal challenges in querying TSDBs. Even the best-performing model evaluated, Claude-Opus-5, achieves only 48.98% execution accuracy, while humans reach 87.34%. Error analysis reveals that this performance gap mainly stems from the heterogeneous query syntaxes across different TSDBs, misinterpretation of time-specific intents, and incorrect schema linking. These findings highlight new opportunities to narrow the gap between current LLM capabilities and the requirements of TSDB queries in real-world applications. The benchmark is available at: https://anonymous.4open.science/r/TQTS-Bench-00CD.
Fei Lyu, Zhiyi Peng, Jiaming Liu +5
College of Computer Science and Electronic Engineering, Hunan University
Text offers intuitive access to information. This can, in particular, complement the density of numerical time series, thereby enabling improved interactions with time series models to enhance accessibility and decision-making. While the creation of question-answering datasets and models has recently seen remarkable growth, most research focuses on question answering (QA) on vision and text, with time series receiving minute attention. To bridge this gap, we propose a challenging novel time series QA (TSQA) dataset, QuAnTS, for Question Answering on Time Series data. Specifically, we pose a wide variety of questions and answers about human motion in the form of tracked skeleton trajectories. We verify that the large-scale QuAnTS dataset is well-formed and comprehensive through extensive experiments. Thoroughly evaluating existing and newly proposed baselines then lays the groundwork for a deeper exploration of TSQA using QuAnTS. Additionally, we provide human performances as a key reference for gauging the practical usability of such models. We hope to encourage future research on interacting with time series models through text, enabling better decision-making and more transparent systems.
Felix Divo, Maurice Kraus, Anh Q. Nguyen +5
AI & ML Lab, TU Darmstadt · University of New South Wales · MBZUAI, Abu Dhabi +4