Visualizing attention matrices and norm-based analysis #113
VDuchauffour
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @cdpierse,
I want to thank you for your work on this project. It indeed helps me a lot this year for my master thesis which involve explainability in NLP. Alongside with your package I used the Captum's tutorial for interpreting BERT models [1] [2]. I think some of their visualization could be a good fit within this project.
In [2] they plotting token-to-token (attention matrices for all attention heads of a specific layer) and token-to-head (attention matrices normalized along head dimension for all layer).
I think that those visualizations are relevant with the purpose of this package. In [2] they also implementing what this article call a norm-based analysis (in contrast with a weight-based analysis given by attention), i.e. the
hidden_state
of a specific layer and/or heads (which resolve some of bottleneck explain here, e.g. special tokens capture almost all attention etc.).I think also that adding the capability to export current visualization of text
explainer
from HTML to image could be very appreciate. Something with imgkit and wkhtmltopdf should do the trick.Finally I think that trick could be much nicer for project stats.
If your interested in one of my ideas I would be please to work on that.
Thanks,
Vincent
Beta Was this translation helpful? Give feedback.
All reactions