logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·30.10.26
← Back to news

Can you use autoregressive diffusion to generate market data?

Original article
blog.janestreet.com|156 points|45 comments|by jsomers|Oct 9, 2026

Can Autoregressive Diffusion Synthesize Market Data?

Originally published on the Jane Street Blog Date: September 30, 2026 | Reading Time: ~9 minutes Author: James Somers

This article is part of a broader series detailing the outcomes of the 2026 summer internship program, specifically the "What the interns have wrought, special jumbo 2026 edition."


The Objective: Beyond Point Estimates

In the realm of quantitative finance, the standard approach involves consuming a stream of market events—such as the addition of resting orders, cancellations, or executions—to forecast a symbol's future price. However, imagine a more ambitious model: one that doesn't just predict a price, but synthesizes the actual sequence of book events, including the precise timing of their arrival.

Such a model would provide price predictions, but the resulting "rollouts" would possess a level of texture and granularity far beyond a simple numerical estimate.

The Nature of the Data

Market data presents a unique challenge because it exists in a hybrid state:

  • Discrete Elements: The order book evolves through specific actions (a "turn-based" system of adding or removing orders).
  • Pseudo-Continuous Elements: Parameters like price have such high cardinality that they behave like continuous variables.
  • Truly Continuous Elements: The timing of an event (the interval between arrivals) is inherently continuous.

Furthermore, these distributions are not smooth; they are "spiky." For example, "pennying" (improving a price by a single tick) occurs far more frequently than larger jumps, and events often cluster around whole-number timestamps.


The Experimental Approach

To explore these dynamics, a research intern named Kavish developed a diffusion model designed for market data. While diffusion and flow-matching are typically used for multimodal sequential data like audio→video→robotics\text{audio} \rightarrow \text{video} \rightarrow \text{robotics}audio→video→robotics, Kavish adapted these concepts for finance.

Drawing inspiration from the paper Autoregressive Image Generation without Vector Quantization, he built an event-level generative model using autoregressive diffusion.

Project Goals

  • Implement an encoder-diffuser architecture.
  • Compare DDPM against Flow Matching.
  • Address the "jaggedness" of market data.
  • Generate realistic continuous features (price, time).

Model Architecture

Kavish utilized four years of US equities data. Each data point consisted of a timestamp, price, event type (trade, order, cancel, etc.), and auxiliary metadata.

The Pipeline

The model employs a causally masked transformer encoder to generate a latent embedding for each position in the sequence.

  1. Event-Kind Head: A small head that outputs a 2-categorical probability distribution to decide if the next event is a Trade or a BBO (Best Bid and Offer) update.
  2. Diffusion Head: This generates continuous targets (like price and time). It is conditioned on the latent embedding and the sampled event-kind using AdaLN (Adaptive Layer Normalization).

Inference Logic: Last Event Latent →\rightarrow→ Event-Kind Head →\rightarrow→ Sample Event →\rightarrow→ Diffusion Head →\rightarrow→ Continuous Features.


Flow Matching vs. DDPM

A critical part of the research involved comparing two different parameterizations of the generative objective.

Comparison Table: Generative Methods

FeatureDDPM (Denoising Diffusion Probabilistic Models)Flow Matching (Rectified Flows)
Core MechanismPredicts the noise added to a sample.Predicts the velocity along a linear path.
TrajectoryOften curved/stochastic.Nearly straight lines between noise and data.
StabilityProne to divergence at high noise levels.Highly stable; integrates accurately in few steps.
OutcomeUnstable for this datasetPerformed well out-of-the-box

The Failure of DDPM

Kavish initially used a 1,000-step cosine schedule (per Improved DDPM). This proved unstable, leading to "exploding" trajectories.

The Result: Approximately 88% to 95%88\% \text{ to } 95\%88% to 95% of the generated values were more than 8σ8\sigma8σ (eight standard deviations) away from the mean across all seven continuous targets.

Divergence Visualization In the leftmost box of the original data, trajectories (pink filaments) quickly diverge to the edges of the distribution.

While adding stochasticity (ϵ\epsilonϵ) or increasing sampling steps can mitigate this, Rectified Flows provided a much more robust solution without extensive tuning.


The Challenge of Discontinuity

The primary struggle of the project was the "hybrid" nature of the data. Unlike video—where pixel intensities change continuously—market data is characterized by point masses and sharp discontinuities.

Key takeaway: Fully continuous diffusion struggles with the "jaggedness" of real-world markets. Kavish's attempts to resolve this included:

  • Smoothing: Attempting to blur point masses.
  • Discretization: Treating some continuous targets as discrete categories.

These experiments provided vital clarity on the requirements for a future, fully functional generative model of market data.

Summary of the Generation Process

def generate_next_event(latent_history):
    # 1. Predict the type of event
    event_type = event_kind_head(latent_history[-1]).sample()
    
    # 2. Generate continuous values via Flow Matching
    # Conditioned on latent and event_type
    continuous_features = diffusion_head.sample(latent_history[-1], event_type)
    
    return {
        "type": event_type,
        "features": continuous_features
    }