SHAP for Signal Attribution in Production
Using SHAP in a live production system means computing, for every prediction the model makes each day, exactly how much each feature pushed the forecast up or down — turning a black-box model's daily output into something a risk manager can actually read.
Prerequisites: Feature Importance with SHAP
A tree-ensemble model that scores 3,000 stocks every morning is not something a portfolio manager can inspect by reading the code — but they still need to know why the model likes a given stock today. Running SHAP on every live prediction gives, per stock per day, a breakdown of how much each individual feature contributed to pushing that stock's score above or below the model's average output.
Computing SHAP values as part of the daily production pipeline, not just as a one-off research exercise, turns an opaque model score into a per-stock, per-day explanation — "the model likes this stock mainly because of cheap valuation and strong momentum" — that a human can sanity-check before capital moves.
In production this attribution is used two ways: as a daily explanation layer for portfolio managers deciding whether to trust a given trade, and as a monitoring signal, since a sudden shift in which features are driving predictions across the whole portfolio can flag that something in the model or its inputs has changed unexpectedly.
Worked example. A stock's model score is 0.72, versus an average score of 0.50 across the universe. The SHAP breakdown shows momentum contributing +0.15, valuation contributing +0.10, and a quality feature contributing -0.03, summing to the +0.22 gap above average. A portfolio manager reading this immediately sees the position is momentum- and valuation-driven, not a quality bet, which matters if the fund is trying to control its factor exposures.
Because full SHAP computation can be slow on large models, production systems often use TreeSHAP (fast and exact for tree ensembles) or approximate methods, since recomputing exact SHAP values for every stock every day at scale can otherwise become a real latency bottleneck.
Further reading
- Lundberg & Lee, 'A Unified Approach to Interpreting Model Predictions' (NeurIPS, 2017)