arXiv:2609.31491cs.AISep 2026

Manuscript Offprint

arXiv:2609.31491

UQ-LOB: Uncertainty-Aware Limit Order Book Mid-Price Forecasting

Derrick Gilchrist Edward Manoharan, Eljas Linna, Kestutis Baltakys, Hao Dong, Juho Kanniainen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Derrick Gilchrist Edward Manoharan ∗^{*}

Data Science Research Centre

Tampere University

Tampere, Finland

derrick.edwardmanoharan@tuni.fi ∗^{*}

Kestutis Baltakys

Data Science Research Centre

Tampere University

Tampere, Finland

kestutis.baltakys@tuni.fi

Eljas Linna

Data Science Research Centre

Tampere University

Tampere, Finland

eljas.linna@tuni.fi

Juho Kanniainen

Data Science Research Centre

Tampere University

Tampere, Finland

juho.kanniainen@tuni.fi

Hao Dong

Data Science Research Centre

Tampere University

Tampere, Finland

hao.dong@tuni.fi

ABSTRACT

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

The limit order book (LOB) is the mechanism through which price discovery occurs in most electronic markets (Gould et al., 2013). It aggregates resting buy (bid) and sell (ask) orders by price level; the best bid and best ask define the spread, and their midpoint, the mid-price, is the standard instantaneous valuation of the asset (Glosten & Milgrom, 1985; Kolm et al., 2023). An incoming order that crosses the spread executes immediately against resting liquidity, whereas one that does not rests in the book at its own price level (Briola et al., 2025). Because thousands of such events arrive every second, the LOB carries microstructural signal about the next few seconds of price formation that predictive models seek to exploit (Sirignano & Cont, 2019; Zhang et al., 2019a; Lucchese et al., 2024).

∗^{*}Corresponding author.

Deep LOB forecasters are overwhelmingly point predictors: they emit a direction or a displacement, but not how much that output should be trusted. For a trading decision this omission is costly. Predictability varies sharply across market regimes and even across consecutive windows, and every action incurs fees and slippage, so the practically relevant question is rarely “which way will the price move?” but “is this forecast reliable enough to act on?”, the setting of selective prediction (Chow, 1970; El-Yaniv & Wiener, 2010; Geifman & El-Yaniv, 2017). Answering it requires input-dependent (aleatoric) uncertainty that is calibrated: an interval claimed to cover 68% of outcomes should do so empirically.

Figure 1 illustrates the output we target. Instead of a single value, the model returns a distribution N(μ,σ2)\mathcal{N}(\mu, \sigma^2) over the mid-price displacement at t+ht + h, and the ratio ∣μ∣/σ|\mu|/\sigma provides a scalar confidence that can be thresholded. We obtain this with UQ-LOB, a module attached to the hidden representation of a pretrained LOB encoder. Inspired by conditional and attentive neural processes (Garnelo et al., 2018a; Kim et al., 2019), UQ-LOB conditions each prediction on a context set of recently completed windows whose realised outcomes are already known at time tt, so that the forecast can adapt to the prevailing regime without any gradient update.

Figure

Figure 1: Confidence-aware mid-price forecasting. The model sees only the input window ending at tt (shaded) and returns a Gaussian over the displacement at t+ht + h; its 68% and 95% intervals give a thresholdable measure of how much the forecast should be trusted.

To the best of our knowledge, no prior work equips mid-price forecasting with calibrated, input-dependent uncertainty of this kind. We instantiate UQ-LOB as a UQ-regression variant, which outputs a Gaussian over the tick displacement, and a UQ-classification variant, which outputs a categorical distribution over the three directional classes (down, up, stationary), and we compare the two under matched confidence gating. Our contributions are:

• An encoder-agnostic, in-context UQ head. An attentive head that conditions on the realised outcomes of recent windows and produces a calibrated Gaussian N(μ,σ2)\mathcal{N}(\mu, \sigma^2) over tick displacement, with confidence given by its signal-to-noise ratio ∣μ∣/σ|\mu|/\sigma. Its objective combines a heteroscedastic likelihood with magnitude weighting, a directional margin, and a differentiable magnitude-conditional calibration penalty that turns the post-hoc calibration metrics of Levi et al. (2022) into a training signal.

• A classification counterpart on the same trunk, trained on the three-class label with confidence given by its maximum class probability, enabling a controlled comparison between continuous and discrete targets at identical parameter count.

• An evaluation protocol for selective LOB prediction based on directional macro F1, which removes the trivial effect of the stationary class under gating, a magnitude-restricted analysis on large moves, and prior-matched random baselines. On 5.2 billion events across seven assets and three horizons, confidence gating improves directional reliability at every horizon, and the regression head matches the dedicated classifier at the top confidence decile while additionally providing a magnitude and a calibrated interval.

References (54)