ShapeLex improves text-based time series generation with discrete shape units

ShapeLex: Decoupling Local Shape Symbolization and Global Scale Modeling for Text-Controlled Time Series Generation

Machine Learning

Summary

Generating time series data that matches text descriptions is challenging because existing methods blend all details into one mixed representation, which can miss important local patterns. The authors propose ShapeLex, a method that separates local shapes like spikes or drops from overall trends, making it easier to create realistic sequences from text. ShapeLex builds a vocabulary of common local shapes, then assembles these shapes with adjustments based on input text, producing time series that better match real patterns. This approach also avoids costly manual labeling by learning the shape vocabulary automatically.

What this means in practice

  • For financial analysts: Create synthetic stock price sequences from textual market scenarios to test trading strategies under realistic market conditions.
  • For energy demand planners: Generate time series of power consumption from textual descriptions of demand patterns to improve scenario planning and forecasting systems.

Authors

Subo Wei, Jianqi Gao, Mingyan Fan, Shaorong Xie, Xinzhi Wang, Yongpeng Dong

Abstract

Text-controlled time series generation aims to synthesize sequences that follow natural-language descriptions while remaining faithful to real data distributions. Existing paradigms often couple semantic understanding and sequence modeling in a single continuous latent space, lacking explicit local semantic anchors and separation between global continuous attributes and local discrete shapes. As a result, key local structures may be smoothed, missed, or misplaced. We propose Shape Lexicon (ShapeLex), which decouples text-to-sequence generation into discrete symbolization of local shapes and continuous modeling of global attributes. ShapeLex first induces a reusable vocabulary of discrete shape units, such as rises, spikes, and sharp drops, from training data, forming an interpretable symbolic space. An autoregressive generator then selects shapes according to the textual description, adjusts attributes such as position and duration, and composes them in temporal order into a shape skeleton. Finally, a mixture-density scale head models and samples the overall level and volatility to restore realistic global scale. Experiments on twelve public datasets, real user-written text, and downstream forecasting tasks show that ShapeLex generates series that better match real data distributions than existing methods. In addition, paired supervision is automatically synthesized from the learned vocabulary, avoiding annotation costs that grow with dataset size and improving scalability.