Interpretability in Safety-Critical FinancialTrading Systems

Gabriel Deza, Adelin Travers, Colin Rowat, Nicolas PapernotarXiv 2021 · arXiv

Introduction

In 2020, several high-profile quantitative hedge funds experienced significant losses as their machine learning (ML) models failed to navigate unprecedented market conditions. While Deep Neural Networks (DNNs) have become a staple in financial forecasting, they largely remain "black boxes." This lack of interpretability is particularly dangerous in safety-critical systems where a single model error can lead to catastrophic financial ruin.

This paper addresses two critical gaps in current ML research: the focus on point predictions rather than probabilistic distributions, and the tendency to evaluate models in isolation. In a real-world financial context, a model's forecast is merely one component of a larger pipeline. The authors argue that interpretability must be assessed by how errors propagate through the entire system to affect final trading decisions.

Methodology and Pipeline Design

The authors propose a gradient-based interpretability framework (Algorithm 1) designed to synthesize "adverse" market conditions. By utilizing the model's own gradients, the framework identifies the smallest possible changes to input features—such as social media sentiment—that result in specific shifts in the output distribution (e.g., moving the mean return or increasing uncertainty).

The end-to-end financial trading pipeline, integrating sentiment analysis, probabilistic forecasting, and a threshold-based trading strategy.

The experimental pipeline mirrors industry standards, consisting of three primary stages:

  1. Sentiment Analysis: FinBERT, a BERT model pre-trained on financial corpora, processes Twitter data to quantify market sentiment.
  2. Probabilistic Forecasting: DeepAR, an autoregressive RNN, generates probabilistic forecasts to account for market risk.
  3. Trading Strategy: A threshold-based system utilizes the Kelly Criterion to determine investment size based on the model's confidence levels.

Data and Experimental Setup

The study utilizes a robust dataset covering the period from January 2016 to January 2021. This includes daily and hourly price data for eight randomly selected S&P 500 tickers, paired with a massive collection of tweets mentioning these companies.

Summary of the S&P 500 tickers, sectors, and tweet volumes analyzed in the study.

By perturbing these inputs within historical bounds, the researchers create synthetic scenarios that appear statistically "normal" but are optimized to trigger poor trading decisions, effectively stress-testing the model's robustness.

Key Insights and Results

The Vulnerability of the Mean

A primary finding is that the mean of the output distribution is significantly easier to manipulate than the variance (confidence). For the ticker ADSK, manipulating the forecast mean resulted in a 10.2% average change in RMSE, while manipulating the standard deviation caused only a 0.21% change. This is a critical vulnerability, as many trading strategies rely heavily on expected mean returns.

Decoupling Accuracy from Returns

The research highlights a dangerous disconnect: a drop in model accuracy (RMSE) does not always correlate with a drop in financial returns. Conversely, a model can appear statistically accurate while the downstream trading strategy fails due to specific, non-robust parameter sensitivities. In one stress test, increasing the "adversity" of market conditions caused returns to plummet from 21.3% to 7.7%.

Sentiment as a Lever

Sentiment features, particularly "Positive Sentiment," were identified as the most influential levers used by the model. This makes sentiment data a primary target for both stress testing and potential adversarial manipulation in the real world.

Conclusion and Future Work

The authors demonstrate that traditional error metrics are insufficient for evaluating safety-critical financial systems. Instead, a gradient-based approach to stress testing provides a controllable "knob" for risk managers to simulate market stress. Future work will look toward more complex, non-smooth trading functions and applying these interpretability frameworks to more volatile asset classes like cryptocurrencies.

Summary updated

Abstract

Sophisticated machine learning (ML) models to inform trading in the financial sector create problems of interpretability and risk management. Seemingly robust forecasting models may behave erroneously in out of distribution settings. In 2020, some of the world's most sophisticated quant hedge funds suffered losses as their ML models were first underhedged, and then overcompensated. We implement a gradient-based approach for precisely stress-testing how a trading model's forecasts can be manipulated, and their effects on downstream tasks at the trading execution level. We construct inputs -- whether in changes to sentiment or market variables -- that efficiently affect changes in the return distribution. In an industry-standard trading pipeline, we perturb model inputs for eight S&P 500 stocks. We find our approach discovers seemingly in-sample input settings that result in large negative shifts in return distributions. We provide the financial community with mechanisms to interpret ML forecasts in trading systems. For the security community, we provide a compelling application where studying ML robustness necessitates that one capture an end-to-end system's performance rather than study a ML model in isolation. Indeed, we show in our evaluation that errors in the forecasting model's predictions alone are not sufficient for trading decisions made based on these forecasts to yield a negative return.
BibTeX
@misc{deza2021interpretability,
  author = {Gabriel Deza and Adelin Travers and Colin Rowat and Nicolas Papernot},
  title = {{Interpretability in Safety-Critical FinancialTrading Systems}},
  year = {2021},
  eprint = {2109.15112},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.15112},
}
Figure