Synthetic FX Market Data with Diffusion Models and GANs: Building Realistic Stress Scenarios for Backtests

How diffusion models and GANs create realistic synthetic FX data, design stress scenarios for robust backtests, and follow evaluation best practices.

Frustrated businesswoman in green blouse analyzing a graph showing financial loss.

Introduction — Why synthetic FX data matters for backtests

High-quality synthetic FX market data lets quants perform larger, safer backtests, explore rare-tail or regime-change scenarios, and run repeatable stress tests without exposing proprietary live feeds. Synthetic generation is no longer limited to simple bootstraps or parametric models: modern generative ML—chiefly diffusion-based score models and adversarial networks (GANs)—now produce multivariate, temporally-coherent scenarios that capture dynamics important to FX risk and execution. Recent research demonstrates both the promise and specific limitations of these approaches for financial time series.

This article explains how diffusion models and GANs differ in principle and practice, how to condition them for stress‑scenario generation for FX backtests, how to evaluate synthetic series for realism and tail behaviour, and practical implementation and governance considerations for quant teams.

Technical comparison — Diffusion models vs GANs for time series

GANs (Generative Adversarial Networks) generate samples by training a generator to fool a discriminator. Time-series specific variants (TimeGAN and related architectures) add supervised/autoencoder components and recurrent layers to preserve temporal relationships, and are widely used as baselines for synthetic sequential data. TimeGAN (and public implementations) remain a go-to tool for many practitioners, but adversarial training can suffer from instability, mode collapse and difficulties in reproducing tail extremes reliably.

Diffusion and score-based models (DDPMs, Score SDEs and conditional variants) generate data by learning to reverse a gradual noise process: training minimizes denoising/score objectives and sampling integrates the learned reverse dynamics. Conditional score/diffusion models (e.g., CSDI and later extensions) have been adapted for multivariate time-series tasks like imputation, conditional generation and forecasting; they provide principled probabilistic samples and tend to be more stable to train than adversarial networks for many sequence tasks. Recent domain‑specific diffusion variants explicitly model factor structure or multi‑scale temporal dynamics to better capture cross‑asset correlations and rare jumps in returns.

When each method is preferable

  • GANs: efficient at matching marginal/distributional features, useful when you need many fast samples and the generator is tuned to preserve particular stylised facts (e.g., volatility clustering) but expect training instability and careful regularisation.
  • Diffusion models: often better at calibrated, probabilistic sampling and representing multi-modal or tail behaviours when trained with conditional inputs — which is useful for stress‑scenario design and probabilistic backtesting.

Empirical research in 2023–2025 shows promising diffusion-based architectures tailored to financial returns and high-dimensional asset sets (factor-aware and multi-scale designs), suggesting diffusion methods are becoming competitive or superior for risk-sensitive synthetic generation when properly conditioned.

Designing realistic stress scenarios for FX backtests

Practical stress-scenario generation uses conditional or guided sampling so synthetic series reflect both the baseline market dynamics and the shock you want to study. Key elements:

  • Conditioning variables: anchor synthetic samples on observed state: volatility level, funding spreads, cross‑asset indices (e.g., USD index, Treasury yields, crypto flows), or recent order‑flow metrics so the model generates plausible paths starting from real states.
  • Shock injection: apply conditional inputs representing macro events (large rate surprise, liquidity freeze, corridor de‑pegging) or directly alter diffusion priors (larger noise, jump components) to produce tail paths for drawdown and margin-stress testing.
  • Factor structure & cross-sectional coherence: for multi‑pair portfolios use models that preserve factor correlations or impose a factor decomposition in the score function to avoid generating inconsistent cross-asset moves. Recent diffusion factor-model work formalises this idea for high‑dimensional return generation.
  • Scenario ensembles: run many conditional samples across alternative severity parameters (mild, severe, extreme) and seed choices; evaluate portfolio P&L, liquidity metrics (bid-ask widening), and margin sensitivity across the ensemble.

Evaluating realism and safety is essential. The literature emphasises a multi-criteria approach (discriminative vs predictive vs statistical metrics) because no single score captures realism for sequences: use discriminators/classifiers, predictive utility (train-on-synthetic / test-on-real), distributional distances, and tail-specific tests (extreme value metrics) together. A recent survey provides a taxonomy of evaluation measures for synthetic time series.

For FX backtests specifically, add execution and liquidity realism: synthetic mid-price moves should be paired with slippage/fill models (microstructure replay or calibrated execution simulators) and synthetic order-book or depth proxies where possible, otherwise stress tests will understate execution losses. Practical vendor reports and industry reviews note both benefits and risks of synthetic data in investment management.

Implementation, tooling, and governance checklist

Tooling & implementations

  • Start with public reference code: TimeGAN repositories for GAN baselines and public diffusion/time-series repositories (CSDI-based and more recent forks) for score-based models. Example TimeGAN codebases are available on GitHub.
  • Frameworks: build prototypes in PyTorch/TensorFlow; for diffusion experimentation you can reuse diffusion schedulers and training patterns from libraries (e.g., Hugging Face Diffusers for scheduler/optimizer ideas), adapting architectures to 1D multivariate data and sequence-aware U‑Nets, Transformers or state‑space blocks.
  • Compute: diffusion sampling is typically slower than GAN forward passes; budget for more sampling compute and consider accelerated samplers (fewer reverse steps) or conditional samplers for scenario generation.

Model risk & governance

  • Benchmark synthetic outputs against holdout real periods and use train-on-synthetic / test-on-real predictive checks to detect overfitting or memorisation.
  • Keep an audit trail: dataset versions, conditioning schema, random seeds, severity parameter ranges, and evaluation reports (including tail tests and liquidity stress metrics).
  • Document limitations: explicitly state that synthetic samples are model‑dependent, may under/over-state jump frequencies, and are not a substitute for live stress-testing with real market data where available. Academic and industry papers caution about naive VaR uses and backtest leakage when synthetic generators are not robustly validated.

Recommended workflow (practical)

  1. Define stress scenarios and conditioning variables (e.g., large USD shock, funding squeeze, stablecoin freeze).
  2. Train baseline generator (GAN and diffusion) on historical multivariate FX windows including microstructure proxies where possible.
  3. Produce ensembles via conditional sampling; apply execution models to convert mid-price paths to simulated fills.
  4. Evaluate with multi-criteria metrics (discriminator scores, predictive utility, tail tests, and liquidity checks) and select model/parameters that pass governance gates.

Conclusions & practical takeaways

Diffusion models and GANs are complementary tools for synthetic FX generation. GANs remain useful for fast sampling and matching certain distributional properties, while conditional diffusion/score models are maturing rapidly and offer probabilistic, stable sampling better suited to scenario‑based stress testing and tail capture when architectures are adapted for temporal, cross‑asset structure. Recent domain work (factor-aware diffusion and multi-scale temporal models) demonstrates promising improvements for high‑dimensional FX portfolios.

For production use in backtests: condition generators on realistic market state, prioritise multi‑metric evaluation (with explicit tail/liquidity checks), maintain rigorous versioning and audit trails, and treat synthetic outputs as an augmentation to — not replacement for — real historical stress tests and forward-looking liquidity analysis. Finally, always validate that synthetic‑trained strategies generalise to out-of-sample real data before live deployment.

Suggested next steps for quant teams: (1) reproduce a TimeGAN baseline, (2) implement a conditional CSDI/diffusion prototype on a single currency pair with volatility conditioning, (3) add execution modelling and multi‑criteria evaluation, then iterate to multi‑pair factor-aware diffusion if required.

Related Articles

Creative concept depicting a hand reaching towards abstract swirling particles.

AI Governance for Retail Quants: Model Cards, Audit Trails and Regulatory‑Ready Documentation

Governance playbook for retail quant traders: create model cards, tamper‑resistant audit trails, validation reports and regulator‑ready documentation now

Multicolored ribbons create a flowing abstract design on a grey background.

Feeding FX Momentum Models with On‑Chain Liquidity & Flow Metrics

Practical features and a vendor checklist for feeding FX momentum models with on‑chain liquidity and stablecoin flow metrics.

Collection of abstract shapes in diverse textures and colors, evoking artistic and conceptual themes.

Data Vendor Economics After the Consolidated Tape: Cost‑Effective FX Feed Design

Design cost‑efficient FX feeds for backtests and live models after consolidated‑tape changes. Vendor selection, sampling, storage, latency tradeoffs and implementation checklist.