How should SHAP feature importance be formatted before sending it to an LLM for root cause analysis?
07:21 11 Mar 2026

I have an ML anomaly detection step that produces SHAP values for sensor-level drivers. I want to pass these drivers to an LLM to generate root cause analysis and operational suggestions.

Raw SHAP output is too verbose and noisy for direct prompting. If I pass the full feature list, the prompt becomes large and the LLM response quality becomes inconsistent.

What is a good way to transform SHAP output into an LLM-friendly RCA input?

machine-learning large-language-model shap