[논문 리딩] Multi-Task Learning for Knowledge Graph Completion with Pre-trained Language Models

Multi-Task Learning for Knowledge Graph Completion with Pre-trained Language Models

키워드CompletionGraphKGKGCPLM
year2020
저자Bosung Kim et al.
VenueCOLING 2020
MemoLR-RP-RR. KG-BERT에 멀티 테스크 러닝을 붙임.
분류연구
DONE
생성 일시
최종 편집 일시
Working
@inproceedings{Kim2020MultiTaskLF,
  title={Multi-Task Learning for Knowledge Graph Completion with Pre-trained Language Models},
  author={Bosung Kim and Taesuk Hong and Youngjoong Ko and Jungyun Seo},
  booktitle={International Conference on Computational Linguistics},
  year={2020},
  url={https://api.semanticscholar.org/CorpusID:227231134}
}

PKGC에서 baseline으로 사용된 PLM-based KGC 모델 중 하나이다.

Introduction

KG-BERT의 문제점

  1. KGs의 많은 릴레이션 정보들을 놓친다. (Binary cross entropy loss만 사용)
  1. 언어적으로 유사한 후보군들 사이에서 정답을 고르기 어렵다.

    예) 주어진 head, relation : (take a breather, derivationally related for, _ )

    정답 tail : breathing time

    KG-BERT의 예측 tail : snorkel breather, breath

    breath 와 언어적으로 유사하기 때문

이를 해결하기 위해 multi-task learning 방식을 도입했다.

Methodology

KGC를 위한 multi-task learning

MT-DNN의 multi-task learning 프레임워크를 따르고, pre-trained BERT를 공유 레이어로 사용했다. Link prediction, relation prediction, relevance ranking, 세가지 테스크를 합침.

각 테스크들마다 classification layer WRK×HW\in \R^{K\times H}를 갖는다.

  • KK : 레이블의 수
  • HH : BERT의 은닉 크기

입력 시퀀스에는 문장 가장 앞머리에 [CLS][\texttt{CLS}] 토큰이 있고, [SEP][\texttt{SEP}] 토큰이 seperator로 사용됐다.

  • SS : Training set of triple
  • SS' : Negative triple set
  • xx : Input. text sequence of (h,r,t)(h,r,t).
  • CC : [CLS][\texttt{CLS}] 토큰의 최종 벡터
  • WW : classification layer

각 엔티티들은 entity name 과 description으로 표현된다.

예시) Triple : (plant tissue, hypernym, plant structure)

input sequence xx : [CLS][\texttt{CLS}] plant tissue, the tissue of a plant [SEP][\texttt{SEP}] hypernym [SEP][\texttt{SEP}] plant structure, any part of a plant or fungus [SEP][\texttt{SEP}]

Link Prediction (LP)

메인 테스크.

Training : 주어진 트리플이 옳은 것인지 아닌지에 대해 훈련한다. (Binary cross entropy)

Negative triple은 head나 tail을 랜덤한 엔티티로 대체해서 만든다.

f(x)=softmax(CWLPT)=[y0^,y1^],LLP=x{SS}ylogy1^+(1y)logy0^f(x) = \text{softmax}(CW^T_{LP}) = [\hat{y_0},\hat{y_1}],\\ \mathcal{L}_{LP} = - \sum_{x\in\{S\cup S'\}} y\log{\hat{y_1}} + (1-y) \log{\hat{y_0}}
  • WLPR2×HW_{LP} \in \R^{2 \times H} : Link prediction을 위한 classification layer
  • f(x)f(x) : 모델의 최종 출력
  • y{0,1}y \in \{0,1\} : label
  • [s0,s1]R2[s_0, s_1] \in \R^2 : CWLPTCW^T_{LP} 의 출력. s1s_1 은 평가에서 최종 ranking score로 사용된다.

Relation Prediction (RP)

Input : head, tail sequence

[CLS][\texttt{CLS}] plant tissue, the tissue of a plant [SEP][\texttt{SEP}] plant structure, any part of a plant or fungus [SEP][\texttt{SEP}]

Training : 위의 시퀀스가 주어졌을 때, 모델은 relation hypernym 을 예측하도록 훈련된다. (Cross entropy)

g(x)=softmax(CWRPT),LRP=xSylogg(x)g(x) = \text{softmax}(CW^T_{RP}),\\ \mathcal{L}_{RP} = - \sum_{x\in S} y\log g(x)
  • WRPRR×HW_{RP} \in \R^{R \times H} : Relation prediction을 위한 classification layer.
  • RR : Relation의 개수
  • g(x)g(x) : 모델의 최종 출력
  • yRRy\in\R^R : class indicator

Relevance Ranking (RR)

Positive triple들이 negative들 보다 더 높은 점수를 유지하기 위한 목적.

Training : 입력은 LR과 같다. (Margin ranking loss)

h(x)=sigmoid(CWRRT),LRR=xS,xSmax{0,h(x)h(x)+λ}h(x) = \text{sigmoid}(CW^T_{RR}) ,\\ \mathcal{L}_{RR} = - \sum_{x\in S , x'\in S'} \max{\{0,h'(x') - h(x) +\lambda\}}
  • WRRR1×HW_{RR} \in \R^{1 \times H} : Relevance Ranking을 위한 classification layer.
  • h(x)h(x) : 모델의 최종 출력
  • λ\lambda : margin

훈련할 때, 각 테스크마다 미니 배치 DLP,DRP,DRRD_{LP}, D_{RP}, D_{RR} 을 구성해서 모든 데이터들을 합쳤다 D=DLPDRPDRRD = D_{LP} \cup D_{RP}\cup D_{RR} . 각 훈련 스텝 마다 미니 배치는 DD에서 랜덤하게 선택되고, 배치에 해당되는 테스크가 순차적으로 훈련된다.

Experiments

Datasets

WN18RR (Dettmers et al., 2018)

  • WordNet의 부분집합. 영어의 언어 데이터베이스.
  • 엔티티 : 단어 또는 짧은 구문. Definition - Synset definition
  • 릴레이션 : 11가지

FB15k-237 (Toutanova and Chen, 2015)

  • Freebase (Bollacker et al., 2008)의 부분집합. 일반적인 지식을 포함하는 거대한 크기의 그래프 데이터베이스.
  • 엔티티 : 더 일반적인 엔티티들을 갖는다. Definition - descriptions from Xie et al. (2016)
  • 릴레이션 : WN18RR보다 더 길고 복잡함.

Baseline

  • KG-BERT (Yao et al., 2019)
  • TransE (Bordes et al., 2013)
  • DistMult (Yang et al., 2014)
  • ComplEx (Trouillon et al., 2016)
  • ConvE (Dettmers et al., 2018)
  • RotatE (Sun et al., 2019)

Settings

  • Pre-trained BERT-base
  • Fine-tune : 멀티테스크 구조에 3 epoch로
  • mini-batch size : 32
  • Adam optimizer (Kingma and Ba, 2014), learning rate : 2e-5
  • λ\lambda  : 0.1

Evaluation

  • Mean Rank (MR)
  • Mean Reciprocal Rank (MRR)
  • Hits@1, 3, 10

Main Results

KG-BERT와 달리 breathing time 이라는 정답을 찾을 수 있다.

다른 영역에서는 SOTA를 달성했지만, FB15k-237 Hits@10은 RotatE의 성능이 가장 높았다.

이에 대해 저자들은 FB15k-237은 WN18RR 보다 더 많은 릴레이션과 복잡한 그래프 구조를 갖고 있기 때문에, Table 4 의 결과를 통해 PLMs는 KG의 복잡한 구조적 정보를 포착하지 못한다고 추측했다.

728x90