TL;DR
TQTS-BENCH is a new, large-scale benchmark designed to evaluate how well Large Language Models (LLMs) can translate natural language into queries for time-series databases (TSDBs). While LLMs have mastered relational SQL, this paper reveals a massive performance gap in the time-series domain: even the best model, Claude-Opus-5, achieves only ~49% accuracy compared to 87% for humans, primarily due to the wild diversity of TSDB syntaxes and complex temporal logic.
What Problem Does This Paper Address?
While text-to-SQL benchmarks like Spider and BIRD have pushed LLMs toward human-level performance on relational databases, time-series databases (TSDBs) remain a "wild west." Querying a TSDB isn't just about filtering rows; it involves specialized operations like window resampling, temporal change analysis, and relationship mapping across high-frequency data streams.
The authors identify three core challenges that existing benchmarks ignore:
- Heterogeneous Syntaxes: Unlike the relatively unified world of SQL, TSDBs use vastly different languages, such as InfluxDB’s pipeline-style Flux, Prometheus’s nested PromQL, and specialized extensions like QuestDB-SQL.
- Broad, Specialized Domains: TSDBs are the backbone of IoT, AIOps, and cloud telemetry—areas poorly represented in standard relational benchmarks.
- Time-Specific Intents: Queries often require understanding temporal concepts (e.g., "the largest one-second increase") that go far beyond simple aggregations.
Methods
The authors developed TQTS-BENCH using a human-centric, AI-assisted workflow.
- Construction: They collected 427 real-world datasets and 1,405 "seed" QA pairs from official documentation and forums.
- Intent Identification: They defined 9 representative query intents (4 time-specific, 5 time-agnostic) to ensure the benchmark covers the full spectrum of TSDB utility.
- Verification: To ensure high quality, they used a double-blind cross-validation process. Two human annotators independently wrote queries for each question; if their results didn't match the AI-generated "gold" answer, an adjudicator stepped in to resolve the discrepancy.
- Evaluation Metric: They utilized Execution Accuracy (EX), but added a custom "match policy" to handle the fact that TSDB queries can return the same data in different formats (e.g., pivoted vs. long formats) without being "wrong."
Datasets
The resulting TQTS-BENCH is significantly more diverse than its predecessors:
- 6,125 QA pairs across 97 TSDBs.
- 23 distinct query syntaxes and 22 application domains (from Finance to Healthcare to IoT).
- 41.68 GB of total data volume.
- It covers significantly more temporal operations per question compared to benchmarks like BIRD or Spider 2.0.
Key Insights and Ideas
- Syntax is the primary barrier: An ablation study showed that when TSDB data is converted to a standard relational format (SQLite), model performance jumps significantly. This suggests the failure isn't in understanding the logic of the question, but in mastering the specific grammar of diverse TSDB languages.
- Temporal logic is a stumbling block: Errors involving time-specific intents (like windowing or change analysis) accounted for over 65% of all intent-understanding failures.
- Schema Linking is harder in TSDBs: Unlike RDBs with clear tables and columns, TSDBs use metrics, labels, and tags. Furthermore, some TSDB schemas in the benchmark are massive (averaging 381k tokens for error cases), leading to "lost-in-the-middle" issues for LLMs.
Key Results
The evaluation of state-of-the-art LLMs reveals a sobering reality:
- Human Performance: 87.34% Execution Accuracy.
- Top Model (Claude-Opus-5): 48.98% EX.
- GPT-6-Sol: 46.38% EX.
- Open-Source Leader (Kimi-K3): 43.15% EX.
- RDB-Optimized Methods: Existing state-of-the-art text-to-SQL methods (like DeepEye-SQL) failed miserably, often scoring below 6% because they tried to generate SQL for databases that require PromQL or Flux.
Limitations and Future Work
The authors acknowledge that current LLMs lack specific syntax knowledge for many specialized TSDBs. The massive scale of some TSDB schemas also poses a significant challenge for context window management.
Future directions include: * Developing better schema linking techniques specifically for metric/label/tag structures. * Enhancing LLM training or prompting to better handle temporal reasoning. * Creating more generalizable text-to-query methods that can adapt to new TSDB syntaxes without needing exhaustive fine-tuning for every new database engine.
Summary updated