Representing Time Series as Structured Programs for LLM Reasoning

· Source: cs.AI updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics · Depth: Expert, long

Summary

The Time-Series-to-Structured-Program (T2SP) representation is a deterministic, training-free method designed to enable large language models (LLMs) to effectively reason about time series data. Addressing the modality mismatch between raw numerical sequences and LLMs' native textual/code-like training, T2SP decomposes time series into trends, periods, and salient events, expressing them as a structured symbolic program. This approach shifts the burden of temporal-structure extraction from the LLM to the representation itself, allowing off-the-shelf LLMs to leverage their existing reasoning capabilities. Evaluated on editing, captioning, and question answering tasks, T2SP consistently improved performance, reduced reasoning time, and lowered failure rates compared to raw-string representations. It was tested across models like GPT-5.4, Claude-haiku-4.5, Gemini-3.1-flash-lite, and Qwen-3.5-9B, demonstrating superior fidelity and preservation in editing tasks, especially for sequence lengths beyond 256.

Key takeaway

For AI Engineers or Machine Learning Scientists working with LLMs on time-series analysis, you should consider adopting the T2SP representation. This training-free method allows your existing LLMs, including powerful closed-source models like GPT-5.4, to interpret and reason about temporal data more effectively. By converting raw time series into structured programs, you can achieve higher performance, reduce inference time, and lower failure rates on tasks like editing, captioning, and question answering, especially with longer sequences.

Key insights

Representing time series as structured symbolic programs enables LLMs to reason effectively without fine-tuning.

Principles

Method

T2SP deterministically decomposes a raw time series into trend (B-splines), periodic components (sinusoids from Fourier spectrum), and events (spikes/Gaussians), then expresses these as a symbolic program.

In practice

Topics

Best for: Research Scientist, AI Scientist, Machine Learning Engineer, AI Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.AI updates on arXiv.org.