Can you use autoregressive diffusion to generate market data?
TL;DR Highlight
Flow matching and atom smoothing helped diffusion handle spiky market data distributions
Who Should Read
An ML engineer building generative models for event data that mixes continuous and discrete values like timestamps and prices
Core Mechanics
- Market data is neither continuous nor discrete
- Order types are discrete actions, while price and arrival time look continuous.
- Distributions are spiky, so a normal-distribution assumption fails.
- DDPM blew up, flow matching worked
- A 1,000-step cosine schedule with DDIM was unstable, with 88-95% of values over 8 standard deviations from the mean on all 7 continuous targets.
- Flow matching worked well out of the box.
- Splitting classes handled zero time gaps
- Trades were only 8% of events, so the categorical head overpredicted trades.
- A 20-class head improved the distributions but took a lot of hand-engineering.
- Atom smoothing handles spikes
- It smooths the spiky distribution, then re-sculpts the spike to keep its probability mass.
- The variable representation matters because spikes look different under different representations.
- Evaluated with marginals and a classifier
Community Reactions
- Comment adding an explanation for the stability gap
- One commenter cited Heitz 2023: DDIM has a 1/α term that diverges at the start of denoising, while flow matching does not.
- Opinion that a decoder could be the fix
- One commenter said image latent diffusion needs a special GAN-trained decoder, and a similar one might have solved the problem.
- Pushback on the arrival-time distribution
- One commenter noted that arrivals boost the probability of others, Hawkes-like, so there was no reason to expect normality.
- Doubt about the evaluation metric
- One commenter questioned whether least squares is the right metric, since a delayed price model is worthless.
How to Apply
- Check your event data for spikes first
- Plot histograms of time gaps and price changes to see clumping at zero or whole-number seconds.
- If you see clumping, don't use a normal-distribution model as is.
- Switch to flow matching if diffusion training diverges
- If a DDPM parameterization diverges, predict velocity (data minus noise) instead of noise.
- Split targets into categorical and continuous
- Predict point-mass values like zero time gaps as categories and use diffusion only for the remaining magnitude.
- Try atom smoothing too, since classes explode as features grow.
- Evaluate generated data with a classifier
- Train a classifier on real context plus a candidate event to tell real from model output.
- Use it alongside per-feature marginal comparisons.
Try It
# Paste into Claude or ChatGPT (simplified version of the method: distribution diagnosis)
I'm building a generative model for event data. Based on the feature descriptions and sample below, diagnose the distributions.
Feature descriptions: {{feature list and meanings}}
Sample data: {{CSV excerpt}}
For each feature, answer:
1. Whether it likely has a point mass (spike) at zero or a specific value
2. Whether to treat it as continuous or categorical, and why
3. Alternative representations that might make the spike less sharp (e.g. differences, ratios, offset from the midpoint)
Next: plot histograms as recommended and check for yourself.Terminology
Related Papers
The Judge Can Debias Itself: Awareness and Self-Debiasing for Reliable LLM-as-a-Judge
Warning an LLM judge about bias or letting it self-critique improved 20 of 21 model–bias combinations.
90% of US working hours are spent on tasks not covered well by AI benchmarks
Mapping 29 benchmarks to job tasks shows 90% of US working hours lack good coverage
Postgres 19 delayed after AI reviewers find more bugs than humans can fix
LLM code review surfaced so many bugs that Postgres 19 slipped to November and 8-10 features were reverted
Show HN: Gemini 4 Argon plays StarCraft
LLMs wrote StarCraft bots in one hour; GPT-6 Astra scored highest.
A Plausible Explanation Is Enough to Mislead Multimodal Judges
Adding plausible explanations to fixed answers cut MLLM judges' wrong-answer rejection by 12.7–13.8 points.
Neural networks are clean
Looking at neurons directly shows most have one main job, challenging superposition.