Source-linked AI summary
UQ-LOB: Uncertainty-Aware Limit Order Book Mid-Price Forecasting
Derrick Gilchrist Edward Manoharan, Eljas Linna, Kestutis Baltakys, Hao Dong, Juho Kanniainen
TL;DR
Deep LOB forecasters typically predict direction or displacement without indicating which forecasts are trustworthy. UQ-LOB adds context-conditioned predictive uncertainty to pretrained encoders, and its confidence gating improves directional reliability across assets and horizons.
Problem
Most deep LOB forecasters are point predictors that provide no indication of forecast reliability, although trading decisions incur fees and slippage.
Source: §1 · p. 2Method
UQ-LOB attaches regression or classification uncertainty heads to pretrained LOB encoders and conditions forecasts on recent completed windows with realised outcomes.
Source: §1 · p. 2Results
At the top confidence decile, directional macro F1 rises by 0.11–0.15 for regression and 0.05–0.11 for classification; regression has near-nominal 68% coverage and reaches F1 of 0.88 (down) and 0.83 (up) on large 5-second moves.
Source: §6 · p. 9Takeaways & Limitations
Across seven cryptocurrency assets and three horizons, a regression head matches the dedicated classifier at the top decile while also supplying magnitude and a calibrated interval.
Source: §6 · p. 9The comparison is between two UQ heads on a shared trunk; weight-space uncertainty, base-encoder confidence gating, multi-seed error bars, and loss and context-set ablations remain untested.
Source: §7 · p. 9
Abstract
from arXiv · showhide
Forecasting short-horizon mid-price movements from limit order book (LOB) data is central to algorithmic trading, yet most deep LOB forecasters are point predictors: they output a direction or a displacement, but never indicate which of their forecasts can be trusted. We introduce UQ-LOB, a lightweight, encoder-agnostic uncertainty quantification module that attaches to any pretrained LOB encoder and, in the spirit of attentive neural processes, conditions each forecast on a context set of recently completed windows whose outcomes are already realised. The UQ-regression variant outputs a calibrated Gaussian over the future tick displacement, while the UQ-classification variant outputs a categorical distribution over down/up/stationary. Both expose a scalar confidence (predicted signal-to-noise ratio or class probability) that supports selective prediction. On 5.2 billion LOB events across seven cryptocurrency assets and horizons of 5, 10 and 15 seconds, UQ-regression attains near-nominal 68% interval coverage, and restricting to the most confident 10% of predictions raises directional macro F1 by 0.11-0.15 for UQ-regression and 0.05-0.11 for UQ-classification, at every horizon. On large, economically meaningful moves, the tightest confidence tier reaches a directional F1 of 0.88 (down) and 0.83 (up) at the 5-second horizon.
1 INTRODUCTION
Deep LOB forecasters usually predict a direction or displacement without indicating whether it is reliable, despite rapidly varying predictability and trading costs. UQ-LOB adds context-conditioned uncertainty to pretrained encoders and evaluates whether confidence supports selective forecasting.
1 INTRODUCTION
- The LOB aggregates resting bids and asks by price level; the best bid and ask define the spread, and their midpoint is the asset's instantaneous valuation.Frequent order events carry microstructural signal about price formation over the next few seconds.Source: §1 · p. 1
- Most deep LOB forecasters emit a direction or displacement without calibrated, input-dependent uncertainty, although trading actions incur fees and slippage.The practical question is whether a forecast is reliable enough to act on.Source: §1 · p. 2
- UQ-LOB conditions forecasts on recently completed windows with realised outcomes, attaching an uncertainty head to a pretrained encoder without requiring gradient updates.The regression output is a Gaussian over tick displacement, with |µ|/σ as confidence; Figure 1 depicts its predictive intervals.Source: §1 · p. 2, Figure 1 · p. 2
- UQ-LOB instantiates regression over tick displacement and classification over three directional classes, addressing a gap in calibrated, input-dependent uncertainty for mid-price forecasting.Source: §1 · p. 2
- The regression head combines heteroscedastic likelihood, magnitude weighting, a directional margin, and a differentiable magnitude-conditional calibration penalty.The calibration penalty turns post-hoc calibration metrics into a training signal.Source: §1 · p. 2
- The classification counterpart predicts down, up, or stationary and uses maximum class probability as confidence, enabling a matched-parameter comparison with regression.Source: §1 · p. 2
- On 5.2 billion events across seven assets and three horizons, confidence gating improves directional reliability at every horizon; regression matches the classifier at the top confidence decile while also providing magnitude and calibrated intervals.The evaluation uses directional macro F1, a magnitude-restricted analysis, and prior-matched random baselines.Source: §1 · p. 2
2 RELATED WORK
LOB forecasting has developed from next-event prediction to horizon-based mid-price direction and increasingly varied neural architectures, but these approaches remain point predictors. Prior uncertainty methods use weight uncertainty or fixed quantiles, while calibration, selective prediction, and neural-process work motivate UQ-LOB's context-conditioned approach.
2 RELATED WORK
- LOB direction forecasting progressed from CNNs and LSTMs to bilinear and attention-based models, pretrained Transformers, and BERT-style encoders, while remaining point prediction without confidence.Next-message prediction is also common, with errors compounding as the effective horizon grows.Source: §2 · pp. 2–3
- Quantile regression predicts fixed ask- and bid-side quantiles, while BDLOB and Bayesian bilinear networks derive uncertainty from network-weight distributions and require multiple stochastic inference passes.UQ-LOB instead predicts input-dependent aleatoric uncertainty in a single pass, conditioned on recently realised outcomes.Source: §2 · p. 3
- Post-hoc recalibration, ensembles, and conformal methods can improve calibration but do not alone make uncertainty input-dependent; predictive uncertainty can also degrade under financial distribution shift.Source: §2 · p. 3
- Selective prediction and maximum softmax probability provide the evaluation lens, while neural processes motivate conditioning predictive distributions on observed context sets.UQ-LOB adapts this context formulation to recently completed LOB windows whose labels are already realised.Source: §2 · p. 3
3 UQ-LOB: THE UNCERTAINTY QUANTIFICATION HEAD
UQ-LOB equips pretrained LOB encoders with predictive distributions conditioned on recently completed windows and their realised outcomes.
3 UQ-LOB: THE UNCERTAINTY QUANTIFICATION HEAD
- UQ-LOB operates on a pretrained encoder’s hidden representation and conditions each target’s predictive distribution on a context set of recent windows and realised labels.The head can use any pretrained LOB encoder as its starting point.Source: §3 · p. 3
3.1 PROBLEM SETUP AND LABELS
- The regression target is a latency-adjusted future mid-price displacement in ticks, while classification thresholds that same displacement using a volatility-scaled cutoff.The start price is measured after a small fixed delay, and the end price averages the ten events preceding the forecast horizon.Source: §3.1 · p. 3
3.2 IN-CONTEXT CONDITIONING
- The context uses the most recent preceding windows whose labels are already known at prediction time, preventing future-price leakage.The same causal construction is used during training, validation, and testing.Source: §3.2 · p. 4
3.3 HEAD ARCHITECTURE
- The target queries a refined context through cross-attention, retrieving label-informed summaries with greater weight for similarly structured LOB states.The decoder produces either a Gaussian over tick displacement or three class logits.Source: §3.3 · pp. 4–5, Figure 2 · p. 4
3.4 TRAINING OBJECTIVES
- Regression training combines heteroscedastic likelihood, magnitude-weighted MAE, a directional margin, and magnitude-conditional calibration to shape the mean and uncertainty.Calibration is enforced separately for small and large predicted moves.Source: §3.4 · p. 5
3.5 CONFIDENCE SCORES AND SELECTIVE-PREDICTION PROTOCOL
- Regression confidence is |µ|/σ and classification confidence is maximum softmax probability; evaluation gates by confidence and reports directional macro F1, interval coverage, NLPD, and magnitude-weighted R2.Magnitude-weighted R2 focuses on moves that cross the stationary threshold, which the text identifies as the moves that matter after fees.Source: §3.5 · pp. 5–6
4 EXPERIMENTAL SETUP
The experiments use chronological Kraken data splits, event-based input features, and a pretrained D-TABL encoder with a fine-tuned UQ-LOB head.
4.1 DATASET
- The dataset contains about 5.2 billion Kraken events across seven USD-quoted crypto assets from November 2025 to February 2026, with chronological training, validation, and out-of-sample test periods.The raw data cannot be redistributed, but code, label thresholds, scale values, and dataset statistics are released.Source: §4.1 · p. 6
4.2 INPUT REPRESENTATION
- Each 512-event window uses a 439-entry event-token vocabulary and seven continuous features, including depth-normalised flow imbalance, its 50- and 200-event cumulative sums, and queue imbalance.Events deeper than ten levels are discarded.Source: §4.2 · pp. 6–7
4.3 ENCODER, TRAINING AND MODEL SIZE
- The study uses a pretrained D-TABL encoder and fine-tunes it with UQ-regression or UQ-classification; both variants total 1.23M parameters.Training all 42 asset–horizon models requires about 210 GPU-hours on one NVIDIA GH200.Source: §4.3 · p. 7
5 RESULTS
UQ-regression achieves near-nominal 68% interval coverage, and confidence gating improves directional performance for both heads. At the top confidence decile, regression matches or exceeds classification, with especially strong results on large moves.
5.1 CALIBRATION OF THE REGRESSION HEAD
- 68.1–68.2% empirical 68% coverage is near nominal across horizons, but 95% intervals cover only 90.4–90.7% because residuals are heavier-tailed than Gaussian.The calibration constraint enforces the one-sigma level, not the tails.Source: §5.1 · p. 7, Figure 3 · p. 7, Table 3 · p. 9
5.2 CONFIDENCE GATING
- 0.42 to 0.57 at 5 s, 0.41 to 0.55 at 10 s, and 0.40 to 0.51 at 15 s: UQ-regression directional macro F1 rises with SNR gating.The increase is monotone over the confidence-percentile range for every asset, with DOGE at 15 s the only mild exception at the highest tiers.Source: §5.2 · p. 7, Figure 5 · p. 8, Table 1 · p. 8
- Gated top-decile scores should not be compared with the full-set random reference, because gating changes the retained subset’s class mix.The prior-matched reference rises as the retained subset becomes more directional.Source: §5.2 · p. 8, Table 1 · p. 8
- 0.45 to 0.56 at 5 s, 0.45 to 0.50 at 10 s, and 0.45 to 0.52 at 15 s: UQ-classification directional macro F1 rises monotonically with softmax gating.Softmax confidence is a reliable ranking signal for this head.Source: §5.2 · p. 8, Figure 5 · p. 8, Table 1 · p. 8
5.3 LARGE MOVES
- 0.88 down and 0.83 up: UQ-regression reaches these per-class F1 scores in the top 1% SNR tier at 5 s on large true moves.Large moves are defined as the upper tercile of true displacement magnitude, |y| > q67.Source: §5.3 · p. 8, Table 2 · p. 9
5.4 REGRESSION VERSUS CLASSIFICATION HEAD
- +0.11 to +0.15 versus +0.05 to +0.11 directional macro F1 gain across horizons for regression versus classification gating; regression matches or exceeds classification at the top decile.The two heads share every parameter except the decoder, making this a controlled comparison of the two targets.Source: §5.4 · p. 9
6 CONCLUSION
UQ-LOB turns a pretrained LOB encoder into a probabilistic forecaster by conditioning on realised outcomes from recent windows. Across seven assets and three horizons, its regression variant provides near-nominal interval coverage and improves directional reliability when gated by confidence.
6 CONCLUSION
- 0.11–0.15 (regression) and 0.05–0.11 (classification) directional macro F1 gains at the top confidence decile across seven assets and three horizons.UQ-regression attains near-nominal 68% coverage; at the top decile it matches the dedicated classifier while also providing magnitude and a calibrated interval.Source: §6 · p. 9
- On large 5-second moves, the tightest confidence tier reaches directional F1 of 0.88 for down and 0.83 for up.Source: §6 · p. 9
- UQ-LOB conditions a pretrained LOB encoder on realised outcomes from recently completed windows to produce a calibrated probabilistic forecast.Source: §6 · p. 9
7 LIMITATIONS AND FUTURE WORK
The paper identifies limits in tail calibration, comparative attribution, regime coverage, economic evaluation, and model scope. It also describes its data, reproduction materials, and use of generative AI.
7 LIMITATIONS AND FUTURE WORK
- The 95% intervals under-cover at 90.4–90.7%, and longer multi-regime testing is needed to establish robustness.The authors also call for comparisons against weight-space uncertainty and base-encoder softmax gating, multi-seed error bars, and loss-term and context-set ablations; profitability requires a realistic trading simulation, and models are trained per asset and horizon on one venue.Source: §7 · p. 9
ETHICS STATEMENT
- The work uses public exchange API market data without personal data and makes no claim of profitability.The authors state that acting on forecasts carries financial risk and identify no direct negative societal impact beyond that common to quantitative trading research.Source: ETHICS STATEMENT · p. 10
REPRODUCIBILITY STATEMENT
- The authors release code and reproduction specifications, but raw order book data cannot be redistributed.Released materials include label thresholds, scale values, dataset statistics, labeling procedure, input representation, training strategy, and hyperparameters.Source: REPRODUCIBILITY STATEMENT · p. 10
AI USE STATEMENT
- Generative AI assisted with manuscript clarity, section organization, and architectural diagrams; authors reviewed and finalized all assisted text and figures.Source: AI USE STATEMENT · p. 10
A MODEL SPECIFICATIONS
D-TABL adapts a bilinear temporal-attention encoder to the paper’s input dimensions, while UQ-regression and UQ-classification share the encoder and attention trunk. The variants differ only in their final decoder.
A.1 D-TABL ENCODER
- D-TABL adapts TABL to 15 × 512 inputs by using three bilinear layers instead of two and re-deriving layer dimensions.Its topology remains bilinear layers feeding a terminal attention-augmented TABL layer; UQ-LOB can also use an encoder pretrained on a mid-price direction task.Source: §A.1 · p. 14
- Each bilinear layer transforms feature and temporal axes independently; the final layer adds learned temporal attention with a fixed self-contribution and learned cross-time weighting.The attention matrix is formed from learned scores normalized row-wise, then applied to feature representations; a learned scalar controls the attended representation’s weight.Source: §A.1 · p. 14
A.2 MODEL PARAMETER COUNT
- Both variants share the D-TABL encoder, feature projection, and context/attention trunk, differing only in the decoder outputs: two continuous values for regression and three logits for classification.Source: §A.2 · p. 14
A.3 TRAINING STRATEGY
The appendix specifies the two-stage training procedure, causal context construction, model inputs, labeling rules, and calibration used to compare regression with classification. Hyperparameters shared across assets and horizons were selected in advance or on one validation split and then held fixed.
A.3 TRAINING STRATEGY
- The D-TABL encoder is pretrained per asset–horizon pair on three-class classification, then each UQ head and encoder are fine-tuned end-to-end.Across 21 pairs, pretraining takes about 78.75 GPU-hours and each UQ variant a further 105 GPU-hours; checkpoints are selected using validation macro F1 for the encoder/classifier and validation WR2 for regression.Source: §A.3 · pp. 14–15
A.4 HYPERPARAMETERS
- Shared hyperparameters are fixed a priori or selected on BTC-USD at 5 seconds’ validation split, then held fixed for all other asset–horizon pairs.Source: §A.4 · p. 15
A.5 CONTEXT CONSTRUCTION
- At target time, the context comprises the C most recent windows whose label horizons have elapsed, using the same procedure at training, validation, and test time.This prevents the test-time predictor from conditioning on information unavailable at the target time.Source: §A.5 · pp. 15–16
A.6 INPUT REPRESENTATION
- Each 512-event input combines seven continuous features with an 8-dimensional embedding of the event token, producing a 15 × 512 representation.The token embedding is learned jointly with the network during encoder pretraining.Source: §A.6 · p. 16
A.7.1 REGRESSION LABELLER
- The regression target is raw tick displacement between a latency-adjusted start price and an end price averaged over the ten events immediately before the horizon.The label procedure discards examples with fewer than ten such events rather than averaging over a shorter window.Source: §A.7.1 · p. 16
A.7.2 CLASSIFICATION LABELLER
- The classification label thresholds the same displacement into down, up, or stationary using an asset- and horizon-specific training-split return standard deviation and α = 0.25.The threshold is converted from log-return space into tick displacement at the window’s start price.Source: §A.7.2 · p. 16
A.7.3 COMPARING REGRESSION AND CLASSIFICATION
- For a matched comparison, the regression mean is discretized using a threshold multiplier selected on the held-out validation calibration half to match the true stationary proportion.Matching the true class proportions rather than the classifier’s predicted proportions keeps the comparison independent of classifier output imbalance.Source: §A.7.3 · p. 17
B.1 DATASET CHARACTERISTICS
Dataset characterization highlights uneven event density, asset-specific class balance and train–test drift, alongside per-asset, per-horizon threshold and scale values.
B.1 DATASET CHARACTERISTICS
- Event rate proxies liquidity and ranks BTC and ETH as most active and LTC least active; at 15 s, BTC averages about 2,340 events versus 585 for LTC.The fixed 10-event end-price smoothing window therefore covers a larger share of the horizon for lower-rate assets such as LTC than for BTC.Source: §B.1 · p. 17
B.2 CLASS BALANCE BY ASSET AND HORIZON
- For six assets, stationary proportions fall from 5 s to 15 s and train, validation and test proportions track closely; BTC instead has 70% stationary training versus 27% test at 5 s.The BTC gap narrows but persists at 10 s and 15 s; Figure 7 reports class proportions across assets, horizons and splits.Source: §B.2 · p. 17, Figure 7 · p. 18
B.3 CLASS PROPORTION DRIFT
- Class-proportion drift varies by asset and shrinks with horizon; TAO and SUI drift least, while BTC drifts most and is the main source of evaluation distribution mismatch.At 15 s, stationary-class drift is 2.4 pp for TAO and 6.3 pp for SUI; Figure 8 plots train–test drift by asset, class and horizon.Source: §B.3 · p. 18, Figure 8 · p. 18
B.4 PER-HORIZON THRESHOLD AND SCALE VALUES
- Log-return volatility, the class-label threshold and the label scale are computed independently for each asset and horizon on the training split.The label scale yref normalises context labels and scales predicted variance in the head.Source: §B.4 · p. 18
C EXTENDED RESULTS
The extended results appendix supplies per-class and confidence-gated diagnostics, complementing the main directional macro F1 analysis.
C EXTENDED RESULTS
- Table 7 reports per-asset and per-horizon log-return volatility.The appendix also identifies per-horizon threshold h and tick label scale yref as computed on the training split.Source: Table 7 · p. 19, C EXTENDED RESULTS · p. 19
- Stationary F1 collapses under SNR gating because confident predictions are large in magnitude, making three-class macro F1 unsuitable for gating evaluation.Table 8 decomposes per-class F1 for UQ-regression across SNR tiers, pooled over assets at 5 s.Source: C EXTENDED RESULTS · p. 18, Table 8 · p. 19
- Figure 9 plots UQ-classification three-class macro F1 against retained softmax-confidence percentile for each asset and horizon, with a prior-matched random reference.The figure provides the softmax-gating counterpart to the main-text directional macro F1 curves.Source: C EXTENDED RESULTS · p. 18, Figure 9 · p. 19
- Figure 10 plots three-class accuracy against retained confidence percentile by asset and horizon, comparing SNR-gated UQ-regression with softmax-gated UQ-classification.The dashed line marks chance level.Source: C EXTENDED RESULTS · p. 18, Figure 10 · p. 19
Related papers
This paper cites
- On Calibration of Modern Neural Networks2017
- Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning2015
- A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks2016
- Selective Classification for Deep Neural Networks2017
- Can You Trust Your Model's Uncertainty? Evaluating Predictive Uncertainty Under Dataset Shift2019
- Universal features of price formation in financial markets: perspectives from Deep Learning2018