Abstract
Generating synthetic time-series data that adheres to specific, user-defined constraints is a critical challenge in domains such as finance and energy. Traditional Deep Generative Models (DGMs) often require expensive re-training or inefficient rejection sampling to satisfy these constraints. This paper presents a framework centered on Guided-DiffTime, a diffusion-based approach that applies constraints during the sampling process via gradient guidance. Our results demonstrate that Guided-DiffTime achieves high statistical realism and near-perfect constraint satisfaction without the need for model re-training, reducing the computational carbon footprint by up to 92%.
1. Introduction
Synthetic time-series generation has become a cornerstone of modern data science, particularly in sectors where data is sensitive, scarce, or requires "what-if" scenario testing. In finance, researchers use synthetic data to stress-test trading strategies against hypothetical market crashes. In energy, it helps model consumption patterns under various conservation laws.
However, generating data that is both realistic (statistically indistinguishable from historical data) and constrained (adhering to specific rules, such as a stock price hitting a certain target) remains difficult. Existing models like Generative Adversarial Networks (GANs) typically require the model to be re-trained whenever a constraint changes. Alternatively, rejection sampling—generating many samples and discarding those that fail the constraint—is prohibitively inefficient for complex, high-dimensional rules. This paper addresses the constrained time-series generation problem by decoupling the learning of data distributions from the enforcement of constraints.
2. Methodology
The research evaluates three distinct methodologies for constrained generation, moving from classical optimization to state-of-the-art diffusion models:
2.1 Constrained Optimization Problem (COP)
The COP approach treats the generation task as a classical optimization problem. Each point in the time series is a variable, and the objective is to minimize the distance from a "seed" sample while satisfying the constraints. While highly effective at "fine-tuning" existing data, its performance is heavily dependent on the quality of the initial seed.
2.2 DiffTime and Loss-DiffTime
Based on Denoising Diffusion Probabilistic Models (DDPMs), DiffTime learns to reverse a Gaussian noise process to generate realistic data. Loss-DiffTime extends this by incorporating constraint satisfaction directly into the training loss function. While this produces high-quality results for specific constraints, it lacks flexibility; any change in the constraint parameters necessitates a full re-training cycle.
2.3 Guided-DiffTime
Guided-DiffTime is the primary contribution of this work. Utilizing a Denoising Diffusion Implicit Model (DDIM), it applies constraints during the sampling phase at inference time. By calculating the gradients of a differentiable constraint function, the model "guides" the denoising process toward a region of the latent space that satisfies the required rules. This "plug-and-play" capability allows users to change constraints on the fly without ever re-training the base model.
3. Experimental Setup
The models were benchmarked across three diverse datasets to ensure robustness:
- Daily Stocks: 15 years of Google stock data (Open, High, Low, Close, Volume).
- Energy Data: High-dimensional (28 features) appliance energy usage data from the UCI repository, characterized by complex periodicity.
- Sines: A multivariate sinusoidal dataset used to establish a baseline for temporal pattern recognition.
4. Key Results and Discussion
4.1 Realism and Utility
In unconstrained scenarios, DiffTime consistently outperformed state-of-the-art GANs (e.g., TimeGAN, GT-GAN). The synthetic data produced by diffusion models achieved superior predictive and discriminative scores, indicating that the data is both useful for downstream tasks and difficult for discriminators to distinguish from real-world observations.
4.2 Constraint Satisfaction
For hard constraints—such as ensuring the "High" price of a stock remains above the "Low" price—Guided-DiffTime and COP achieved satisfaction rates near 100%. In contrast, traditional GAN-based approaches often failed to meet these rules more than 50% of the time.
4.3 Efficiency and Sustainability
One of the most significant findings is the efficiency of Guided-DiffTime. It generates samples in approximately 0.15 seconds, compared to over 2 seconds for COP. More importantly, by eliminating the need for re-training for every new scenario, Guided-DiffTime reduces the estimated carbon footprint of the generative process by up to 92% compared to standard deep learning approaches.
4.4 The Realism-Guidance Trade-off
The researchers noted a trade-off between the "guidance scale" (represented by $\rho$) and statistical realism. As the model is forced more aggressively to meet a constraint, the resulting sample may drift slightly from the historical distribution. However, the study found that using COP as a post-processor can bridge this gap, nudging samples to perfect satisfaction with minimal impact on realism.
5. Conclusion and Future Work
The Guided-DiffTime framework represents a significant step forward in making synthetic data generation practical for regulated and high-stakes industries. By decoupling data distribution learning from constraint enforcement, it provides a flexible, efficient, and sustainable solution.
Future research will focus on expanding the framework to handle non-differentiable or logical constraints and improving the coherence of extremely long-sequence generations, which remains a challenge for current diffusion architectures.
Summary updated