[Summary] Add metrics for feature attribution evaluation #112
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
summary
Summarizes multiple sub-tasks
🚀 Feature Request
The following is a non-exhaustive list of attention-based feature attribution methods that could be added to the library:
pytorch/captum
pytorch/captum
INK-USC/DIG
INK-USC/DIG
INK-USC/DIG
copenlu/xai-benchmark
copenlu/xai-benchmark
copenlu/xai-benchmark
copenlu/xai-benchmark
Iuclanlp/NLP-Interpretation-Faithfulness
Iuclanlp/NLP-Interpretation-Faithfulness
Notes:
The Log Odds metric is just the negative logarithm of the Comprehensiveness metric. The application of - log can be controlled by a parameter
do_log_odds: bool = False
in the same function. The reciprocal can be obtained for the Sufficiency metric.All metrics that control masking/dropping a portion of the inputs via a
top_k
parameter can benefit from a recursive application to ensure the masking of most salient tokens at all times, as described in Madsen et al. '21. This could be captured by a parameterrecursive_steps: Optional[int] = None
. If specified, a masking of sizetop_k // recursive_steps + int(top_k % recursive_steps > 0)
is performed forrecursive_steps
times, with the last step having size equal totop_k % recursive_steps
iftop_k % recursive_steps > 0
.The Sensitivity and Infidelity methods add noise to input embeddings, which could produce unrealistic input embeddings for the model (see discussion in Sanyal et al. '21).
Both sensitivity and infidelity can include a parameterUsing Stability is more principled in this context since fluency is preserved by the two step procedure presented by Alzantot et al. '18, which includes a language modeling component. An additional parameterdiscretize: bool = False
that when turned on replaces the top-k inputs with their nearest neighbors in the vocabulary embedding space instead of their noised versions.sample_topk_neighbors: int = 1
can be used to control the nearest neighbors' pool size used for replacement.Sensitivity by Yin et al. '22 is an adaptation to the NLP domain of Sensitivity-n by Yeh et al. '19. An important difference is that the norm of the noise vector causing the prediction to flip is used as a metric in Yin et al. '22, while the original Sensitivity in Captum uses the difference between original and noised prediction scores. The first should be prioritized for implementation.
Cross-Lingual Faithfulness by Zaman and Belinkov '22 (code) is a special case of the Dataset Consistency metric by Atanasova et al. 2020 in which the pair is constituted by an example and its translated variant.
Overviews
A Comparative Study of Faithfulness Metrics for Model Interpretability Methods, Chan et al. '22
The text was updated successfully, but these errors were encountered: