模型的解释性三部曲-总结

关于三篇解释性文章的总结

细节

第一篇
训练方法:
先计算出每个 word的beta值-important score.给定长度为k的phrase,可以算出这个phrase在class1和class2下的average effect需要用到beta的值计算。因为即使每个相同的word在不同的sentence下的beta score也不一样,所以要take average。如果对class1影响大于class2,我们给这个phrase标记为class1, otherwise 给标记为class2.

  1. Extract features
    由于计算庞大,所以计算所有phrase的score不太现实。 作者这里用到的方法是:先给定一个阀值c=1.1,只取出连续word的score都 大于这个阀值。然后再rank一下选出来的candidate。在这里需要强调的是,根据文章前面的描述,每个phrase 已经被计算出了相对应的class label。
  2. Fit 一个 简单的rule-based classifier
    Pattern matching: 给定一个sentence 和 一组已经是降序排列的 candidate phrase(1中),这个愚蠢的classifier会很简单的进行搜索。遍历given sentence的每一个phrase,然后做跟candidate set里的phrase 做matching。一旦找到了相对应的phrase,那么这个sentence的class就是在candidate set里被match的phrase 的class。

任务1: sentiment analysis
data:Yelp review polarity (2015). Train data: 560,000, Test data: 38,000
positive—4 or 5 stars, negative—one or two star.
Average length: 160.1

data: Stanford Sentiment Treebank. Train/dev/test, 6920/872/1821
at sentence level, so has much shorter document length.
在这里插入图片描述
For SST, author also report previous result by using naïve bayes in bag of words.

第二篇
实验:
train linear model的时候,作者对其训练方法有所改进, 例如随后要用到的logistic regression。
bag of words—sum pre-trained Glove vectors and add an additional linear layer from word embedding dimension 300 to the number of 2 classes。

SST 用到的方法

  1. SST: movie review ranging from 2 to 52 words.
    有review-level label, 也有label for phrase in the binarized constituency parse tree.

  2. train a LSTM with 87.2% accuracy
    word dimension----300
    hidden representation—168
    word vector-----initialized with pretrained Glove vector

  3. run a logistic regression with 83.2%
    with bag of words

Yelp用到的方法

  1. 数据描述略
  2. LSTM with 4.6% error
  3. Ngram Logistic regression with 5.7% error
  4. 鉴于计算因素,作者只是report interpretation result on a random subset of sentences of length at most 40 words.
    Baseline:
    Cell decomposition(第一篇的方法), leave one out, gradient time input

讲cd多牛之前,作者用其与unigram coefficient of logistic regression 做比较
此处用到了word level的CD

在这里插入图片描述
经过上图的验证后,作者开始讨论CD在更复杂的结构中的重要性—identity dissenting Subphrases

作者说在phrase的长度小于等于5的时候,其他的baseline的模型效果都没有cd好。
For example: 在“used to be my favorite”中的 “favorite”会被其他的解释模型定为strong negative or neutral。但是这个词在logistic regression中是很positive的词并且在CD中也很positive。

接下来为了验证CD的效果, 作者先search for phrases consisting dissenting sub phrases 根据logistic regression ngram coefficients的绝对值大于 1.5的标准。

随后作者对被筛选出来的phrases进行cd score的计算。好的结果应该是positive的distribution和negative的distribution是well separated.

在这里插入图片描述
Similarly, for SST data, using similar searching criterion, they can derive the same conclusion as above.
Similarly, for SST data, author also show that by using CD, they show that LSTM also learned negation interaction. here the calculation is nontrivial. Given already searched negation phrases, the negation interaction is by computing the CD score of the entire phrase and subtracting the CD scores of the phrase being negated and the negation term itself

第三篇.都在图里
如果理解了前两篇,第三篇就比较好理解了。先计算上一层的所有phrase的CD值,再选出每个phrase的和CD difference,之后通过cd difference score进行排序,最后选出k个最高的score做为下一层的clusters。
在这里插入图片描述

在这里插入图片描述

总结

第一片文章提到了两个算法
一个是cell decomposition,一个是cell difference
Cell decomposition 只考虑的single word的effect
Cell decomposition考虑到了forget gate相关的effect

Training和fit model都比较笨重:
计算所有phrase的important score 和起对应的class label。有个threshold c。每个phrase 的每个word的important score 应该大于这个c值。最后把这些phrase按降序排列。
给定一个sentence 做 pattern matching

第二篇
用到了contextual effect
作者先fit ngram logistics regression model。把feature coefficients当做gold standard important score

这篇文章有个细节,做任何一个task之前,都是先根据task的要求用logistics regression的coefficients做一组search工作。
例如:dissenting phrase 是根据任何一个phrase的score的absolute value 大于1.5选出来的

选出这些phrase之后,CD的工作才开始。用CD计算each subphrase的important score。跟其他的方法比较后,只有CD可以uncover原本的dissenting effect。

第三篇
主要贡献是:作者generalize CD in difference DNN model
ACD 可以帮助diagnose wrong prediction

给定一个wrong(right) prediction,作者建立了hierarchical tree的形式帮助人更好的diagnose which part of the model made worng prediction.

细节都在前面给的algorithm1 里面。

自己不成熟的想法

我的问题是这种解释模型的方法 可不可以应用到其他的情境下。

问题:简单的 lstm是否真学到了 这层关系?

如果没学到
1.1.1 我们可以从建立复杂模型的角度去学习这个关系。这样的话 原有的cd 可能无法 解释。所以对于这个任务,我们既需要见自己的复杂模型,也需要有自己的cd 解释。这个复杂模型,我目前的想法是想加一层causal effect,然后自己的cd也是建立在causal effect这个基础上。
1.1.2 我们可以manually 建立含有这层关系的dataset,然后用原有的简单的cd 去解释。但是这个方法很trivial。这个也是作者之前的套路。这点可以加到paper的drawback里。
如果学到了
看看cd能不能学到这层关系。
如果不行,要用improved cd去找这层关系。
如果可以,那就牛了—but I highly doubt it.
想法2
至于说,如何得到causal effect,暂时的想法:能不能用设立一个hidden variable,这个hidden variable的distribution是可能有两个modal,一个是cause的distribution,另一个是result的distribution。也不知道可不可以。。。。

想法3
给定一个问题,QA会返回相对应的answer。
用一种解释的方法,来看哪个字or phrase对答案中的关键字产生影响
用linear regression 去做model,找到coefficients最大的word?

这里是引用
【1】AUTOMATIC RULE EXTRACTION FROM LONG SHORT TERM MEMORY NETWORKS
【2】BEYOND WORD IMPORTANCE: CONTEXTUAL DECOMPOSITION TO EXTRACT INTERACTIONS FROM LSTMS
【3】HIERARCHICAL INTERPRETATIONS FOR NEURAL NETWORK PREDICTIONS

猜你喜欢

转载自blog.csdn.net/weixin_32334291/article/details/87506521
今日推荐