We study the conditional distribution of limit-order volume submitted over the next five minutes, given the current order book and recent order flow. The task requires capturing price placement, total volume, and predictive uncertainty jointly. Coordinate-wise diffusion losses do not explicitly account for price displacement, while normalizing fields to unit mass removes information about total volume. Agreement on selected summary statistics also does not establish fidelity to the joint field distribution. We introduce OrderFlowDiT, a conditional Diffusion Transformer for unnormalized bid and ask volume-at-price fields, trained with an unbalanced optimal-transport (UOT) auxiliary loss. We also develop a full-field evaluation framework that combines a transport cost sensitive to price placement and total volume with proper scoring rules and calibration diagnostics. In the primary comparison on 1950 validation conditions across 30 U.S. equities, adding UOT reduces full-field transport cost by 45.8% and the transport energy score by 26.1% relative to training with mean squared error alone. Both measures improve for every stock. These findings support incorporating price geometry and volume into generative modeling, with field accuracy and predictive uncertainty evaluated together.
Figures & tables
Figure 1. The data at one forecast boundary, within 300 ticks of the mid-price: the book snapshot Xk , the observed field Ak− , and the target field Ak+ . Ask volume is drawn upward and bid volume downward; both are non-negative, unnormalized share counts, and the two flow panels share a vertical scale. This view holds 53% of the submitted volume and 1.2% of the resting depth; the rest lies farther from the mid. Three panels side by side: the book snapshot, the observed submission field, and the target submission field, each plotted against price offset from the mid-price over a range of three hundred ticks either side.
Figure 2. Forecast timing in the contemporaneous-snapshot setting. All windows are left-closed and right-open; the target begins at the forecast boundary. A timeline with two adjacent windows of equal duration. Observed submission flow occupies the window before the forecast boundary, and future submission flow occupies the window after it. The book snapshot at the boundary contains only events with earlier timestamps.
Figure 3. OrderFlowDiT-Base. Every field shares the one-tick, mid-anchored price grid of Section 3.3 , so a bin refers to the same price in the noisy target Zn and in all six conditioning channels of Ck : book depth Xk , the two best-quote indicators, and observed flow Ak− . Patches of P=16 bins are embedded separately for target and conditioning and summed; bins padding the grid to whole patches are masked. Base-MSE trains on the masked velocity loss alone, whereas the Base-UOT term is evaluated on the decoded field A^ in shares rather than in velocity space. GRPO (Section 4.4 ) fine-tunes this same network. A left-to-right schematic of the conditional diffusion transformer. On the left, eight horizontal strips stacked over a shared mid-anchored price axis show the two noisy target channels above the six conditioning channels: bid and ask book depth, bid and ask best-quote indicators, and bid and ask observed flow. A highlighted vertical slice marks one patch of sixteen price bins. Separate patch embeddings for target and conditioning are summed with a positional encoding to form a sequence of price tokens, which pass through twelve transformer blocks and a linear head that outputs a two-channel velocity field. A global conditioning vector, built from the diffusion step, summary features, instrument identity, window duration and the mean condition token, modulates each block through AdaLN-Zero. On the right, the velocity feeds the masked mean-squared-error objective, and a second branch decodes it to a predicted field in shares that is compared with the realized field by an unbalanced transport term used only by the UOT variant. A dashed arrow returning to the target channels marks the fifty-step DDIM sampling loop.
Quantity
Role
dfull
Price placement and volume cost
EST
Proper transport-based score
ES2
Strictly proper joint-field score
Volume CRPS
Strictly proper side-volume score
Sided W1
Shape diagnostic in ticks
NTVE
Relative-volume diagnostic
Table 1. Evaluation quantities and their roles. Costs, errors, scores, and RI are lower-is-better. Propriety refers to population scores on the domains stated in the text.
Model
R
dfull/106
EST
ES2
CRPS
Sided W1
NTVE
MSElog
Skew-normal
1
450.515
14.995
0.794
0.317
733.904
0.328
0.722
Skew-normal mixture
1
109.510
4.154
1.452
0.317
191.888
0.328
2.433
Empirical
4
95.698
2.018
0.496
0.283
166.599
0.756
0.934
Base-MSE
4
110.829
2.152
0.414
0.460
149.220
1.058
0.656
Base-UOT
4
60.074
1.591
0.387
0.283
123.552
0.447
0.599
Base-GRPO
4
62.025
1.494
0.409
0.243
107.705
0.382
0.549
Table 2. Main comparison on 1,950 conditions. All seven metrics are lower-is-better; bold marks the lowest displayed value in each column. The full-field cost is reported in 106 share ⋅ ticks and sided W1 in ticks. CRPS denotes log-total-volume CRPS. The mixture uses Kmax=2 . The R=1 rows are point-mass forecasts.
Figure 4. Realized and Large-UOT submission fields within 100 ticks of the mid-price on identical axes: ask shares upward, bid downward. The condition is nearest the median Large-UOT energy score among mid-session conditions on this instrument. Total volumes are 1.94 M and 1.49 M shares, respectively; only roughly a quarter of each field’s volume lies in the displayed range. Two panels on identical axes spanning one hundred ticks either side of the mid-price. The left panel is the realized submission field, with ask volume above a zero line and bid volume below it; the right panel is one draw from the Large-UOT model. Both show an ask mode just above the mid-price and bid volume spread further below it, of comparable height and width.
Quantity
Base-UOT
Base-GRPO
EST
1.591
1.494
Target distance TT
2.897
2.510
Inter-draw distance DT
2.611
2.033
ES2
0.387
0.409
Target distance T2
0.722
0.686
Inter-draw distance D2
0.670
0.553
Table 3. GRPO comparison on the same lag0 conditions ( R=4 ). For each energy-score geometry j∈{T,2} , Tj is the mean target distance and Dj the mean off-diagonal inter-draw distance, so ESj=Tj−Dj/2 . Interior-rank coverage has nominal value 0.600 . Distance components and coverage are diagnostics, without a common lower-is-better direction.