Introduction
Deep neural networks (DNNs) have become the backbone of modern artificial intelligence, yet they remain notoriously difficult to interpret. To understand why a model makes a specific prediction, researchers often turn to Shapley values, a concept derived from cooperative game theory. Shapley values are considered the "gold standard" for feature attribution because they provide a mathematically fair way to distribute a model's output among its input features.
However, a significant barrier exists: computing exact Shapley values is NP-hard. For a model with $n$ input features, an exact calculation requires $2^n$ model evaluations to account for every possible combination of features. While approximation methods like KernelSHAP or DeepSHAP exist, they often force a trade-off between computational speed and attribution accuracy. HarsanyiNet addresses this dilemma by introducing a novel architecture that computes exact Shapley values in a single forward propagation.
The Harsanyi Interaction Framework
The core innovation of HarsanyiNet lies in its shift from post-hoc explanation to "explainability-by-design." The authors leverage the concept of Harsanyi interactions, which represent "AND" relationships between features. For example, in a face detection task, a specific neuron might only activate if an "eye," "nose," and "mouth" are all present simultaneously.
The paper demonstrates that a Shapley value is essentially a redistribution of these Harsanyi interactions. By constraining the neural network to explicitly encode these interactions within its internal structure, the model can track the contribution of each feature throughout the inference process.
Architectural Innovations
HarsanyiNet replaces standard neurons with specialized components designed to maintain the integrity of feature interactions:
- Harsanyi Units: Unlike traditional neurons, these units are restricted by two primary requirements. First, they must have a defined receptive field (a specific set of inputs). Second, they must deactivate if any single input within that receptive field is masked or missing. This ensures the unit strictly represents an "AND" relationship.
- Cascaded Harsanyi Blocks: The network is organized into layers where each neuron represents a hierarchical interaction between its "children" from previous layers. This allows the model to build complex, high-order interactions from simple base features.
- Direct Computation (Theorem 3): The authors derive a mathematical formula proving that because the network is built from these units, the exact Shapley value for any input can be calculated by summing the weighted activations of intermediate Harsanyi units during a standard forward pass. This eliminates the need for the thousands of inferences required by sampling-based explainers.
Empirical Results and Performance
The authors evaluated HarsanyiNet across a variety of benchmarks, including tabular datasets (Census Income, Yeast, TV News) and image datasets (MNIST, CIFAR-10, Oxford Flowers-102).
Accuracy and Precision
On datasets where the ground truth Shapley values could be calculated (small $n$), HarsanyiNet achieved numerical errors as low as $10^{-8}$ to $10^{-7}$. This level of precision is effectively negligible, confirming that the architecture successfully bypasses the estimation errors inherent in approximation methods.
Efficiency
While traditional methods like FastSHAP or DeepSHAP require extensive sampling to reach stable attribution values, HarsanyiNet provides superior results in exactly one forward propagation. This makes it feasible to generate high-quality explanations in real-time applications.
Predictive Power
Historically, "interpretable" architectures often suffered from lower predictive accuracy compared to their black-box counterparts. HarsanyiNet breaks this trend, maintaining high performance across complex tasks:
- MNIST: 99.16% accuracy
- CIFAR-10: 89.34% accuracy
These results significantly outperform previous specialized interpretable architectures like ShapNet, proving that HarsanyiNet can scale to modern computer vision challenges.
Key Insights
- Exploiting Sparsity: While a model could theoretically contain $2^n$ interactions, the authors found that real-world DNNs typically rely on a small number of "salient" interactions. HarsanyiNet exploits this sparsity to remain computationally efficient without sacrificing depth or complexity.
- Bypassing the Sampling Dilemma: Traditional explainers must see "masked" versions of data (where certain features are turned off) to understand feature importance. HarsanyiNet never needs to see a masked input at test time; it understands the contribution of every feature from a single look at the complete data point.
Limitations and Future Work
Despite its advantages, HarsanyiNet is not a "plug-and-play" solution for existing models. Because the explainability is baked into the architecture, users cannot apply this method to pre-trained models like ResNet or Transformers; the model must be trained from scratch using Harsanyi blocks. Additionally, the training cost is roughly double that of a standard network with an equivalent number of parameters.
Future research directions include extending the architecture to handle more complex data types and exploring different "baseline" values for feature masking beyond simple zero-setting.
Summary updated