論文標題:KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoning
KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoningarxiv.org
Authors: Bill Yuchen Lin, Xinyue Chen, Jamin Chen, Xiang Ren
Org.: University of Southern California, Shanghai Jiao Tong University
Code: https://github.com/INK-USC/KagNet
1.Motivation
本文針對的數據集是:CommonsenseQA
目標:
- 使機器具備進行常識推理的能力,減小人機之間的差距
- 關於推理的定義:
- 關於常識推理的定義:
- commonsense reasoning utilizes the basic knowledge that reflects our natural understanding of the world and human behaviors, which is common to all humans.
- 從物理的角度:Humans' natural understanding of the physical world.
- 從大衆心理的角度:Humans' innate ability to reason about people's behavior and intentions.
- machines 缺乏可解釋性:
- how the machines manage to answer commonsense questions and make their inferences.
- 爲什麼要引入 常識知識庫 以及其帶來的挑戰:
- knowledge-aware models can explicitly incorporate external knowledge as relational inductive biases.
- enhance reasoning capacity;
- increase the transparency of model behaviors for more interpretable results;
- 挑戰:
- noisy: How can we find the most relevant paths in KG?
- incomplete: What if the best path is not existent in the KG?
- knowledge-aware models can explicitly incorporate external knowledge as relational inductive biases.
1.1This work
提出了一個Knowledge-aware reasoning 框架,主要有以下兩個步驟:
- schema graph grounding (見下圖)
- graph modeling for inference
提出了一個Knowledge-aware graph network 模塊: KAGNET
- 核心是
GCN-LSTM-HPA
結構:- 由GCN, LSTM, 和 hierarchical path-based attentionmechanism組成
- 用於 path-based relational graph representation
KAGNET 模塊總體的工作流:
- 首先,分別識別出 和 中提及的 concept ,根據這些 concept ,找到他們之間的路徑,構建出 (ground) schema graph;
- 使用 LM encoder 編碼 QA 對,產生 statement vector ,作爲
GCN-LSTM-HPA
的輸入,來計算 graph vector ; - 最後使用 graph vector 計算最終的QA對的打分
2.Model
問題 和一個包含 選項的候選答案集
schema graph
2.1 Schema Graph Grounding
2.1.1 Concept Recognition
- n-gram 匹配:句子中的 token 和 ConceptNet 的頂點集合進行 n-gram 匹配
- Note:從有噪聲的知識源中有效地提取上下文相關的知識仍是一個開放問題
2.1.2 Schema Graph Construction
sub-graph matching via path finding
- 採取一種直接有效的方法:直接在Q和A中提及的Concept ( ) 之間查找路徑
- 對於問題中的一個 Concept 和候選項中的一個 Concept ,查找他們之間路徑長度小於 的path,添加到圖中
- 本文中,設置 ,即3-hop paths
2.1.3 Path Pruning via KG Embedding
爲了從潛在噪聲的schema graph中刪除無關的path
- 使用KGE方法(如TransE等)預訓練Concept Embedding和Relation Type Embedding(同時可用於KAGNET的初始化)
- 評價路徑的質量
- 將路徑分解爲三元組集合,一條路徑的打分爲每一組三元組的乘積,通過設置一個閾值進行過濾。
- 三元組的打分通過KGE中的打分函數進行計算(例如,the confidence of triple classification)
2.2 Knowledge-Aware Graph Network
整體的模型結構:
- 使用GCN對圖進行編碼
- 使用LSTM對 和 之間的路徑進行編碼,捕捉 multi-hop relational Information
- 使用 hierarchical path-based attention 計算 relational schema graph 和 QA對 之間路徑的關係
2.2.1 Graph Convolution Networks
使用GCN的目的:
1、contextually refine the concept vector
-
- 這裏的 context 指節點在圖中的上下文,即鄰接關係
- 使用鄰居來對預訓練的Concept Embedding進行消歧
2、capture structural patterns of schema graphs for generalization
3、schema graph 的模式爲推理提供了潛在的有價值的信息
-
- QA對Concept之間的 更短、更稠密的連接 可能意味着更大的可能性,在特定的上下中。
- 評價 候選答案 的可能性
GCN在schema graph上的計算:
- 使用預訓練得到的 concept embedding 作爲 GCN 計算圖節點的初始化表示,即
2.2.2 Relational Path Encoding
定義問題中的第 個 concept 和候選答案中的第 個 concept 之間的第 條路徑爲 :
- 路徑是三元組序列:
- relation vector 由 KGE 預訓練得到;
- concept vector 是 上一環節 GCN 的頂層輸出;
- 每個三元組表示爲: 頭實體、尾實體、關係三個向量的串聯,得到 triple vector;
- 使用LSTM編碼三元組向量序列,得到 path vector:
可以視爲問題中的 concept 和 候選項中的 concept 之間的潛在的關係。
聚集所有路徑的表示,得到最終的 graph vector ;
1、這裏使用了 Relation Network
的方法:
-
- statement vector 爲 LM encoder
[CLS]
的表示 - 關於 RN 的介紹可以參考這篇文章:
- statement vector 爲 LM encoder
徐阿衡:論文筆記 - A simple neural network module for relational reasoning(2017)zhuanlan.zhihu.com
2、通過mean-pooling計算graph vector:這種計算方式稱爲 GCN-LSTM-mean
通過這種簡單的方式將分別從 symbolic space
和 semantic space
中計算的relational representation 進行融合。
3、最終候選項的 plausibility 打分:
2.2.3 Hierarchical Attention Mechanism
考慮到不同的路徑對推理的重要程度不同,採用 mean-pooling 不是一種比較可取的方式。
基於此,本文提出了 hierarchical path-based attention 機制,有選擇地聚集重要的path vector 以及更重要的QA concept 對。
分別從 path-level 和 concept-pair-level attention 來學習 根據上下文建模圖表示:
1、path-level:
2、concept-pair level:
3、最終的graph vector:
Experiments
Transferability
Case Study on Interpretibility
Error Analysis
negative reasoning
- graph grounding 對否定詞不敏感
comparative reasoning strategy
- 沒有進行答案之間的比較
subjective reasoning
- 有些答案是根據帶有主觀性的推理得到的
Analysis & Summary
- KAGNET 可以看做是 knowledge-augmented Relation Network (RN) module