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.
