Source-linked AI summary

TT-SAX: A Two-Track Time Series Symbolization for Natural Language Shape Querying

Zhao Tan, Xianglong Bao, Zhipeng Xi, Ming Jin

arXiv:2610.30593v1cs.DBcs.CL

TL;DR

Shape queries about how time series move remain a central challenge for natural-language querying, and symbolizations for this task have not been systematically studied. The paper proposes TT-SAX, which adds contextual trend information to SAX level letters, and reports consistent gains across six LLMs.

  • Problem

    Natural-language shape queries about time-series movement remain difficult at database scale, and the suitability of existing symbolizations for this task has not been systematically studied.

    Source: §1 · pp. 1–3
  • Method

    TT-SAX preserves SAX level letters and adds an aligned trend word measured across neighboring segments, with mnemonic trend grades.

    Source: §1 · p. 3
  • Results

    Across six LLMs, TT-SAX’s gains remain consistent; with skills, its lift is 3.04, 1.4× that of the next best.

    Source: §5.1 · p. 7, §6 · p. 12
  • Takeaways & Limitations

    The results demonstrate the importance of designing symbolizations that are both numerically informative and accessible to LLMs.

    Source: §6 · p. 12

    Lift uses a pre-set 10% candidate floor, so near-empty matches are not scored by their raw candidate fraction.

    Source: Metrics · p. 6

Abstract

from arXiv · show

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.

1 Introduction

Shape queries about how a time series moves remain difficult to answer at database scale, and the suitability of symbolizations for natural-language querying has not been systematically studied. The paper identifies three limitations in classical symbolizations and proposes TT-SAX, then evaluates it against six classical alternatives on NLQTSBench across six LLMs.

Problem

  • Shape queries ask about patterns of movement in long time-series histories, and answering them at database scale remains an open challenge.The paper identifies shape queries as the main challenge within natural-language querying for time-series databases.Source: §1 · pp. 1–2

Prior approach

  • Sonar-TS uses SAX strings as an index: an LLM compiles a shape query into a regular expression that runs over the stored windows.This approach makes search over a long history cheap enough to cover an entire database.Source: §1 · p. 2

Limitations

  • Classical symbolizations omit direction, measure it within short segments, or use abstract letters that may not help an LLM retrieve shapes.Within-segment measurements can follow noise during a longer trend, while abstract codes are harmless for distance and classification but may matter to an LLM.Source: §1 · pp. 2–3

Contribution

  • TT-SAX keeps SAX level letters and adds an aligned trend word measured across neighboring segments, using mnemonic grades for fall, stability, and rise.Its five letters are F, f, s, r, and R, for steep fall, slow fall, stable, slow rise, and steep rise.Source: §1 · p. 3

Evaluation

  • TT-SAX is evaluated against six classical symbolizations on NLQTSBench across six LLMs, with ablations attributing its gains to the three design choices.The paper presents this as a systematic study of symbolization designed for natural-language shape querying.Source: §1 · p. 3

2 Background and Related Work

Prior work addresses natural-language time-series querying through symbolic search, while existing symbolizations and shape-query interfaces have been designed around other goals or constraints. The paper positions its study as a systematic evaluation of symbolization for LLM-based shape querying.

Natural language querying

  • Sonar-TS uses regular expressions over stored SAX words for database-scale search, but fixes the symbolization to SAX.Its planner uses skills learned automatically, and Sonar-TS introduced NLQTSBench, whose composite-trend subset is used in this paper.Source: §2 · p. 3

Symbolizations

  • Classical symbolizations add per-segment detail such as extrema, slopes, or angles, while TVA uses mnemonic slope letters and Zalewski et al. quantize successive-mean differences.These methods were developed for purposes such as distance and classification, and the paper found no prior LLM-oriented symbolization design or evaluation.Source: Symbolizations · pp. 3–4
  • Frequency- and projection-based methods such as SFA and SPARTAN are excluded because their symbols do not encode time-ordered shapes as patterns.Prior symbolization comparisons assess reconstruction, distance, and classification.Source: Symbolizations · p. 4

Shape queries

  • Shape-query systems trade off authoring and scale: formal languages require user-authored expressions, while some natural-language or neural approaches do not scale to database histories.The paper contrasts these with symbolic search, where an LLM authors a pattern that runs over a symbol index.Source: Shape queries · p. 4

3 TT-SAX

TT-SAX preserves SAX’s level word and pairs it with an aligned trend word. The trend is measured across neighboring segments and encoded with five mnemonic grades.

Representation

  • Each TT-SAX window contains a trend word and an unchanged SAX level word, with one trend letter aligned to each segment.The two words are separated by a bar.Source: §3 · p. 4, Figure 2 · p. 5

Trend measurement

  • TT-SAX measures segment i’s trend using a centered difference across neighboring segment means, with one-sided differences at the two ends.The centered difference gives a two-sided context and keeps the trend letter aligned with the level letter; the paper describes this as smoothing suited to macroscopic movement.Source: §3 · p. 4

Trend letters

  • The trend values map to F, f, s, r, or R using two fixed thresholds on the window-normalized scale, with case distinguishing steep from slow.The thresholds are τ1 = 0.10 and τ2 = 0.30; the sign sets direction, and the symmetric mnemonic alphabet is chosen for the LLM.Source: §3 · p. 5

Design distinction

  • Cross-segment slope information predates TT-SAX, but TT-SAX combines centered alignment, fixed symmetric grades, and an LLM-oriented alphabet.The paper distinguishes this combination from Zalewski et al., which quantizes successive-mean differences using data-driven clusters.Source: §3 · p. 5

4 Experimental Setup

The experiments use NLQTSBench composite-trend queries and vary the symbolization while sharing the search pipeline. They evaluate candidate retention and filtering quality, using six classical symbolizations as baselines.

Dataset

  • NLQTSBench’s composite-trend subset supplies 220 queries over multi-domain real-world channels, each describing a two-to-four-part trend pattern.The queries use rise, fall, or stable patterns with adjectives such as rapid, slow, steady, and fluctuating; 1,000 fresh generated queries are reserved for a stress test.Source: Dataset · p. 5

Pipeline

  • The pipeline changes only the symbolization; it determines both the stored strings and the encoding card read by the LLM.The shared pipeline has the LLM compile a query into a regular expression, which then matches the strings to produce candidate windows.Source: Pipeline · p. 6, Figure 3 · p. 6

Metrics

  • Recall measures retained answer windows, candidates measure retained windows overall, and lift combines the two as recall divided by candidates with a floor.The 10% floor was fixed in advance to prevent patterns matching almost nothing from scoring highly by luck.Source: Metrics · p. 6

Baselines

  • TT-SAX and six baselines are compared at a shared setting of 24 segments per day and five letters per attribute where a fixed grid applies.The baselines are SAX, ESAX, 1d-SAX, TFSAX, TSAX, and ABBA.Source: Baselines · p. 7

Models and skills

  • The main experiments use DeepSeek-V4-Flash, while the comparison is repeated with five additional LLMs for robustness.Skills are learned separately for each symbolization from model failures on 80 generated development queries over four rounds, repeated with three seeds; test means are reported.Source: Model · p. 7, Skills learning · p. 7

5 Results

TT-SAX leads the benchmark comparisons on lift, while ablations examine its two tracks, trend measurement, and letters. Skills transfer across models, and TT-SAX’s advantage persists across additional models and a larger query set.

5.1 Main Results

  • Lift 3.04 is 1.4× the next best with skills, and TT-SAX retains the highest lift in both conditions.Across the benchmark, TT-SAX also matches 1d-SAX’s recall with far fewer candidates.Source: §5.1 · pp. 7–8, Table 1 · p. 8

5.2 Ablation Studies

  • Removing the trend word drops lift to 1.00; removing the level word lowers recall but leaves lift at 2.03.Without the trend word, patterns keep many windows yet catch few answers.Source: Removing a track · p. 8, Table 2 · p. 8
  • TT-SAX recall peaks at two neighbors; widening gives no comparable gain to baselines because their trend alphabets handle span differently.The best neighbor count depends on the query distribution, data, and other symbolization parameters.Source: Widening the trend measurement · p. 9, Figure 4 · p. 9
  • Across five alternative threshold pairs, recall is 0.65–0.68, candidates 31%–33%, and lift 2.11–2.30, above every no-skills baseline.The default thresholds were fixed before the experiments and left unchanged.Source: Widening the trend measurement · p. 9
  • Across both LLMs, Group I performed best; changing TT-SAX’s FfsrR to fFsRr lowered recall from 0.71 to 0.61, and eight swapped pairs lost five points on average.The authors say TT-SAX’s direction words provide meaning, uppercase letters match the LLM’s expected convention, and the alphabet remains readable to humans.Source: Changing the letters · pp. 10–11

5.3 Skills Transfer

  • Every model-and-skill-set combination beats that model without skills; Skills-F gives all three models their highest lift.Skills-Q gives every model its highest recall, while Skills-F gives every model its fewest candidates.Source: §5.3 · p. 11

5.4 Robustness Analysis

  • Average lift across five further LLMs is 1.81 without skills and 3.28 with skills, versus 1.24 and 1.93 for the best classical symbolization.Figure 7 presents lift for each symbolization under six LLMs, with and without skills.Source: §5.4 · p. 11, Figure 7 · p. 12
  • On a deduplicated set of 1,000 queries, every symbolization moves by at most three points in recall and candidates; TT-SAX alone has lift above two on both sets in both conditions.The larger set is nearly five times the size of the 220-query benchmark.Source: §5.4 · pp. 11–12, Figure 8 · p. 12

6 Conclusion

The paper studies how symbolization should be designed for natural-language shape queries and proposes TT-SAX, which represents level and contextual trend information in aligned tracks. Its analyses associate TT-SAX’s gains with explicit trends, an appropriate measurement span, and meaningful letters, with gains consistent across six LLMs.

6 Conclusion

  • TT-SAX’s gains remain consistent across six LLMs.Source: §6 · p. 12
  • The paper systematically analyzes classical symbolizations for natural-language shape querying and proposes TT-SAX with aligned level and contextual trend tracks.Source: §6 · p. 12
  • Further analyses associate TT-SAX’s gains with an explicit trend word, an appropriate measurement span, and meaningful letters.Source: §6 · p. 12
Loading 2610.30593v1…