TimeFlow: Towards Stochastic-Aware and Efficient Time Series Generation via Flow Matching Modeling
He Panjing, Cheng Mingyue, Li Li, Zhang XiaoHan
TL;DR
TimeFlow introduces a stochastic flow matching framework for time series generation by integrating a neural SDE with an encoder-based velocity field and a componentized flow decomposition. By injecting stochastic perturbations into the velocity predictions and using a Stochastic Flow Matching loss, TimeFlow explicitly models uncertainty, improving realism and robustness while maintaining efficiency relative to diffusion-based methods. The approach supports both unconditional and conditional generation, demonstrated across diverse real-world and synthetic datasets with strong gains in quality metrics and faster sampling. This work highlights stochasticity modeling as key to high-fidelity time series generation and offers a scalable, versatile solution for forecasting, imputation, and related tasks.
Abstract
Generating high-quality time series data has emerged as a critical research topic due to its broad utility in supporting downstream time series mining tasks. A major challenge lies in modeling the intrinsic stochasticity of temporal dynamics, as real-world sequences often exhibit random fluctuations and localized variations. While diffusion models have achieved remarkable success, their generation process is computationally inefficient, often requiring hundreds to thousands of expensive function evaluations per sample. Flow matching has emerged as a more efficient paradigm, yet its conventional ordinary differential equation (ODE)-based formulation fails to explicitly capture stochasticity, thereby limiting the fidelity of generated sequences. By contrast, stochastic differential equation (SDE) are naturally suited for modeling randomness and uncertainty. Motivated by these insights, we propose TimeFlow, a novel SDE-based flow matching framework that integrates a encoder-only architecture. Specifically, we design a component-wise decomposed velocity field to capture the multi-faceted structure of time series and augment the vanilla flow-matching optimization with an additional stochastic term to enhance representational expressiveness. TimeFlow is flexible and general, supporting both unconditional and conditional generation tasks within a unified framework. Extensive experiments across diverse datasets demonstrate that our model consistently outperforms strong baselines in generation quality, diversity, and efficiency.
