Code Monkey home page Code Monkey logo

alps_2021's Introduction

ALPS_2021 - LAB 2: XAI in NLP - January 22 2021

Repository for the Explainable AI track in the ALPS winter school 2021 - schedule.

This lab consists of two parts - one on explainability and one on explorative interpretability. You should try to split your time between the two labs.

Lab 2.1

The first part of the lab focuses on explainability for Natural Language Processing Models. In this part, we will lay the foundations of post-hoc explainability techniques and ways of evaluating them.

Lab 2.1 code

CoLAB <- copy this Colab notebook and add code to it for the exercises. CoLAB Solutions

For this notebook of the lab, we encourage you to work in groups, so that you could split the work and discuss the outcomes.

Goals of LAB 2.1:

  • learn how to implement two basic and commonly used types of gradient-based explainability techniques
  • learn how to implement an approximation-based explainability technique
  • exercise how to apply explainability techniques to discover flaws of machine learning models and construct adversarial explamples using them
  • learn how to evaluate explainability techniques with common diagnostic properties (based on this paper)
  • exercise using the diagnostic properties to find which architecture parameters of a model make it harder to explain

If you find this code useful for your research, please consider citing:

@inproceedings{atanasova2020diagnostic,
title={A Diagnostic Study of Explainability Techniques for Text Classification},
author={Pepa Atanasova and Jakob Grue Simonsen and Christina Lioma and Isabelle Augenstein},
booktitle = {Proceedings of EMNLP},
publisher = {Association for Computational Linguistics},
year = 2020
}

Lab 2.2

The second lab focuses explorative interpretability via acivation maximization - i.e. TX-Ray https://arxiv.org/abs/1912.00982. Activation maximization works for supervised and self/un-supervised settings alike, but the lab focuses analyzing CNN filters in a simple supervised setting.

Lab 2.2 code

CoLAB2 <- copy this Colab notebook and add code to it for the exercises. There are two types of exercises:

Familiarization exercise: to 'play with and understand' the technique. These allow quickly changes data collection and visualization parameters. They are intended for explorative analysis.

Advanced Exercises: these are optional and concern applications of the technique. They have no solution, but give solution outlines (starter code). Opt-EX1: XAI based pruning with hooks, Opt-EX2 influence of overparameterization (wider CNN with more filters), Opt-Ex3: filter redundancy. Opt-Ex2-3 belong together

Goals of LAB 2.2:

  • learn how to explore and interpret activations in NNs using 'activation maximization' principles
  • learn how to extract activations via forward_hooks
  • exercise how to usefully interpret and visualize activation behaviour
  • exercise how to prune activations -- advanced
  • analyze neuron/ filter redundancy, specialization, generalization - advanced
  • Overall: explore/ develop ideas towards 'model understanding' -- see https://arxiv.org/abs/1907.10739 for a great introduction of 'decision understanding' vs. 'model understanding'

If you find this code useful for your research, please consider citing:

@inproceedings{Rethmeier19TX-Ray,
title = {TX-Ray: Quantifying and Explaining Model-Knowledge Transfer in (Un-)Supervised NLP},
author = {Rethmeier, Nils and Kumar Saxena, Vageesh and Augenstein, Isabelle},
booktitle = {Proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI)},
year = 2020
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.