Deep Models on Limit Order Book Data
Feeding a neural network the raw sequence of bid and ask prices and sizes, tick by tick, lets it learn short-horizon price-move patterns a hand-built feature never captures — but the resulting model has to make a prediction and act on it faster than the exchange can invalidate it.
Prerequisites: Deep Learning On Limit Order Books
A limit order book is a live, constantly updating snapshot of every resting buy and sell order at every price level near the current price — ten levels deep on each side is typical, refreshed every time an order arrives, cancels, or trades. Traditional microstructure signals compress that snapshot into a handful of hand-built numbers: the imbalance between bid and ask size, the spread, the depth at the touch. Deep models on limit order book data skip the compression step and feed the raw sequence of book snapshots — often the last 50 to 100 updates, each with ten price levels and sizes on both sides — directly into a neural network, letting the model discover on its own which patterns in that raw sequence predict the next few ticks' direction.
Why raw sequences instead of hand-built features
A hand-built imbalance feature — (bid size − ask size) / (bid size + ask size) — captures one useful signal, but it throws away how the book got there: whether the imbalance built up gradually over the last 50 updates or appeared in one large order, whether it's concentrated at the touch or spread across several price levels, whether similar imbalances in the recent past were followed by a price move or reverted. A model built for sequences — historically LSTMs, more recently temporal convolutional networks or transformers — can, in principle, pick up on exactly this kind of pattern in the shape of the order flow, not just its current snapshot value. The DeepLOB architecture, one of the most cited in this space, stacks convolutional layers (to find local patterns across price levels) with a recurrent layer (to find patterns across time), predicting whether the mid-price will move up, down, or stay flat over the next handful of ticks.
Worked example. In the original DeepLOB study on Nasdaq-listed stocks, a convolutional-plus-LSTM model predicting the direction of the mid-price over a short horizon (roughly the next 10-50 order-book events, translating to well under a second of wall-clock time in liquid names) achieved directional accuracy in the high 70s to low 80s percent range on held-out data — meaningfully above the roughly 50% a naive baseline would get, and above simpler logistic-regression models built on the same hand-crafted imbalance features, which typically landed in the 60s. The gap between the deep model and the hand-built-feature baseline is the concrete evidence that there was extra signal in the raw sequence the simpler feature was throwing away.
What this means in practice, and why it's hard to trade
A model that's 78% accurate at predicting direction over the next few ticks sounds decisively profitable, but the horizon is the catch: by the time the model's prediction is computed and an order is sent, a meaningful fraction of that short window has already elapsed, and the model is competing against every other participant reading the same public book. Firms that trade this successfully invest as much in the inference latency and order-routing path as in the model itself — a slightly less accurate model that acts in microseconds can out-earn a more accurate model that takes milliseconds, because the edge decays within the same window it's predicting over. The signal also degrades fast with holding period: accuracy that looks strong at a 50-tick horizon often falls close to a coin flip by a few hundred ticks out, because whatever information was in the book gets absorbed into price almost as fast as the model can find it.
A deep LOB model's edge lives in a very short, very contested window — the model has to be not just accurate but fast enough that the prediction is still true by the time an order reaches the exchange. Backtest accuracy that ignores latency is not a tradeable number.
A common mistake in backtesting these models is measuring accuracy against the mid-price at the prediction time, then assuming a fill at that same mid-price — in practice, crossing the spread to act on the signal eats a meaningful chunk of a short-horizon edge that a naive backtest never charges for.
Related concepts
Practice in interviews
Further reading
- Zhang, Zohren & Roberts (2019), DeepLOB
- Sirignano & Cont (2019), Universal Features of Price Formation