Table of Contents
Fetching ...

Constrained Posterior Sampling: Time Series Generation with Hard Constraints

Sai Shankar Narasimhan, Shubhankar Agarwal, Litu Rout, Sanjay Shakkottai, Sandeep P. Chinchali

TL;DR

Constrained Posterior Sampling (CPS) offers a training-free diffusion-based framework for generating time-series data that strictly satisfy hard, domain-specific constraints. By projecting the posterior mean after each denoising step onto the constraint set via a convex optimization, CPS achieves high-quality samples even with many constraints, and provides theoretical convergence guarantees under standard assumptions. Empirically, CPS outperforms state-of-the-art constrained generation baselines across finance, traffic, and environmental datasets, with significant improvements in similarity to real data and constraint satisfaction, while maintaining reasonable inference times. The approach eliminates the need for constraint-specific training or external realism enforcers, enabling scalable, provably-constrained time-series generation suitable for stress-testing and privacy-preserving synthetic data tasks.

Abstract

Generating realistic time series samples is crucial for stress-testing models and protecting user privacy by using synthetic data. In engineering and safety-critical applications, these samples must meet certain hard constraints that are domain-specific or naturally imposed by physics or nature. Consider, for example, generating electricity demand patterns with constraints on peak demand times. This can be used to stress-test the functioning of power grids during adverse weather conditions. Existing approaches for generating constrained time series are either not scalable or degrade sample quality. To address these challenges, we introduce Constrained Posterior Sampling (CPS), a diffusion-based sampling algorithm that aims to project the posterior mean estimate into the constraint set after each denoising update. Notably, CPS scales to a large number of constraints ($\sim100$) without requiring additional training. We provide theoretical justifications highlighting the impact of our projection step on sampling. Empirically, CPS outperforms state-of-the-art methods in sample quality and similarity to real time series by around 70\% and 22\%, respectively, on real-world stocks, traffic, and air quality datasets.

Constrained Posterior Sampling: Time Series Generation with Hard Constraints

TL;DR

Constrained Posterior Sampling (CPS) offers a training-free diffusion-based framework for generating time-series data that strictly satisfy hard, domain-specific constraints. By projecting the posterior mean after each denoising step onto the constraint set via a convex optimization, CPS achieves high-quality samples even with many constraints, and provides theoretical convergence guarantees under standard assumptions. Empirically, CPS outperforms state-of-the-art constrained generation baselines across finance, traffic, and environmental datasets, with significant improvements in similarity to real data and constraint satisfaction, while maintaining reasonable inference times. The approach eliminates the need for constraint-specific training or external realism enforcers, enabling scalable, provably-constrained time-series generation suitable for stress-testing and privacy-preserving synthetic data tasks.

Abstract

Generating realistic time series samples is crucial for stress-testing models and protecting user privacy by using synthetic data. In engineering and safety-critical applications, these samples must meet certain hard constraints that are domain-specific or naturally imposed by physics or nature. Consider, for example, generating electricity demand patterns with constraints on peak demand times. This can be used to stress-test the functioning of power grids during adverse weather conditions. Existing approaches for generating constrained time series are either not scalable or degrade sample quality. To address these challenges, we introduce Constrained Posterior Sampling (CPS), a diffusion-based sampling algorithm that aims to project the posterior mean estimate into the constraint set after each denoising update. Notably, CPS scales to a large number of constraints () without requiring additional training. We provide theoretical justifications highlighting the impact of our projection step on sampling. Empirically, CPS outperforms state-of-the-art methods in sample quality and similarity to real time series by around 70\% and 22\%, respectively, on real-world stocks, traffic, and air quality datasets.

Paper Structure

This paper contains 38 sections, 12 theorems, 100 equations, 12 figures, 9 tables, 1 algorithm.

Key Result

Theorem 4.2

Suppose Assumption assumption:1 holds. Given a denoiser $\epsilon_\theta : \mathbb{R}^n \rightarrow \mathbb{R}^n$ for a diffusion process with noise coefficients $\bar{\alpha}_0, \dots, \bar{\alpha}_T$, if $\gamma(t) > 0 \ \forall \ t \in [1,T]$, the denoising step in Algorithm alg: constrained synt Here, the PDF of $\mathcal{N}\left(\hat{z}_{0, \mathrm{pr}}(z_1; \epsilon_\theta), \sigma_1^2 \math

Figures (12)

  • Figure 1: Our Proposed Constrained Posterior Sampling (CPS).CPS is a novel diffusion-based sampling approach to generate time series samples that satisfy hard constraints. Here, we show an example where CPS generates a daily stock price time series with natural constraints such as the bounds on the opening and closing prices of the stock.
  • Figure 2: CPS outperforms the best-performing baselines on the Dynamic Time Warping (DTW) distance that measures the similarity between the real and the generated samples by 22% and the Discriminative Score (DS), which is the classification error of a model trained to differentiate real and synthetic data, by 70%.
  • Figure 3: Constrained Posterior Sampling - We show the graphical model for one step of denoising in CPS: refer to Algorithm \ref{['alg: constrained synthesis']}.
  • Figure 4: CPS provides high-fidelity synthetic time series samples that match real time series data. The real test samples from which the constraints are extracted are shown in blue. The samples generated using the extracted constraints are shown in red. Across all datasets, the baselines suffer from the adversarial effects of the projection step, whereas CPS generates high-quality samples. Here, we provide the comparison against baselines coletta2024constrained designed for constrained time series generation. We refer the readers to Appendix \ref{['sec:app_qualitative']}, where we included similar qualitative comparisons against other baselines (Diffusion-TS and PDM) that were adapted to perform constrained generation.
  • Figure 5: CPS outperforms baselines on sample quality for an increasing number of constraints. We gradually increase the number of constraints imposed on the generative model to evaluate CPS and other baselines that guarantee constraint satisfaction for linear constraints. CPS (green) achieves the lowest DTW score for any number of constraints while having the best sample quality, indicated by the lowest FTSD metric. This result is coherent with the qualitative example shown in Figure \ref{['fig:selling']}.
  • ...and 7 more figures

Theorems & Definitions (22)

  • Theorem 4.2
  • Theorem 4.4
  • Lemma C.1
  • proof
  • Lemma C.2
  • proof
  • Lemma C.3
  • proof
  • Lemma C.4
  • proof
  • ...and 12 more