3.5 後設可解釋性研究
3.5.4 人類認知與模型可解釋性
‧
一個 HIT (Human Intelligent Task),即每個標註者一次進行一個標 註 20 筆資料標註的 HIT,而我們限制每位標註者最多標註兩份不同‧
‧
entailment, neutral, contradiction 範例各一種,其中有 3 種方法在各自 範例中的解釋。在後續的判斷解釋來自於哪個方法的部分,則一共有 來自 3 個關係的 9 個題目。在選擇三個解釋方式的範例及問題時,皆有例子背後所設定的模式或 特性,以下為第一次投注前受測者所觀看的 entailment 例子:
Premise 1
When a mosquito drinks the blood an infected person the insect also
swallows the malaria parasite which then must incubate and multiply before migrating into the insect's saliva. The process can take weeks. And because mosquitoes are small-bodied and cold-blooded outside temperatures make a big difference in how long it takes before they can transmit the disease. If it happens too slowly the insects die before they can infect anyone. In general the malaria parasite does better at warmer temperatures which is why the disease occurs most often in tropical environments. But with mathematical models Thomas has found that even when conditions are warm highly fluctuating temperatures over the course of a day slow down the rate of parasite incubation and larval development in the mosquito.
Hypothesis: Warm weather facilitates the spreading of malaria.
Relation: entailment
‧
Robot A (3MTL@SD): In general the malaria parasite does better at warmer temperatures
Robot B (3MTL@AS): malaria parasite does better at warmer temperatures which is why the disease occurs most often in tropical environments. But with mathematical models Thomas has found that even when conditions are warm.
Robot C (Pretrained@AS): the disease occurs most often in tropical environments. But with mathematical models Thomas has found that even when conditions are warm highly fluctuating temperatures over the course of a day slow down the rate of parasite.
從上例我們可以看到 android A 所給予的解釋相當簡要,同時也提供
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
圖 3-7 機器人呈現解釋及信任度、理由之做答
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
在模型的區間判斷競賽中,三個模型一共需要回答 9 道題目,每一道 題目都會有一對 P 和 H,模型則需要回答其所預測能夠決定 P 和 H 關係之區間。在每一道題目,受測者僅能看到模型所做的回答,無 法看見答案來自於哪一個模型;並需要受測者依據競賽開始前,其所 觀看三個模型在範例作答所得知的模型特性,來標註他們認為答案分 別來自於哪個模型。當進行到第 3 題和第 6 題時,會詢問受測者是 否需要重新分配他們的籌碼,我們可以借此在事後分析受測者改變或 者沒有改變選擇的原因。當 9 題都結束並公布結果前,受測者有最後 一次重新分配籌碼的機會。
圖 3-8 受測者辨識區間來自於哪個機器人並建立認知
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
- 實施程序:在此部分的實驗,每一個完整的競賽過程為一個 HIT。在 收集結果時,我們同樣透過結合人工和自動化檢核機制來確保結果的 品質,自動化檢核機制確認受測者每輪投注的金額總和是正確的、原 因說明內容不為空白和在判斷解釋時進行有效之回答;人工檢核為確 認其回答內容為有效之論述,如受測者若在理由欄填上文字,但其文 字為隨意貼上之內容,則需透過人工檢核篩除。同時我們也限制每一 位受測者僅能進行一次本實驗,進行一次實驗以上和做答無效者,我 們會拒絕其回答結果並告知原因。
- 目標資料:收集完畢後,我們將收到受測者對於三個取出解釋方式,
(1) 在區分三個不同解釋方式的能力如何,是否能夠有效區別三個不 同的解釋方式,又或是無法區別三個解釋方式間的不同。(2) 在整個 競賽中對三個解釋方式的信任度,透過 4 個輪次的消長,我們可以得 知其信任度的變化及變化之原因。
- 分析方法:透過受測者在初次下注所給予的賭金,我們可以知道受測 者對三個模型的信任度為何及為何做出這樣的決策,並藉此分析受測 者在選擇偏好解釋時的思維模式。接著每一輪的觀察使用者對於解釋 來自哪個模型的猜測,我們可以觀察受測者的認知是否和前面一致,
若不同的話可能是發生哪些變化。最後透過整個過程賭金的變化及理 由,我們可以分析三個方法所給出的解釋在人類信任度中的優勢與劣 勢為何,人類又對哪個解釋方式較為偏好。
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
第四章
實驗結果與討論 4.1 實驗設定
4.1.1 資料集
我們使用了 RTE5 資料集做為整個實驗的基礎,我們利用不同的標註資料來以 不同的任務形式訓練模型,其一共有三種任務,一為蘊含關係識別的三分類任 務,模型須判斷兩者關係為 entailment, neutral 或 contradiction;二為語義現象 多標籤分類,模型須判斷兩者是否有以下關係:Disconnected Relation、
Exclusive Argument、Exclusive Relation、Missing Argument 及 Missing
Relation;三為區間判斷任務,模型須判斷於 P 中,能夠決定兩者蘊含關係之 區間。以下為三種標註之範例:
Premise
The disappearance of York University chef Claudia Lawrence is now being treated as
suspected murder, North Yorkshire Police said. However detectives said they had not found any proof that the 35-year-old, who went missing on 18 March, was dead. Her
father Peter Lawrence made a direct appeal to his daughter to contact him five weeks after she disappeared. His plea came at a news conference held shortly after a £10,000 reward was offered to help find Miss Lawrence. Crime stoppers said the sum they were offering was "significantly higher" than usual because of public interest in the case.Hypothesis: Claudia Lawrence is 35 years old.
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
Label 1: entailment
Label 2: Neg_disconnect_rel, Neg_excl_arg, Neg_excl_rel, Neg_miss_arg, Neg_miss_rel, [1, 0, 0, 0, 0]
Lable 3: Claudia Lawrence is now being treated as suspected murder, North Yorkshire Police said. However detectives said they had not found any proof that the 35-year-old
其中蘊含關係識別和區間判斷共有 600 筆資料,語義現象分類則有 218 筆資料。
4.1.2 效能評估指標
在文本蘊含識別之三元分類任務及語義現象多標籤分類任務上,我們分別採用 了不同的指標來評估其效能。在文本蘊含識別上,我們採用了正確率
(Accuracy)。在語義現象多標籤分類上,我們採用了精確度(Precision)和 F1 分數(F1 score)。在區間判斷任務上,我們採用了吻合字數和 F1 分數。
在文本蘊含識別任務中,我們會得到文本蘊含識別對 600 筆測試資料所預 測的三個結果 entailment, neutral 及 contradiction,並透過這 600 個結果來計 算正確率來評估模型。
在語義現象分類上,由於資料集有不平均的現象,因此我們以精確度和 F1 分數做為評估指標,希望能夠透過精確度的計算,來公正地觀察模型在判斷不 平均資料時的精確度。在每一筆資料的五個標籤中,我們先個別計算單一資料 的準確度,計算公式如下:
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
Precision = 𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒
𝑇𝑟𝑢𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒 + 𝐹𝑎𝑙𝑠𝑒 𝑃𝑜𝑠𝑖𝑡𝑖𝑣𝑒. (13) 分母為模型判斷為有該語義現象之數量,分子為正確判斷有該語義現象之 數量。
F1 分數,為統計分析之二分類的精確度評估指標,其透過精確度及召回率 計算後得到,為精確度和召回率之平均值,計算公式如下:
F1 Score = 2 × 𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 × 𝑅𝑒𝑐𝑎𝑙𝑙
𝑃𝑟𝑒𝑐𝑖𝑠𝑖𝑜𝑛 + 𝑅𝑒𝑐𝑎𝑙𝑙 . (14) 最後將 218 筆的精確度及 F1 分數平均做為評估。
在區間判斷任務上,我們計算模型所預測的區間,和標註區間吻合的字數 數目,及利用兩者計算其 F1 分數。
在實驗中,我們以文本蘊含識別做為唯一任務進行評估,後加入語義現象 多標籤分類和區間判斷任務作為次要任務後,再依各任務的評估指標來觀察文 本蘊含識別之模型進步幅度。
4.1.3 可解釋性評估指標
在我們的可解釋性評估中,使用了 2 種從模型注意力中取出解釋的方式:
- MAX: 以注意力分數排序,取元素之注意力分數最大值後排序。
- SUM: 以注意力分數排序,取元素之注意力分數加總後排序。
接著我們以 2 種評估指標對上述兩種解釋方法做評估,其一為平均倒數排 名,一為 F1 分數。
‧
平均倒數排名(mean reciprocal rank, MRR)為一依據排序正確性進行評估 的機制。在查詢結果中,若第一個結果與查詢匹配,則分數為1,若第二個結
‧
預訓練模型(Pretrained):預訓練模型僅擁有較泛用的知識,並未針對 特定任務進行微調。
‧
又以三任務學習的評估指標最高,分別為 0.5344,0.5685,0.2304 和 0.2330,
即模型能夠更加關注到關鍵的資訊。在計算模型之間效能提升顯著性時,我們
LOSAIL Qatar (AFP) Torrential rain caused the season-opening Qatar MotoGP to be cancelled on Sunday leaving officials and teams in a frenzy before deciding to race on Monday instead at this floodlit desert venue. Monsoon-like conditions accompanied by swirling winds arrived just moments before Australia's Casey Stoner on pole position was due to lead defending world champion Valentino Rossi and the other riders away on the warm-up lap. "It's just unlucky with the weather" said Australian Ducati rider Stoner the 2007 world champion who was bidding for a third successive win here.
‧
Hypothesis: Valentino Rossi won the season-opening Qatar MotoGP.
Attention Span: Torrential rain caused the season-opening Qatar MotoGP to be cancelled
Top 3: rain MotoGP cancelled
Top 5: rain caused Qatar MotoGP cancelled
Top 7: Torrential rain caused season-opening Qatar MotoGP cancelled
在本段的實驗中,我們僅採用 SUM@F1 做為評估,在【表 4-2】中可以
‧
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
確判斷上,正確率和可解釋性指標則為同時上升,代表模型的辨識能力 有增強。
Entailment
Model Accuracy (%) MAX@F1 SUM@F1 MAX@MRR SUM@MRR Overview
Pretrained 20.0 0.5610 0.5909 0.2447 0.2304 RTE 71.1 0.5844 0.6002 0.2476 0.2302 RTE+SP 73.4 0.5797 0.6100 0.2509 0.2361 RTE+SP+SD 75.1 0.6205 0.6562 0.2542 0.2574
Correct
Pretrained 0.5332 0.5731 0.2347 0.2224 RTE 0.6026 0.6151 0.2570 0.2399 RTE+SP 0.6011 0.6322 0.2666 0.2509 RTE+SP+SD 0.6575 0.6963 0.2740 0.2766
Incorrect
Pretrained 0.5678 0.5952 0.2472 0.2323 RTE 0.5405 0.5644 0.2248 0.2069 RTE+SP 0.5220 0.5502 0.2083 0.1961 RTE+SP+SD 0.5114 0.5378 0.1959 0.2009
表 4-3 蘊含關係為蘊含之可解釋性評估
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
Neutral
*Model Accuracy (%) MAX@F1 SUM@F1 MAX@MRR SUM@MRR Overview
Pretrained 37.0 0.3733 0.4049 0.1916 0.1795 RTE 58.1 0.3939 0.4084 0.1966 0.1765 RTE+SP 44.3 0.3870 0.4400 0.1979 0.1851 RTE+SP+SD 70.8 0.4199 0.4478 0.2036 0.2054
Correct
Pretrained 0.3589 0.4004 0.2019 0.1819 RTE 0.3716 0.3898 0.1894 0.1771 RTE+SP 0.3418 0.3668 0.1867 0.1660 RTE+SP+SD 0.4092 0.4385 0.2037 0.2044
Incorrect
Pretrained 0.3815 0.4075 0.1937 0.1782 RTE 0.4242 0.4337 0.1894 0.1756 RTE+SP 0.4222 0.4479 0.2066 0.2000 RTE+SP+SD 0.4454 0.4700 0.2031 0.2078
表 4-4 蘊含關係為不相關之可解釋性評估
‧
Pretrained 0.4634 0.4757 0.1933 0.1813 RTE 0.4912 0.4860 0.2008 0.1795 RTE+SP 0.4647 0.4884 0.1915 0.1825 RTE+SP+SD 0.4888 0.5315 0.2002 0.1934
Incorrect
Pretrained 0.4965 0.5455 0.2149 0.2066 RTE 0.5108 0.5317 0.2167 0.1996 RTE+SP 0.5189 0.5332 0.2173 0.2054 RTE+SP+SD 0.5232 0.5662 0.2181 0.2232
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
Metric/Accuracy Correlation (SUM@F1)
Model Accuracy (%) Correct Incorrect Correlation Entailment
Pretrained 20.0 0.5909 0.5952 -0.03
RTE 71.1 0.6151 0.5644 0.11
RTE+SP 73.4 0.6322 0.5502 0.17 RTE+SP+SD 75.1 0.6963 0.5378 0.30
Neutral
Pretrained 37.0 0.4004 0.4075 -0.29
RTE 58.1 0.3898 0.4337 -0.22
RTE+SP 44.3 0.3668 0.4479 -0.12 RTE+SP+SD 70.8 0.4385 0.4700 -0.07
Contradiction
Pretrained 43.0 0.4757 0.5455 -0.14
RTE 24.9 0.4860 0.5317 -0.10
RTE+SP 32.4 0.4884 0.5332 -0.09 RTE+SP+SD 37.7 0.5315 0.5662 -0.06
表 4-6 蘊含關係辨識與注意力區間之相關性
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y 4.3 後設可解釋性建模
本章呈現我們依注意力分數高低,擷取字詞並還原成 P 中之區間的方法及結 果,並與區間判斷任務所得到之結果進行比較。
4.3.1 後設可解釋性評估
在區間判斷方面,我們使用 beam search 進行結果的搜尋,透過預測區間的起 始點和終點來取得 P 中之區間。在注意力分數擷取字詞部分,我們使用了 3.5.3 節所介紹之方法。
我們比較了六個模型,其中兩個方法是使用 3 項多任務學習和單一區間判 斷任務的區間判斷器取得 P 中之區間,餘下四種為使用 4.1.1 之四個模型之 注意力分數,透過前述方法擷取出,以下為方法概述:
- 預訓練模型(Pretrained, attn@SUM):未針對特定任務進行微 調,並從其注意力分數擷取區間資訊。
- 單一蘊含關係識別(Single RTE, attn@SUM):僅訓練模型進行蘊 含關係識別任務,並從其注意力分數(attention score)擷取區間資 訊。
- 單一區間判斷(Single SD, prediction):僅訓練模型進行區間判斷 的任務,無其他任務幫助學習。
- 雙任務學習(RTE + SP, attn@SUM):訓練模型進行蘊含關係識 別及語義現象多標籤分類任務,並從其注意力分數擷取區間資訊。
‧
Model Mechanism Supervised Exact Precision Recall F1 Pretrained Attn@SUM 11.72 58.49 80.82 62.20
‧
‧
I was nearly charged with petty theft for pilfering coffee at the illustrious Hippod rome Building. But lest I be judged too quickly I must convey the sublimity of th e fourth floor's coffee machine. Harry Houdini performed at the Hippodrome at 1 120 Avenue of the Americas near 44th Street. Many of the best and most famous performers of the time appeared there. It was one of the biggest and most succes sful theaters of its time capable of accommodating 5200 people.
Hypothesis 1: Harry Houdini was a magician.
Attention Span 1: Harry Houdini performed at the Hippodrome Relation 1: neutral
在【表 4-9】的情境中,兩者的關係為 neutral,但是可以透過關鍵的區間