Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Saliency Cards to documentation #203

Open
gsarti opened this issue Jul 19, 2023 · 0 comments
Open

Add Saliency Cards to documentation #203

gsarti opened this issue Jul 19, 2023 · 0 comments
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

Comments

@gsarti
Copy link
Member

gsarti commented Jul 19, 2023

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:

Saliency methods are a common class of machine learning interpretability techniques that calculate how important each input feature is to a model’s output. We find that, with the rapid pace of development, users struggle to stay informed of the strengths and limitations of new methods and, thus, choose methods for unprincipled reasons (e.g., popularity). Moreover, despite a corresponding rise in evaluation metrics, existing approaches assume universal desiderata for saliency methods (e.g., faithfulness) that do not account for diverse user needs. In response, we introduce saliency cards: structured documentation of how saliency methods operate and their performance across a battery of evaluative metrics.

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.

@gsarti gsarti added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers user qol Quality of life improvements for library users labels Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant