arXiv:2609.06085q-fin.TRSep 2026

Manuscript Offprint

arXiv:2609.06085

Explainable Deep Learning for Price-Trade Dynamics: From Black-Box Forecasts to Effective Parametric Models

Manuel Naviglio, Fabrizio Lillo

Abstract

Understanding the joint dynamics of prices and trades is central to market microstructure, where returns and order flow interact through nonlinear and state-dependent mechanisms. Linear models are interpretable but may miss these effects, while deep neural networks improve forecasting at the cost of transparency. We use neural networks as tools for structural discovery rather than only for prediction. A deep feed-forward network is trained on high-frequency returns and signed volumes for large- and small-tick stocks and compared with a linear VAR benchmark. The neural network improves predictive performance, especially for returns, revealing nonlinear dependencies beyond the linear specification.

Using Shapley-based explainability, we show that the dominant contributions are concentrated at the most recent lags. Model-implied responses are consistent with conditional averages reconstructed from the data. Unlike empirical averages, however, the neural-network decomposition isolates individual regressor contributions to the aggregate dependence. Lagged signed volume generates sign-preserving and saturating effects, consistent with nonlinear price impact and order-flow persistence. Lagged returns act as state variables: when the previous trade does not move the price, the model predicts continuation in the direction of past order flow, whereas non-zero returns generate attenuation or reversal.

Building on these findings, we introduce a parsimonious SHAP-inspired nonlinear parametric model. It reproduces the main return–volume dependencies, outperforms the linear VAR benchmark, and achieves performance comparable to the neural network. A multi-lag extension captures residual longer-memory effects while preserving interpretability. Overall, explainability offers a route from black-box prediction to economically meaningful parametric models of price and trade dynamics.

1 Introduction

The dynamics of trading volumes and prices are intrinsically linked through the microstructure of financial markets. In modern electronic markets, this interaction is mediated by the limit order book (LOB), where buy and sell orders are continuously submitted, canceled, and executed. Price changes arise from the interaction between incoming market orders and available liquidity, making order flow a primary driver of short-term price dynamics. This mechanism underlies several well-documented stylized facts, including persistent order flow, transient price impact, and short-term return reversals [1–3].

*Email: manuel.naviglio@sns.it †Email: fabrizio.lillo@sns.it

Modeling the joint dynamics of prices and trades is therefore central to market microstructure. On the one hand, accurate forecasts of returns and trading activity are essential for applications such as optimal execution, risk management, and algorithmic trading [4]. On the other hand, models that faithfully reproduce the statistical properties of the data are crucial for realistic market simulations, which are widely used to study liquidity provision and market impact. In particular, market impact—the price response induced by trading—plays a fundamental role in determining transaction costs, especially for metaorders executed over time [1,5]. Capturing these mechanisms requires models that account for the complex and nonlinear interaction between order flow and price formation.

A large body of literature has addressed this problem using linear parametric models. A prominent example is the vector autoregression (VAR) framework introduced by Hasbrouck [6], as well as its variants such as the Transient Impact Model [1]. These models describe price and trade dynamics through linear dependencies on past observations and have been widely adopted due to their interpretability and tractability. However, their ability to capture the full complexity of high-frequency financial data is inherently limited, as they impose restrictive assumptions on the functional form of the underlying relationships.

More recently, machine learning methods have emerged as flexible alternatives capable of capturing nonlinear and high-dimensional dependencies directly from data. In particular, deep learning models applied to limit order book data have demonstrated strong predictive performance [7, 8]. Despite these advances, a key limitation remains: such models are typically treated as black boxes, making it difficult to understand which features drive their predictions and whether the extracted patterns correspond to economically meaningful mechanisms.

In this work, we adopt a different perspective. Rather than using nonlinear models solely as forecasting devices, we employ them as tools for structural discovery. The idea is to exploit the flexibility of neural networks in a first stage, allowing the model to learn nonlinear dependencies directly from the data, and then to use explainability techniques to identify and interpret the functional forms that drive the predictions. By combining neural networks with Shapley-based explainability methods [9], we decompose the fitted predictions into feature-level contributions and reconstruct the nonlinear dependence of returns and signed volumes on their lagged values.

The central hypothesis of this work is that, although nonlinear models are complex at the parametric level, the relationships they learn need not be arbitrary or uninterpretable. On the contrary, if the model is capturing stable features of the data-generating process, its predictions should be organized around structured and economically meaningful mechanisms. In this sense, explainability is used not merely as a diagnostic tool for understanding a black-box predictor, but as a way to extract candidate structural relations from the model.

Our analysis shows that the neural network learns a set of robust nonlinear patterns that are consistent with well-known mechanisms of market microstructure. Lagged signed volume generates sign-preserving and saturating responses, which can be interpreted as nonlinear price impact in the return equation and order-flow persistence in the signed-volume equation. Lagged returns, instead, mainly act as state variables: they modulate the strength of the order-flow signal and generate short-term reversal or attenuation effects, depending on the magnitude of the previous price move. These relationships are stable across assets with some differences between large-tick and small-tick stocks, indicating that the model captures features that are sensitive to the underlying microstructure regime.

We further validate these findings by comparing the model-implied predictive surfaces with analogous conditional averages computed directly from the data. The close qualitative agreement between the two provides an important consistency check: the nonlinear structures revealed by the neural network are not artifacts of the architecture or of the explainability method, but reflect empirical regularities already present in the data.

Furthermore, the advantage of the explainability analysis is that it allows these regularities to be decomposed into the separate contributions of lagged returns, lagged signed volumes, and the remaining past information. This provides access to the internal structure of the nonlinear predictor and makes it possible to isolate the functional role of individual regressors. In particular, the Shapley decomposition shows that the lagged-volume contribution has a clean sign-like and saturating structure, with no substantial spurious dependence on lagged returns. The return contribution is instead more state-dependent and is strongly organized by the sign of previous order flow: when the previous trade does not move the price, the model tends to preserve the sign of lagged signed volume, whereas a non-zero previous return generates attenuation or reversal.

This decomposition allows us to design simpler parametric models. In particular, we introduce a SHAP-inspired nonlinear parametric specification that incorporates the main functional forms identified by the neural network: a saturating dependence on lagged signed volume and a state-dependent correction driven by the magnitude of lagged returns and by the sign of previous order flow.

A key result of the paper is that this reduced specification improves upon the linear VAR benchmark and achieves predictive performance comparable to that of the neural network, while being more stable with respect to the choice of lag order. The model therefore retains a large fraction of the predictive power of the flexible nonlinear architecture, but in a parsimonious and economically interpretable form.

Overall, our results demonstrate that explainability provides a powerful framework to uncover and interpret nonlinear structure in financial data. It offers a principled way to move from black-box prediction to interpretable model construction: neural networks can be used as discovery devices, while Shapley decompositions and aggregated conditional response analysis can translate the learned relationships into economically meaningful mechanisms and parsimonious parametric specifications. In this way, explainability helps bridge flexible machine-learning models and traditional econometric modeling, and provides a way to assess whether the learned nonlinear relationships reflect genuine market mechanisms rather than spurious statistical patterns.

The remainder of the paper is organized as follows. Section 2 introduces the modeling framework and presents both linear and nonlinear specifications. Section 3 describes the data and preprocessing steps. Section 4 compares the forecasting performance of the models. Section 5 develops the explainability analysis and extracts the nonlinear dependencies, decomposing the contributions of the most relevant regressors. Section 6 introduces and calibrates a SHAP-inspired parametric nonlinear model. Section 7 concludes.