Representing Time Series as Structured Programs for LLM Reasoning
Summary
The Time-Series-to-Structured-Program (T2SP) representation is a novel, deterministic, and training-free method designed to enable large language models (LLMs) to effectively reason about time series data. Published on 2026-06-10, T2SP addresses the modality mismatch inherent when LLMs process raw numerical sequences or require extensive fine-tuning. It achieves this by decomposing time series into trends, periods, and salient events, then expressing them in a structured symbolic program format that aligns with LLMs' native textual and code-like training. This approach shifts the burden of temporal-structure extraction from the LLM to the representation itself. Evaluations on editing, captioning, and question answering tasks demonstrate that T2SP consistently improves performance, reduces reasoning time, and lowers failure rates compared with raw-string representations.
Key takeaway
For AI Scientists and Machine Learning Engineers developing LLM applications for time-series analysis, integrating T2SP offers a significant advantage. This method allows off-the-shelf LLMs to leverage their inherent reasoning capabilities more effectively by providing a program-friendly data format. You should consider adopting T2SP to improve performance, reduce computational overhead, and lower failure rates on tasks like time-series editing, captioning, and question answering, moving beyond raw data serialization or costly fine-tuning.
Key insights
T2SP transforms time series into structured programs, aligning them with LLMs' native textual modality for enhanced reasoning.
Principles
- Shift temporal structure extraction to data representation.
- Decompose time series into trends, periods, and salient events.
- Align data modality with LLM training for effective reasoning.
Method
T2SP deterministically and without training decomposes time series into trends, periods, and salient events, expressing them as a structured symbolic program for LLM processing.
In practice
- Apply T2SP for time-series editing tasks.
- Use T2SP for time-series captioning.
- Implement T2SP for time-series question answering.
Topics
- Large Language Models
- Time Series Analysis
- Data Representation
- Symbolic AI
- Program Synthesis
- Machine Learning
Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning.