Source-linked AI summary

On the Constrained Time-Series Generation Problem

Andrea Coletta, Sriram Gopalakrishan, Daniel Borrajo, Svitlana Vyetrenko

arXiv:2307.01717v2cs.LGcs.AI

TL;DR

The paper addresses constrained time-series generation, where outputs must resemble historical data while meeting user-specified conditions. It compares optimization and diffusion-based methods, including Guided-DiffTime, which adapts generation to new constraints without retraining. The authors report that their approaches outperform existing work and that COP can fine-tune candidate solutions.

  • Problem

    Constrained time-series generation must balance similarity to historical data with user-specified conditions, while existing training-bound approaches may require retraining when constraints change.

    Source: §1 · p. 2
  • Method

    The paper compares constrained optimization and diffusion-based methods, including Guided-DiffTime, which adjusts generation to input constraints at inference time.

    Source: §1 · p. 2, §3.1 · p. 4
  • Results

    The authors report that their approaches outperform existing work qualitatively and quantitatively, and Guided-DiffTime avoids retraining for new constraints.

    Source: §1 · p. 3, §5 · p. 10
  • Takeaways & Limitations

    COP can fine-tune candidate solutions generated by any generative model to guarantee constraint satisfaction.

    Source: §1 · p. 2

    The presented methods assume that constraints are differentiable.

    Source: §2 · p. 3

Abstract

from arXiv · show

Synthetic time series are often used in practical applications to augment the historical time series dataset for better performance of machine learning algorithms, amplify the occurrence of rare events, and also create counterfactual scenarios described by the time series. Distributional-similarity (which we refer to as realism) as well as the satisfaction of certain numerical constraints are common requirements in counterfactual time series scenario generation requests. For instance, the US Federal Reserve publishes synthetic market stress scenarios given by the constrained time series for financial institutions to assess their performance in hypothetical recessions. Existing approaches for generating constrained time series usually penalize training loss to enforce constraints, and reject non-conforming samples. However, these approaches would require re-training if we change constraints, and rejection sampling can be computationally expensive, or impractical for complex constraints. In this paper, we propose a novel set of methods to tackle the constrained time series generation problem and provide efficient sampling while ensuring the realism of generated time series. In particular, we frame the problem using a constrained optimization framework and then we propose a set of generative methods including "GuidedDiffTime", a guided diffusion model to generate realistic time series. Empirically, we evaluate our work on several datasets for financial and energy data, where incorporating constraints is critical. We show that our approaches outperform existing work both qualitatively and quantitatively. Most importantly, we show that our "GuidedDiffTime" model is the only solution where re-training is not necessary for new constraints, resulting in a significant carbon footprint reduction, up to 92% w.r.t. existing deep learning methods.

1 Introduction

The paper targets synthetic time series that preserve historical statistical properties while satisfying user-specified constraints. It compares generation methods designed to handle different constraint types, including a guided diffusion method that can adapt to new constraints without retraining.

  • Constrained time series must remain statistically similar to historical data while meeting conditions such as physical rules or hypothetical market shocks.Examples include energy conservation and a stock-market index decreasing by 5%.Source: §1 · pp. 1–2
  • Existing methods penalize invalid outputs, regularize losses, condition generation, or reject samples, but changing training-time constraints may require retraining.Complex constraints can also be difficult to guarantee, and rejection may fail when the learned distribution no longer covers the target.Source: §1 · p. 2
  • The paper compares constrained optimization, conditional diffusion (DiffTime), loss-penalized diffusion (Loss-DiffTime), and inference-guided diffusion (Guided-DiffTime).Guided-DiffTime adjusts generation based on input constraints at inference time.Source: §1 · p. 2
  • The contributions include formally defining constrained time-series generation and characterizing constraint types.The paper also evaluates methods across performance measures and constraint types.Source: §1 · p. 2
  • COP can fine-tune time series from any generative model to guarantee constraint satisfaction.The paper also presents COP as a generation method based on explicit data properties and constraints.Source: §1 · p. 2
  • The approaches outperform existing work qualitatively and quantitatively; Guided-DiffTime uniquely avoids retraining for new constraints and reduces carbon footprint.The conclusion also reports that COP can fine-tune candidate solutions.Source: §1 · p. 3

2 Definitions and Problem Formulation

The formulation seeks synthetic time series that approximate the input-data distribution while satisfying user-specified constraints. It distinguishes hard and soft constraints, local and global scope, and assumes differentiability for the presented methods.

  • The generation goal is to approximate the input distribution while making each synthetic series conform to user-specified constraints.The input consists of a dataset of time series and a list of constraints.Source: §2 · p. 3
  • Hard constraints must hold, while soft constraints are objectives to minimize and do not require sample rejection.Hard constraints may be equalities or inequalities; trend lines are soft constraints optimized by minimizing L2 distance.Source: §2 · p. 3
  • Global constraints compare across the series, whereas local fixed-point constraints specify a value at a particular time and feature.Examples include requiring a maximum at a designated point or fixing one point to a specified value.Source: §2 · p. 3
  • The methods assume differentiable constraints; adding penalty terms to a loss may produce candidates but does not guarantee constraint conformity.Non-differentiable rules may instead use perturbation-based loss computation.Source: §2 · p. 3

3 Constrained Time-Series Generation - Proposed Approaches

The paper presents several approaches to constrained time-series generation, balancing constraint satisfaction with statistical properties. They range from constrained optimization to diffusion models, with Guided-DiffTime designed to apply new constraints without retraining.

3.1 Constrained Optimization Problem (COP)

  • COP optimizes time-series points subject to constraints, serving either as a generative method or as post-hoc fine-tuning for nearly valid candidates.For generation, it maximizes distance from a seed while constraining statistical properties; for fine-tuning, it minimizes distance to preserve candidate information.Source: §3.1 · p. 4

3.2 DiffTime - Conditional Diffusion Model for Time Series generation

  • DiffTime conditions diffusion on a trend as a soft constraint and enforces fixed-point values as hard constraints during the reverse process.Trends can be specified at inference; fixed points are enforced at each step, with neighboring points adapting while preserving realism.Source: §3.2 · pp. 4–6

3.3 Loss-DiffTime - Constrained generation with diffusion models

  • Loss-DiffTime adds a differentiable constraint penalty to training, reparameterizing the objective to evaluate constraints on the estimated final sample.Because new constraints require retraining, the paper presents Guided-DiffTime as an alternative for changing constraints at inference.Source: §3.3 · p. 6, §3.4 · p. 6

3.4 Guided-DiffTime - Guided Diffusion models for constrained generation

  • Guided-DiffTime applies differentiable-constraint gradients during sampling, using DDIM to reduce inference steps and avoiding retraining when constraints change.The constraint is evaluated on the final sample; the authors report faster generation and reduced carbon footprint.Source: §3.4 · pp. 6–7

4 Experiments

The experiments compare the proposed methods with existing models across unconstrained and constrained time-series generation. DiffTime, COP, and GuidedDiffTime show different strengths in realism, usefulness, constraint satisfaction, and inference time.

4 Experiments

  • The evaluation uses stock, energy, and synthetic sine datasets, comparing generative baselines with constraint-aware variants across realism, usefulness, constraint satisfaction, and timing measures.COP uses a subset of the original time series as its starting seed; the stock, energy, and sine datasets vary in periodicity, noise, correlation, and feature count.Source: §4 · pp. 7–8

4.1 Unconstrained Generation

  • DiffTime has the best predictive scores on Sines and Stocks, while COP has the best discriminative scores on Stocks and Energy, with an advantage from using real series as seeds.In Figure 2, greater overlap between generated and original samples indicates better distributional similarity; the prose reports better overlap for the proposed approaches.Source: §4.1 · p. 8, Figure 2 · p. 8, Table 1 · p. 8

4.2 Constrained Generation

  • Our approaches are closer to the specified trend than other methods and are among the best in realism and usefulness.The trend constraint is computed as a 3-degree polynomial approximation from the original samples.Source: §4.2 · p. 9, Table 2 · p. 9
  • COP usually has the best realism and usefulness, while diffusion models offer lower inference time and more variety; GuidedDiffTime handles new constraints without retraining.For hard constraints, GuidedDiffTime and COP retain very high satisfaction on multivariate constraints, while DiffTime guarantees the tested fixed-point constraints.Source: §4.2 · p. 9, Table 3 · p. 9

5 Conclusions

The paper defines constrained synthetic time-series generation and presents methods for soft and hard constraints. Its approaches outperform existing work in the reported evaluations, with GuidedDiffTime addressing new constraints without retraining and COP supporting fine-tuning.

5 Conclusions

  • The paper defines generation with both soft and hard constraints, evaluates novel methods against existing approaches, and reports qualitative and quantitative improvements.GuidedDiffTime handles new constraints without retraining, while COP can fine-tune candidate solutions.Source: §5 · p. 10

Disclaimer

The document disclaims representations and warranties about the information’s completeness, accuracy, or reliability, and states that it is not investment research or advice.

Disclaimer

  • The document disclaims warranties about the information’s completeness, accuracy, and reliability, and says it is not investment advice or a recommendation concerning securities or financial products.It also states it is not intended to evaluate the merits of participating in a transaction or to solicit participation where that would be unlawful.Source: Disclaimer · p. 10

A Datasets

The appendix describes two publicly available datasets and one synthetic dataset, with time series that differ in periodicity, noise, correlation, and feature count.

A Datasets

  • The daily stock dataset contains Google stock data from 2004 to 2019 with six features; univariate experiments use only the open feature.The six features are open, high, low, close, adjusted close, and volume.Source: A Datasets · p. 15, Table 4 · p. 15
  • The UCI Appliances energy dataset has 28 features at 10-minute resolution, with noisy periodicity and correlation.Source: A Datasets · p. 15, Table 4 · p. 15
  • The synthetic sine dataset has five independently generated sinusoidal dimensions with frequencies and phases sampled uniformly; time series are length 24 unless otherwise stated.All datasets are normalized to [-1,1] for diffusion models.Source: A Datasets · p. 15

B Benchmarks

The benchmarks compare established time-series generators with the paper’s methods, adapting leading models for constrained generation. Implementation details report the software and hardware used.

B Benchmarks

  • The comparison includes GT-GAN, TimeGAN, RCGAN, C-RNN-GAN, T-Forcing, P-Forcing, WaveNET, and WaveGAN.The authors used and modified publicly available source code for these methods.Source: B Benchmarks · p. 15
  • For constrained generation, the authors focus on the three top-performing benchmarks and adapt them for the constraint types.Trend and fixed-value constraints are supplied as additional input dimensions, while hard constraints use a penalty added to the model loss.Source: B Benchmarks · p. 15

C Implementation details

D Constrained Optimization Method (COP)

The paper presents constrained optimization and diffusion-based methods for generating realistic time series under constraints. Its additional unconstrained-generation results report that DiffTime and COP-method outperform benchmark algorithms in t-SNE comparisons.

D.1 Algorithm and Details

  • COP-method optimizes an initial time series under an objective and constraints, using a solver such as SLSQP to generate or fine-tune samples.The objective can maximize distance from the seed or, for a trend constraint, combine distance from the seed with distance from the trend.Source: §D.1 · pp. 16–17, Figure 4 · p. 17

D.2 Realism constraints for Time Series

  • COP-method uses autocorrelation constraints to represent realism, with return autocorrelation for daily stocks and time-series autocorrelation for energy and Sines data.The autocorrelation-vector error is bounded using an L2 norm; the lag is set to 5, and the budget can increase if the solver cannot find a solution.Source: §D.2 · p. 17

D.3 WGAN-based Constrained Optimization (WGAN-COP)

  • WGAN-COP replaces explicit data-property constraints with a trained WGAN critic in the objective while retaining additional explicit constraints.The authors note that this approach does not apply to all GAN architectures, and that WGAN training can be expensive and unstable, especially for high-dimensional data.Source: §D.3 · pp. 18–19

E.1 DiffTime

  • DiffTime is a diffusion model that handles trend and fixed-value constraints; trend conditioning is soft, while fixed-point values are enforced at every reverse-process step.The trend is extracted from training series and can be specified by the user at inference; fixed values are retained in the final generated series.Source: §E.1 · pp. 19–20, E Diffusion Models · p. 19

E.2 Loss-DiffTime

  • Loss-DiffTime incorporates differentiable constraints through a penalty in the training loss.A new diffusion function must be trained for each new constraint.Source: §E.2 · pp. 20–21, §E.3 · p. 21

E.3 Guided-DiffTime

  • Guided-DiffTime guides a single unconstrained diffusion model during inference using gradients from a differentiable constraint, avoiding retraining for new constraints.The paper reports that this reduces the computational resources needed to handle new constraints and can reduce the carbon footprint.Source: §E.3 · p. 21

E.4 Modelling the diffusion function

  • The diffusion function uses a neural network based on a Transformer encoder, fully connected layers, and 1D convolutions, with conditioning incorporated alongside the input series.Convolution kernel size is tuned to the data; the default diffusion setup uses 50 steps and a quadratic noise scheduler.Source: E Diffusion Models · p. 19, §E.4 · pp. 21–22, Figure 6 · p. 22

F.1 Unconstrained generation

  • DiffTime and COP-method show better distributional overlap than benchmark algorithms in the unconstrained-generation t-SNE results.The figure uses results from earlier published work for the daily-stocks dataset rather than recomputing all approaches.Source: §F.1 · p. 22, Figure 7 · p. 23

F.2 Trend constraint

Across the constrained-generation experiments, the proposed methods are reported to balance constraint satisfaction with coverage of the input distribution. Results vary by constraint and model, with diffusion-step increases offering no reported improvement.

F.2 Trend constraint

  • For sinusoidal trends, the proposed approaches achieve the best Discriminative and Predictive scores and the closest distance to the input trend.The reported metrics include L2, DTW, and Fourier distance; the table covers soft-constraint generation with sinusoidal trends.Source: §F.2 · p. 24, Table 6 · p. 24

F.3 Fixed-values constraint

  • With two fixed values, DiffTime always satisfies both points and generates more varied series, while COP-method has the best example results but changes its input series little.DiffTime and COP-method are also reported among the best at covering the input distribution.Source: §F.3 · p. 25, Figure 11 · p. 25, Figure 12 · p. 25

F.4 Global Minimum constraint

  • Under a global-minimum constraint, the proposed methods better cover the input distribution and produce more diverse series than the other approaches.Most approaches satisfy the constraint in the examples.Source: §F.4 · p. 26, Figure 13 · p. 26, Figure 14 · p. 26

F.5 Multivariate constraint

  • For multivariate stock data, Guided-DiffTime and COP-method produce examples that respect the High-maximum and Low-minimum constraints.The reported t-SNE comparison also describes better input-distribution coverage for the proposed approaches.Source: §F.5 · p. 27, Figure 15 · p. 27, Figure 16 · p. 27

G.1 Diffusion steps

  • Increasing DiffTime’s steps from 50 to 100 or 200 does not improve the reported results, so the experiments use 50 steps.The t-SNE comparisons show similar performance across those step counts.Source: §G.1 · p. 28, Figure 17 · p. 28, Table 7 · p. 28

G.2 Noise Variance

  • The cosine noise scheduler performs poorly in the reported comparison, while the linear and quadratic schedulers better cover the input distribution.The experiment uses 50 diffusion steps with minimum noise level β1 = 1.0e-06 and maximum βT = 0.5.Source: §G.2 · p. 28, Figure 18 · p. 29, Table 8 · p. 29

G.3 Diffusion model architecture

The ablations examine model architecture, COP initialization and distance objectives, and Guided-DiffTime’s constraint scale. The additional computational-cost experiment reports lower emissions for Guided-DiffTime than for the compared alternatives.

G.3 Diffusion model architecture

  • The current Transformer-and-convolution architecture performs well, and the number of attention heads should be tuned to the input dataset.The comparison includes variants with different head counts, LSTM layers, and CNN layers.Source: §G.3 · p. 29, Table 9 · p. 29

G.4 COP-method Initial seed

  • COP-method produces realistic results with dataset, scaled Brownian-noise, or blended-series seeds, according to the reported comparisons.The quantitative metrics are described as confirming applicability across these seed types.Source: §G.4 · p. 29, Figure 19 · p. 30, Table 10 · p. 30

G.5 COP performance using different distance metrics

  • Both L1 and L2 objectives preserve distributional similarity, while L2 yields slightly better quantitative results.COP uses a distance objective to promote diversity when generating from initial seeds.Source: §G.5 · p. 30, Table 11 · p. 30, Figure 20 · p. 30

G.6 The impact of the scale parameter in Guided-DiffTime

  • For Guided-DiffTime under a global-minimum constraint, increasing ρ trades off realism to guarantee the constraints for all generated series.The section compares t-SNE results, generated examples, and quantitative metrics at varying ρ.Source: §G.6 · p. 31, Figure 21 · p. 31, Figure 22 · p. 31

H.1 The computational cost of constrained-generation

  • Guided-DiffTime is estimated to reduce emissions by around 60% versus COP-method and around 92% versus other deep generative models across 24 constraints.It uses one unconstrained DiffTime model for the different constraints; COP-method requires no training but has large inference time.Source: §H.1 · p. 32, Table 13 · p. 32

H.2 Longer time-series using DiffTime

Across longer-series and financial-property evaluations, DiffTime and COP retain performance, while COP fine-tuning improves OHLC constraint satisfaction. Guided-DiffTime accommodates new constraints without retraining.

H.2 Longer time-series using DiffTime

  • DiffTime and COP’s Discr. Score rose only 0.02 from length 36 to 360, versus at least 0.08 for other methods.TimeGAN and GT-GAN training time increases especially at length 360, while RCGAN and DiffTime training time increases only slightly; some RCGAN and TimeGAN samples show over 30% price changes in 36 days.Source: Table 14 · p. 33, §H.2 · p. 33

H.3 Financial properties

  • Our approaches better match real return and autocorrelation distributions; DiffTime best preserves volatility decay across lags 1–6.The comparison uses time series of length 36; RCGAN has an overly fat-tailed return distribution despite ranking among the best in Discr. Score.Source: §H.3 · pp. 34–35, Figure 27 · p. 35, Figure 26 · p. 35

H.4 Time-Series fine-tuning using COP

  • COP fine-tuning raised Guided-DiffTime satisfaction from 72% to 97.3% and TimeGAN from 51% to 89.7%.COP does not always reach 100% under current settings if doing so would damage original properties such as autocorrelation; Figure 28 indicates the data distribution is not highly affected.Source: §H.4 · p. 35, Table 15 · p. 36, Figure 28 · p. 36

I Extended related work comparison

  • Extended benchmarks include COSCI-GAN and RTSGAN; constrained comparisons add a violation-proportional penalty, while LS4 is excluded for its long continuous-time focus.COSCI-GAN targets multivariate series and RTSGAN handles variable-length, missing, and noisy sequences.Source: I Extended related work comparison · p. 36

I.1 Un-Constrained Generation

  • COP has the best distributional similarity; RTSGAN scores notably on Discr. and Pred. but has higher autocorrelation and shallower return distributions.RTSGAN’s financial-property comparisons refer to the properties assessed in Section H.3.Source: Figure 29 · p. 37, Figure 30 · p. 37, §I.1 · p. 37

I.2 OHLC-Constrained Generation

  • Under OHLC constraints, our methods outperform COSCI-GAN and RTSGAN on satisfaction; Guided-DiffTime accepts new constraints without retraining.COSCI-GAN and RTSGAN show similar performance to the proposed methods on distributional similarity, Discr. Score, and Pred. Score.Source: Table 17 · p. 37, §I.2 · p. 37

J Data Description

The section reports statistical properties for the datasets described in its tables.

J Data Description

Loading 2307.01717v2…