Add Saliency Cards to documentation #203
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
user qol
Quality of life improvements for library users
Description
Saliency cards (Paper | Repository) introduce a structured framework to document feature attribution methods' strengths and applicability to different use-cases. Introducing saliency cards specific to sequential generation tasks would help Inseq users in selecting more principled approaches for their analysis.
Motivation
Copying from the original paper's abstract:
Additional context
Introducing ad-hoc cards in Inseq should be preferable than contributing to the original saliency cards repository since 1) they will be more easily used and improved by the Inseq community and 2) the original authors focus solely on vision-centric applications.
The following sections are relevant for the integration of saliency cards into Inseq:
Determinism: Determinism measures if a saliency method will always produce the same saliency map given a particular input, label, and model.
Hyperparameter Dependence: Hyperparameter dependence measures a saliency method’s sensitivity to user-specified parameters. By documenting a method’s hyperparameter dependence, saliency cards inform users of consequential parameters and how to set them appropriately.
Model Agnosticism: Model agnosticism measures how much access to the model a saliency method requires. *Since several future methods need access to specific modules (see Value Zeroing attribution method #173 for example), this part could document which parameters will need to be defined in the
ModelConfig
class before usage.Computational Efficiency: Computational efficiency measures how computationally intensive it is to produce the saliency map. Using the same models, we could report unified benchmarks across different methods (and different parameterizations, in some cases).
Semantic Directness: Saliency methods abstract different aspects of model behavior, and semantic directness represents the complexity of this abstraction (i.e. what the reported scores correspond to). For example, discussing the difference between salience and sensitivity for raw gradients vs. input x gradient (see Appendix B of Geva et al. 2023)
(Added) Granularity: Specifying the granularity of the scores returned by the attribution method (e.g. raw gradient attribution returns one score per hidden size of the model embeddings, corresponding to the gradient with respect to the
attributed_fn
propagated through the model.(Added) Target dependence: Specifying whether the method relies on model final predictions to derive importance scores, or whether these are extracted from model internal processes (e.g. for raw attention weights).
The Sensitivity Testing and Perceptibility Testing sections describe empirical measurements of minimality/robustness rather than inherent properties of methods. As such, they should be added only in the presence of a reproducible study using Inseq to compare different methods.
The text was updated successfully, but these errors were encountered: