ExplainabilityTransparencyTrustworthinesscs.CL
TokenSHAP: Interpreting Large Language Models with Monte Carlo Shapley Value Estimation
Roni Goldshmidt, Miriam Horovicz
July 14, 2024
NLP4SCIENCE
67 citations
7 influential
Key Takeaways
-
TokenSHAP provides a quantitative way to understand which parts of your input prompt matter most — by assigning numerical importance scores to individual tokens or phrases, the method helps users and developers see exactly what influenced an LLM's response, moving beyond black-box decision-making.
-
The method uses established mathematical principles from game theory to ensure fairness and rigor — Shapley values, borrowed from cooperative game theory, provide a theoretically grounded framework rather than ad-hoc explanations, making interpretations more reliable and defensible for high-stakes applications.
-
TokenSHAP is computationally practical through Monte Carlo sampling — rather than requiring exhaustive calculations that would be prohibitively expensive, the method uses statistical sampling to estimate importance scores efficiently, making it feasible for real-world deployment with large language models.
-
The approach captures complex interactions between tokens, not just individual contributions — this nuanced understanding reveals how different parts of a prompt work together to influence model outputs, providing deeper insights than simpler attribution methods that treat tokens in isolation.
-
Better interpretability directly supports responsible AI goals — by improving transparency and helping developers understand model behavior, TokenSHAP enables better prompt engineering, more reliable systems, and greater accountability—essential requirements for deploying LLMs in critical applications where trustworthiness matters.