본문 바로가기

Papers/NLP

[리뷰] Structured Prediction as Translation between Augmented Natural Languages (ICLR 2021)

by Paolini et al.

Paper Link : https://openreview.net/pdf?id=US-TP-xnXI 

Code Link : https://github.com/amazon-research/tanl

Contents

1. Structured Prediction
2. Structured Prediction Tasks
3. Introduction
4. Proposed Method

5. Experiments
6. Discussion & Summary

Abbreivation & Keywords

SP : Structured Prediction
TANL : Translation between Augmented Natural Language
PLM : Pre-trained Language Model

Structured Prediction

Types of Prediction

  • Binary classification: Two classes
  • Multi-class classification: Multiple classes
  • Structured prediction: Exponential/infinite labels
    • Exponential : 모든 word에 대한 POS tag를 붙여야 하기 때문, 모든 POS tag에 대한 조합으로 경우의 수가 나옴
    • Infinite : output에 대한 길이 제한이 없음
    • eg. 기계 번역 (Machine Translation), 개체명 인식 (Named Entity Recognition, NER) 등

Structured Prediction

  • Class는 셀 수 없을 정도로 많다. 
  • 문제의 structure를 활용할 수 있는 방법론이 필요하다.
  • 모델의 output 간의 dependency가 존재한다.

(Ref) CMU Neural Nets for NLP 2021 (11): Structured Prediction with Local Independence Assumptions https://www.youtube.com/watch?v=SId98zY-D9Y

Related Works

SP의 고전적인 방법론들은 classification 알고리즘의 일반화이다. 예를 들면, Conditional Random Fields (CRF), Structured Perceptron, Structured Support Vector Machine 등이 있다.

이 연구는 multi-task learning과 SP를 위한 sequence-to-sequence (seq2seq) 모델 연구와 연관이 있다. Translation과 summarization 문제를 text-to-text 문제로 풀어냈다. Transformer-based LM을 이용한 transfer learning의 저력을 이용했다.

또 다른 연구는 특정 SP 문제를 풀기 위해 output을 직접적으로 생성하는 방법을 선택했다.

이 연구와 가장 가까운 연구는 GSL이라는 연구로 augmented natural language라는 용어를 도입했다. Sequence labeling tasks에 generative 방법론을 사용했다. 기존 연구와 이 연구의 주된 차이점은 label semantics를 활용하고 여러 structured prediction tasks를 통합하기 위한 하나의 일반화된 프레임워크를 제안했다는 점이다.

 

Structured Prediction Tasks

  • Joint entity and relation extraction
  • Named entity recognition (NER)
  • Relation classification
  • Semantic role labeling (SRL)
  • Event extraction
  • Coreference resolution
  • Dialogue state tracking (DST)

 

Introduction

기존의 연구들은 BERT와 같은 pre-trained transformer encoders 위에 task-specific discriminators를 붙인 모델 구조로 다양한 타입의 relations와 attributes를 예측하는 structured prediction 문제를 풀었다.

기존 방법론은 두 가지 한계가 있다:

  1. Latent knowledge를 제대로 사용할 수 없다. Latent knowledge는 pre-trained model이 이미 가지고 있는 semantics of task labels에 대한 지식이다. (e.g. person은 book을 쓸 수 있는 author라는 relation에 대해 미리 알고 있다.)
  2. 특정 task에 학습시킨 discriminator를 사용하므로, 한 개의 모델을 학습시켜 여러 tasks를 해결하기란 어렵다. Discriminator의 task-specific한 부분을 변형하지 않고 fine-tuning을 통해 한 task에 대해 학습하여 다른 task를 푸는 것 역시 어렵다(transfer learning, 전이 학습).

위의 한계를 극복하기 위해, latent knowledge를 활용할 수 있고, 여러 tasks를 단일 모델로 해결할 수 있는 "generative model"을 쓸 것이다.

[필자 주] Classifier 대신 discriminator라는 용어를 쓴 이유는 generative model과 대비되는 효과를 주기 위함이다.

 

이 연구의 주된 researh question은 다음과 같다.

"Pre-trained model이 가지고 있는 label semantic에 대한 latent knowledge를 사용하며, 여러 structured prediction tasks를 풀 수 있는 단일 구조를 활용한 framework를 설계할 수 있는가?"

 

Contributions

  • 단일한 방법으로 다양한 structure prediction tasks를 풀 수 있는 프레임워크 TANL(Translation between Augmented Natural Language)를 제안했다.
  • 다양한 structured prediction tasks에서 state-of-the-art 성능을 거두었다.
  • 단일한 모델을 동시에 여러 tasks에 학습하고(multi-task learning), single-task 모델과 견줄 수 있거나 더 좋은 성능을 보였다.
  • Label semantics에 대한 지식 전이 (transfer of knowledge)를 개선하므로써, few-shot 세팅에서 좋은 성능을 보였다.
  • 이 프레임워크는 Generative 모델 기반으로, output token likelihood를 calss score 대신 사용하면, discriminatively 평가할 수 있다.

 

Proposed Method

Augmented natural languages

Relation extraction task의 목표는 a set of entities (1개 이상의 연속된 tokens)와 a set of relations between pairs of entities를 추출하는 것이다.

Relation은 비대칭적이며 처음 오는 entity를 head entity, 나중에 오는 entity를 tail entity라고 한다.

 

Relation extraction task 예제

우리가 원하는 output은 input sentence를 복제하고 일정 패턴을 가지고 확장하여, 구조적인 객체(structured objects)로 디코딩될 수 있는 형태이다.

Entities와 relations는 특수한 토큰인 [ ]로 표시한다. | 로 구분하여 오른편에 entity type 및 a list of realtions가 올 수 있다. A list of relations는 (relations type) = (tail entity)의 포맷을 가진다.

위에 기술한 과정에서 input sentence의 모든 단어를 output으로 복제한다. 1) 모호성(ambiguity)를 줄이고, 2) 학습에 도움이 되기 때문이다.

 

Decoding structured objects

우리는 augmented natural language에서 structured objects를 얻기위해 문장을 해독(decoding)한다. 그 과정은 다음과 같다.

  1. 특수한 토큰 [ ]을 제거하면서 entity type과 relations를 추출한다. 
  2. Dynamic programming(동적 프로그래밍, DP)을 통해 입력 문장과 위에서 얻은 깔끔한 출력 문장을 맞춘다(align).
    1. 이 과정은 모델이 acyclovir라는 정답 대신 Aciclovir라는 오타를 output으로 내놓았을 때, A-cicl-o-vir를 a-cycl-o-vir에 일치시킴으로써, 맞는 정답 acyclovir를 추론하는 것이다.
    2. 이는 모델이 내놓은 완벽하지 않을 수 있는 생성된 결과물(generation)의 견고함(robustness)을 개선한다.
  3. Output의 각각 raltion에 대해 예측된 tail entity와 가장 일치하는 가장 가까운 entity를 찾는다.
  4. Entities나 relations의 예측된 type이 dataset-dependent list of types에 포함되지 않으면 버린다.

Multi-task learning

이 방법론은 쉽게 여러 dataset에서 학습을 시키는 multi-task learning을 적용해볼 수 있는데, 이 세팅에서는 입력 문장의 접두사로서 task separator ":" (eg. ade :)를 붙인다.

 

Categorical prediction tasks

Classification 문제를 푸는 또 다른 방법으로, 모든 가능한 outputs에 대해 class scores를 계산하고 가장 높은 score를 가지는 class를 예측하는 방법이 있다. 이 방법론에서는 scores 대신 output sequence likelihood를 쓸 수 있다. 이는 low resource setting에서 견고함을 개선하는 방법(a robust way)이라고 한다.

 

Experiments

모든 실험은 pre-trained T5-base 모델을 사용했고, hyperparameter는 통일했다. (dataset-specific한 maximum sequence length 같은 경우만 제외하고)

 

5.1 Single-task vs. Multi-task

Data settings:

  1. Single dataset
  2. Multiple datasets for the same task (multi-dataset)
  3. All datasets across all tasks (multi-task)

5.2 Low-resource settings

TANL은 다른 방법론에 비해 data-efficient하다. 이전의 few-shot 방법론들은 label types이 풍부한 경우와 부족한 경우가 섞여있는 real-world data로 규모 확장(scale)이 잘 이루어지지 못했다. 그러나 TANL은 통합된 프레임워크로서, 풍부한 resource를 제공하는 경우와 적은 resource로 전이 학습(transfer learning)해야 하는 경우에도 좋은 성능을 보였다.

 

5.3 Ablation labels

  • Numeric labels : Label semantics 대신 numeric labels를 사용했다.
    • 예를 들어, PER, LOC 또는 numerical labels 대신 person, location을 사용하는 편이 PLM이 가지고 있는 latent knowledge를 십분 활용할 수 있다.
  • Abridged output : Augmented natural language format을 사용하는 대신, 입력 문장의 모든 단어를 반복하지 않는 포맷을 사용했다.
  • No DP alignment : Dynamic programming alignment을 사용하는 대신, exact word matching을 사용했다.
    각 Ablation에 따른 성능 하락. Low resource setting에서 더 지대한 영향을 보인다.

Ablation 방법에 대한 구체적 예시

 

Discussion & Summary

  • Text-to-text 방법론을 사용해 structured prediction 문제를 풀 수 있는, 간단하고 단일화된 프레임워크 TANL를 제시했다.
  • Discriminative 모델들과 달리, TANL은 generative 모델로서 input을 augmented natural language 포맷의 output으로 번역한다. 이 포맷은 유연하여 다양한 task를 단일 프레임워크로 다룰 수 있다는 장점이 있다.
  • Generative 모델의 한계 중 하나는 sequence length L에 따라 각각의 token을 생성하는 데 소요되는 time complexity $O(L^2)$이다. 그러나 최신 attention mechanism은 $O(L \log L)$ (Reformer), $O(L)$ (Linformer)까지 time complexity를 개선했다.
  • 이 연구는 generative 모델의 제약이 느슨하여(unconstrained), structured prediction 문제를 푸는 견고한 방법론(a robust approach)이 아니라는 기존의 편견에 반박을 제시한다. 기존에 discriminative 방법론으로만 풀어왔던 문제들에 대해 generative 모델과 최신 연구 트렌드를 결합한 연구가 탄생할 것을 촉구한다.

Q&A

What is this method's technical contribution except for suggesting extension for T5 models?

 

반응형