SlideShare a Scribd company logo
1 of 21
AI NLP
Challenge
BERT fine-tuing &
Performance Improvement
조민석, 장영록, 박지영
AI NLP
Challenge
Content
Step
1
Problem
pretrained BERT의 한계
step
2
step
3
Solution
성능 향상을 위한 해결책
Result
모델의 성능향상 결과
2
AI NLP
Challenge
Step
1
Problem
pretrained BERT의 한계
step
2
step
3
Solution
성능 향상을 위한 해결책
Result
모델의 성능향상 결과
AI NLP
Challenge
3
AI NLP
Challenge
Problem
AI NLP
Challenge
Extreme imbalance of
Question-Type
Same Questions
Different Answers
Low performance
of Single Model
다채로운 표현이 가능한 한국어의
특성에 기반한,
"같은 의미를 가진" 다양한 질의에
대하여 상이한 답변 추론
KorQuAD 1.0의 질문유형의
불균형으로 인한 다양한 질문
유형 대응 한계
SQuAD leaderboad에서,
Ensemble model의 성능이
Single model보다 높음
4
AI NLP
Challenge
Problem
Extreme imbalance of
Question-Type
AI NLP
Challenge
5
구문 변형, 56.4%
여러 문장의 근거
활용, 19.6%
어휘 변형(유의어),
13.6%
어휘 변형(일반상식),
3.9%
논리적 추론,
3.6%
출제 오류, 2.9%
https://www.slideshare.net/SeungyoungLim/korquad-introduction
KorQuAD 1.0 Slideshare 참조
KorQuAD 1.0 질문 유형
Extreme imbalance of Question-Type
: KorQuAD 1.0의 질문들의 유형 중에서 단순히 평서
문을 의문문으로 바꿔서 질문한 “구문 변형”의 질문 유
형이 반 이상을 차지하고, 나머지 유형들은 그에 비해
지나치게 작은 비율을 차지하고 있음
 구문 변형을 제외한 나머지 유형의 질문들에 학습
량이 상대적으로 부족
 모델의 오답률 증가 요인
(왼쪽 그림은 Random으로 KorQuAD dev 데이터셋에
서 데이터를 추출하여 얻은 결과입니다.)
AI NLP
Challenge
Problem
Same Questions
Different Answers
AI NLP
Challenge
6
Adversarial example in MRC task
: 서로 같은 의미 정보를 갖는 다른 표현의 질문들을
AI 모델이 다르게 이해하여, 다르거나 틀린 답변을
내보내는 경우
예시) 동일한 의미를 같지만 다르게 표현된 질문들
- 질문1: 클린봇의 탐지 능력은 몇 배 향상 됐어?
- 답변1: 기존보다 5배
- 질문2: 클린봇 탐지 성능은 얼마나 업그레이드 됐
어?
- 답변2: 문장의 맥락
네이버가 악성 댓글(악플)에 욕설이 없어도 뉘앙스까지 잡아내 차단하는 기술을 도입했다. 업
그레이드된 ‘클린봇’은 모욕적인 표현, 무례한 뉘앙스까지 탐지해낸다. 네이버는 ‘클린봇’ 2.0
엔진을 포털 뉴스 서비스에 적용했다고 18일 밝혔다. 네이버에 따르면 악플을 차단해주는 인
공지능(AI) 기반 ‘클린봇’의 탐지 능력은 기존보다 5배 향상됐다. 네이버는 댓글 서비스 개편
이후 악플이 줄어들자 댓글 공간이 갖는 소통의 순기능을 회복시키기 위해 차단 기술을 끌어
올렸다. 클린봇은 네이버 스포츠·쥬니버·연예·뉴스 서비스 등에 설치돼 욕설과 비속어가 들어
간 댓글을 탐지하면 자동으로 블라인드 처리해주는 시스템이다. 기존에는 단어 중심으로 찾아
냈다면 업그레이드 이후 문장의 맥락까지 탐지할 수 있게 됐다.
뉴스 기사
기존보다 5배 문장의 맥락
클린봇 탐지 성능은 얼마나 업그레이드 됐
어?
클린봇의 탐지 능력은 몇 배 향상 됐
어?
Adversarial example 예시
AI NLP
Challenge
Problem
Low performance
of Single Model
AI NLP
Challenge
7
SQuAD 2.0 Leaderboard
Performance Gap between Single
and Ensemble
: SQuAD 2.0 Leaderboard 상에서 상위권은 모두
Ensemble 기법을 활용한 모델이 차지하고 있으며,
Single 모델의 최고 순위는 9위에 그침.
AI NLP
Challenge
Step
1
Problem
pretrained BERT의 한계
step
2
step
3
Solution
성능 향상을 위한 해결책
Result
모델의 성능향상 결과
AI NLP
Challenge
8
AI NLP
Challenge
AI NLP
Challenge
Solution
Data Augmentation Adversarial Training Ensemble Model
AI 모델의 질문 이해도를 강화시키기
위해 Adversarial example을 학습과
정에 활용
구문이해 및 질의응답 과제에
활용될 수 있는 다른 Dataset
추가(AI Hub의 newsQA)
채워넣어야함
9
AI NLP
Challenge
AI NLP
Challenge
Solution
Data Augmentation
10
Problem KorQuAD 1.0의 질문 유형 별 구성 비율의 불균형이 심함
Our solution Data augmentation을 통해 각 유형의 데이터 수를 늘려 많은 학습량 확보
Expected result 각 유형에 대한 정답률을 높임으로써 전체 성능 향상
KorQuAD 1.0
: 총 66,181 개
질의응답 쌍
newsQA
: 총 252,604 개
질의응답 쌍
AI Hub의 newsQA 데이터 추가
• KorQuAD 1.0보다 약 4배 이상의 질의응답 쌍을 포함한 데이터셋 추가
• 공개한 코드로는 추가한 대용량 데이터를 불러오는 데에 Out-Of-
Memory 문제가 발생  모델 학습 도중에 동적으로 데이터를 로딩
하는 방식으로 처리 코드 수정
AI NLP
Challenge
AI NLP
Challenge
Solution
Adversarial Training
11
Fast gradient sign method(FGSM) Random Gaussian Noise
• Explaining and Harnessing Adversarial Examples [ICLR 2015] 참고
• image classification에서 adversarial example을 생성
• Image input에 값을 더하여 생성
 NLP task에 적용
• Input의 embedding에 에타(η)를 더하여 adversarial example
로 만든 값을 BERT의 input으로 전달
논문 참조 이미지 – 원래 이미지 (왼쪽) 에 에타(η)를 더하여 만든 Adversarial example(오
른쪽). 육안으로는 두 이미지 모두 판다로 보이지만, 분류 모델은 오른쪽을 “긴팔원숭이
(gibbon)”로 잘못 예측
• Adversarial Examples Are a Natural Consequence of Test Error in
Noise [ICML 2019] 참고
• Gaussian distribution에서 랜덤 값을 추출
 NLP task에 적용
• Input의 embedding에 추출한 랜덤 값을 더하여 adversarial
example로 만든 값을 BERT의 input으로 전달
Problem 같은 의미를 갖는 다른 표현의 질문들에 대한 상이한 답변 추론
Our solution Adversarial example을 활용하여 Adversarial training 진행
Expected result 다양한 질문 상황에 대한 모델의 Robust한 답변 가능
논문 참조 이미지 – 원래 이미지 (왼쪽) 에 random gaussian value를 더하여 만든
Adversarial example(오른쪽). 육안으로 두 이미지 모두 우주선으로 보이지만, 분류 모
델은 오른쪽을 잠수함으로 잘못 예측
AI NLP
Challenge
AI NLP
Challenge
Solution
Ensemble Model
12
Gaussian noise model
Data augmentation
model
Gaussian noise model
Data augmentation
model
FGSM model
Gaussian noise model
FGSM model
1) Ensemble Adversarial Trainings 2) Ensemble Adversarial Training and
Data augmentation
3) Ensemble all
Problem Single model의 성능보다 Ensemble model의 성능이 더 우수 (SQuAD task 기준)
Our solution 1, 2의 solution에 대한 실험에서 최고 성능을 낸 각각의 경우에 대한 모델을 바탕으로 Ensemble 수행
Expected result 좋은 성능을 보인 모델들의 Ensemble로 인해 성능 향상
AI NLP
Challenge
Step
1
Problem
pretrained BERT의 한계
step
2
step
3
Solution
성능 향상을 위한 해결책
Result
모델의 성능향상 결과
AI NLP
Challenge
13
AI NLP
Challenge
Result
14
Data Augmentation
Pretrained-BERT에 대하여, newsQA dataset의 비율을 다르게 하여 학습을 진행한 후,
KorQuAD 전체 dataset으로 추가 학습 진행
 Dataset의 비율을 증가시킬수록 학습 성능 향상
1
1
newsQA KorQuAD
1/2 1
newsQA KorQuAD
1/4
1
newsQA KorQuAD
"EM": 80.08, "f1": 89.63 "EM": 79.18, "f1": 88.77 "EM": 78.71, "f1": 88.47
1) Total newsQA train data 2) 1/2 newsQA train data 3) 1/4 newsQA train data
AI NLP
Challenge
Result
15
Adversarial Training
KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 1)
newsQA 전체 train data로 Pretrained-BERT에 대하여, 실험 1 추가로 진행(실험 2)
 newsQA로 학습한 BERT로 FSGM을 적용한 모델의 성능 향상이 제일 큼(실험 2)
1) KorQuAD + FSGM 2) Pretraining with newsQA
 { KorQuAD + FSGM }
= 0.007 = 0.01 = 0.05 = 0.05
"EM": 78.65
"f1": 88.50
"EM": 79.08
"f1": 88.79
"EM": 79.68
"f1": 88.78
Hyperparamter: (epsilon)
“EM": 81.33
"f1": 90.37
AI NLP
Challenge
Result
16
Adversarial Training
KorQuAD 전체 dataset + Gaussian Noise 기법을 활용하여 학습 진행(실험 1)
newsQA 전체 train data로 Pretrained-BERT에 대하여, 실험 1 추가로 진행(실험 2)
 newsQA로 학습한 BERT로 Gaussian Noise를 적용한 모델의 성능 향상이 제일 큼(실험 2)
1) KorQuAD + Gaussain Noise 2) Pretraining with newsQA 
{ KorQuAD + Gaussain Noise }
"EM": 79.58, "f1": 89.33 "EM": 80.14, "f1": 89.58
AI NLP
Challenge
Result
17
Adversarial Training
newsQA 전체 train data로 Pretrained-BERT에 대하여,
KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 1)
KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 2)
 동일한 조건에서, FSGM 기법이 Gaussian Noise 기법보다 좀 더 높은 성능 향상을 보임(실험 1)
2) Pretraining with newsQA 
{ KorQuAD + Gaussain Noise }
"EM": 80.14, "f1": 89.58
1) Pretraining with newsQA
 { KorQuAD + FSGM }
= 0.05
“EM": 81.33, "f1": 90.37
AI NLP
Challenge
Result
18
Ensemble Model
Gaussian noise model
Data augmentation
model
Data augmentation
model
FGSM model
Gaussian noise model
FGSM model
1) 2) 3)
Gaussian noise model
"EM": 81.24 , "f1": 90.07 "EM": 81.42 , "f1": 90.48 "EM": 81.78 , "f1": 90.50
= 0.05
= 0.05
앞서 수행한 각각의 실험에 대해 가장 높은 성능을 보인 모델들을 Ensemble 수행 (뒤 슬라이드까지 포함)
AI NLP
Challenge
Result
19
Ensemble Model
4)
"EM": 81.99 , "f1": 90.76
앞서 수행한 각각의 실험에 대해 가장 높은 성능을 보인 모델들을 Ensemble 수행
 실험 4의 성능이 최종적으로 가장 높은 향상을 보임
Gaussian noise model
FGSM model ***
= 0.05
Data augmentation
model
FGSM model ***
= 0.01
Gaussian noise model***
*** 모덷명이 Italic인 부분은 newsQA로 pretrained한
모델을 활용하여 실험을 진행한 경우임
AI NLP
Challenge
EM 81.97 70.0 85.0 77.27 65.0 78.63
F1 91.01 75.58 88.65 81.96 72.57 88.39
EM 81.97 80.0(+10.00) 90.0(+5.0) 81.81(+4.54) 75.0(+1.00) 81.99 (+3.36)
F1 89.97 87.95(+17.95) 91.43(+2.78) 84.48(+2.52) 83.12(+10.55) 90.76 (+2.37)
Result (Addition)
20
AI 모델이 KorQuAD의 총 6가지의 질문 유형들에 대하여 질의응답 성능 분석을 수행
• 평가 데이터: KorQuAD Developmentn dataset에 대하여, 각 질문 유형 tagging 작업 수행
• BASELINE 모델(KorQuad v1.0으로 Fine Tuning)과 최고 성능을 보인 모델 비교
 최고 성능을 보인 모델이 각각의 질문유형에 대한 성능도 상당히 향상되었음을 확인
구문변형
(61개)
어휘변형(유의어)
(20개)
어휘변형(일반상
식)
(20개)
여러 문장 근거
(22개)
논리적 추론
(20개)
BASELINE
BEST
전체 dev 데이터셋
평가 결과
21
Thank you

More Related Content

What's hot

"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper ReviewLEE HOSEONG
 
Improving Language Understanding by Generative Pre-Training
Improving Language Understanding by Generative Pre-TrainingImproving Language Understanding by Generative Pre-Training
Improving Language Understanding by Generative Pre-Trainingpko89403
 
Create a solution including deep learning models
Create a solution including deep learning modelsCreate a solution including deep learning models
Create a solution including deep learning modelsTae Young Lee
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesSunghoon Joo
 
Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usageTae Young Lee
 
Infra as a model service
Infra as a model serviceInfra as a model service
Infra as a model serviceTae Young Lee
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsseungwoo kim
 
Machine Learning Foundations (a case study approach) 강의 정리
Machine Learning Foundations (a case study approach) 강의 정리Machine Learning Foundations (a case study approach) 강의 정리
Machine Learning Foundations (a case study approach) 강의 정리SANG WON PARK
 
"simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r..."simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r...LEE HOSEONG
 
"Google Vizier: A Service for Black-Box Optimization" Paper Review
"Google Vizier: A Service for Black-Box Optimization" Paper Review"Google Vizier: A Service for Black-Box Optimization" Paper Review
"Google Vizier: A Service for Black-Box Optimization" Paper ReviewLEE HOSEONG
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learningTae Young Lee
 
boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)SANG WON PARK
 
Siamese neural networks for one shot image recognition paper explained
Siamese neural networks for one shot image recognition paper explainedSiamese neural networks for one shot image recognition paper explained
Siamese neural networks for one shot image recognition paper explainedtaeseon ryu
 
Face recognition
Face recognitionFace recognition
Face recognitionsoul8085
 
Intriguing properties of contrastive losses
Intriguing properties of contrastive lossesIntriguing properties of contrastive losses
Intriguing properties of contrastive lossestaeseon ryu
 
MRC recent trend_ppt
MRC recent trend_pptMRC recent trend_ppt
MRC recent trend_pptseungwoo kim
 
악플분류 모델링 프로젝트
악플분류 모델링 프로젝트악플분류 모델링 프로젝트
악플분류 모델링 프로젝트DataScienceLab
 
"From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ..."From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ...LEE HOSEONG
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningSunghoon Joo
 
통신사 고객 이탈분석
통신사 고객 이탈분석통신사 고객 이탈분석
통신사 고객 이탈분석DataScienceLab
 

What's hot (20)

"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
"Learning From Noisy Large-Scale Datasets With Minimal Supervision" Paper Review
 
Improving Language Understanding by Generative Pre-Training
Improving Language Understanding by Generative Pre-TrainingImproving Language Understanding by Generative Pre-Training
Improving Language Understanding by Generative Pre-Training
 
Create a solution including deep learning models
Create a solution including deep learning modelsCreate a solution including deep learning models
Create a solution including deep learning models
 
PR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of SamplesPR-203: Class-Balanced Loss Based on Effective Number of Samples
PR-203: Class-Balanced Loss Based on Effective Number of Samples
 
Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usage
 
Infra as a model service
Infra as a model serviceInfra as a model service
Infra as a model service
 
Deep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendationsDeep neural networks for You-Tube recommendations
Deep neural networks for You-Tube recommendations
 
Machine Learning Foundations (a case study approach) 강의 정리
Machine Learning Foundations (a case study approach) 강의 정리Machine Learning Foundations (a case study approach) 강의 정리
Machine Learning Foundations (a case study approach) 강의 정리
 
"simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r..."simple does it weakly supervised instance and semantic segmentation" Paper r...
"simple does it weakly supervised instance and semantic segmentation" Paper r...
 
"Google Vizier: A Service for Black-Box Optimization" Paper Review
"Google Vizier: A Service for Black-Box Optimization" Paper Review"Google Vizier: A Service for Black-Box Optimization" Paper Review
"Google Vizier: A Service for Black-Box Optimization" Paper Review
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)boosting 기법 이해 (bagging vs boosting)
boosting 기법 이해 (bagging vs boosting)
 
Siamese neural networks for one shot image recognition paper explained
Siamese neural networks for one shot image recognition paper explainedSiamese neural networks for one shot image recognition paper explained
Siamese neural networks for one shot image recognition paper explained
 
Face recognition
Face recognitionFace recognition
Face recognition
 
Intriguing properties of contrastive losses
Intriguing properties of contrastive lossesIntriguing properties of contrastive losses
Intriguing properties of contrastive losses
 
MRC recent trend_ppt
MRC recent trend_pptMRC recent trend_ppt
MRC recent trend_ppt
 
악플분류 모델링 프로젝트
악플분류 모델링 프로젝트악플분류 모델링 프로젝트
악플분류 모델링 프로젝트
 
"From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ..."From image level to pixel-level labeling with convolutional networks" Paper ...
"From image level to pixel-level labeling with convolutional networks" Paper ...
 
PR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learningPR-339: Maintaining discrimination and fairness in class incremental learning
PR-339: Maintaining discrimination and fairness in class incremental learning
 
통신사 고객 이탈분석
통신사 고객 이탈분석통신사 고객 이탈분석
통신사 고객 이탈분석
 

Similar to Ai nlp challenge

Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터JEEHYUN PAIK
 
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...Susang Kim
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...gohyunwoong
 
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018Kenneth Ceyer
 
파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)SK(주) C&C - 강병호
 
Chapter 11 Practical Methodology
Chapter 11 Practical MethodologyChapter 11 Practical Methodology
Chapter 11 Practical MethodologyKyeongUkJang
 
Chapter 7 Regularization for deep learning - 2
Chapter 7 Regularization for deep learning - 2Chapter 7 Regularization for deep learning - 2
Chapter 7 Regularization for deep learning - 2KyeongUkJang
 
테스트 자동화와 TDD(테스트 주도 개발방법론)
테스트 자동화와 TDD(테스트 주도 개발방법론)테스트 자동화와 TDD(테스트 주도 개발방법론)
테스트 자동화와 TDD(테스트 주도 개발방법론)KH Park (박경훈)
 
연구실 세미나 Show and tell google image captioning
연구실 세미나 Show and tell google image captioning연구실 세미나 Show and tell google image captioning
연구실 세미나 Show and tell google image captioninghkh
 
[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템NAVER D2
 
Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Jaehoon Oh
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1Haesun Park
 
인공신경망
인공신경망인공신경망
인공신경망종열 현
 
Image data augmentatiion
Image data augmentatiionImage data augmentatiion
Image data augmentatiionSubin An
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsKyeongUkJang
 
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best PracticesPAP (Product Analytics Playground)
 
[PAP] 실무자를 위한 인과추론 활용 : Best Practices
[PAP] 실무자를 위한 인과추론 활용 : Best Practices[PAP] 실무자를 위한 인과추론 활용 : Best Practices
[PAP] 실무자를 위한 인과추론 활용 : Best PracticesBokyung Choi
 
Language gans falling short
Language gans falling shortLanguage gans falling short
Language gans falling shortKyuYeolJung
 

Similar to Ai nlp challenge (20)

Ml for 정형데이터
Ml for 정형데이터Ml for 정형데이터
Ml for 정형데이터
 
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...[Paper] EDA : easy data augmentation techniques for boosting performance on t...
[Paper] EDA : easy data augmentation techniques for boosting performance on t...
 
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...Bag of Tricks for Image Classification  with Convolutional Neural Networks (C...
Bag of Tricks for Image Classification with Convolutional Neural Networks (C...
 
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
우아하게 준비하는 테스트와 리팩토링 - PyCon Korea 2018
 
PaLM Paper Review
PaLM Paper ReviewPaLM Paper Review
PaLM Paper Review
 
파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)파이썬으로 익히는 딥러닝 기본 (18년)
파이썬으로 익히는 딥러닝 기본 (18년)
 
Chapter 11 Practical Methodology
Chapter 11 Practical MethodologyChapter 11 Practical Methodology
Chapter 11 Practical Methodology
 
Chapter 7 Regularization for deep learning - 2
Chapter 7 Regularization for deep learning - 2Chapter 7 Regularization for deep learning - 2
Chapter 7 Regularization for deep learning - 2
 
테스트 자동화와 TDD(테스트 주도 개발방법론)
테스트 자동화와 TDD(테스트 주도 개발방법론)테스트 자동화와 TDD(테스트 주도 개발방법론)
테스트 자동화와 TDD(테스트 주도 개발방법론)
 
연구실 세미나 Show and tell google image captioning
연구실 세미나 Show and tell google image captioning연구실 세미나 Show and tell google image captioning
연구실 세미나 Show and tell google image captioning
 
[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템[224] 번역 모델 기반_질의_교정_시스템
[224] 번역 모델 기반_질의_교정_시스템
 
Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화Robot framework 을 이용한 기능 테스트 자동화
Robot framework 을 이용한 기능 테스트 자동화
 
2.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-12.supervised learning(epoch#2)-1
2.supervised learning(epoch#2)-1
 
인공신경망
인공신경망인공신경망
인공신경망
 
The Introduction to Refactoring
The Introduction to Refactoring The Introduction to Refactoring
The Introduction to Refactoring
 
Image data augmentatiion
Image data augmentatiionImage data augmentatiion
Image data augmentatiion
 
Chapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep modelsChapter 8 - optimization for training deep models
Chapter 8 - optimization for training deep models
 
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices
[팝콘 시즌1] 최보경 : 실무자를 위한 인과추론 활용 - Best Practices
 
[PAP] 실무자를 위한 인과추론 활용 : Best Practices
[PAP] 실무자를 위한 인과추론 활용 : Best Practices[PAP] 실무자를 위한 인과추론 활용 : Best Practices
[PAP] 실무자를 위한 인과추론 활용 : Best Practices
 
Language gans falling short
Language gans falling shortLanguage gans falling short
Language gans falling short
 

Ai nlp challenge

  • 1. AI NLP Challenge BERT fine-tuing & Performance Improvement 조민석, 장영록, 박지영
  • 2. AI NLP Challenge Content Step 1 Problem pretrained BERT의 한계 step 2 step 3 Solution 성능 향상을 위한 해결책 Result 모델의 성능향상 결과 2
  • 3. AI NLP Challenge Step 1 Problem pretrained BERT의 한계 step 2 step 3 Solution 성능 향상을 위한 해결책 Result 모델의 성능향상 결과 AI NLP Challenge 3
  • 4. AI NLP Challenge Problem AI NLP Challenge Extreme imbalance of Question-Type Same Questions Different Answers Low performance of Single Model 다채로운 표현이 가능한 한국어의 특성에 기반한, "같은 의미를 가진" 다양한 질의에 대하여 상이한 답변 추론 KorQuAD 1.0의 질문유형의 불균형으로 인한 다양한 질문 유형 대응 한계 SQuAD leaderboad에서, Ensemble model의 성능이 Single model보다 높음 4
  • 5. AI NLP Challenge Problem Extreme imbalance of Question-Type AI NLP Challenge 5 구문 변형, 56.4% 여러 문장의 근거 활용, 19.6% 어휘 변형(유의어), 13.6% 어휘 변형(일반상식), 3.9% 논리적 추론, 3.6% 출제 오류, 2.9% https://www.slideshare.net/SeungyoungLim/korquad-introduction KorQuAD 1.0 Slideshare 참조 KorQuAD 1.0 질문 유형 Extreme imbalance of Question-Type : KorQuAD 1.0의 질문들의 유형 중에서 단순히 평서 문을 의문문으로 바꿔서 질문한 “구문 변형”의 질문 유 형이 반 이상을 차지하고, 나머지 유형들은 그에 비해 지나치게 작은 비율을 차지하고 있음  구문 변형을 제외한 나머지 유형의 질문들에 학습 량이 상대적으로 부족  모델의 오답률 증가 요인 (왼쪽 그림은 Random으로 KorQuAD dev 데이터셋에 서 데이터를 추출하여 얻은 결과입니다.)
  • 6. AI NLP Challenge Problem Same Questions Different Answers AI NLP Challenge 6 Adversarial example in MRC task : 서로 같은 의미 정보를 갖는 다른 표현의 질문들을 AI 모델이 다르게 이해하여, 다르거나 틀린 답변을 내보내는 경우 예시) 동일한 의미를 같지만 다르게 표현된 질문들 - 질문1: 클린봇의 탐지 능력은 몇 배 향상 됐어? - 답변1: 기존보다 5배 - 질문2: 클린봇 탐지 성능은 얼마나 업그레이드 됐 어? - 답변2: 문장의 맥락 네이버가 악성 댓글(악플)에 욕설이 없어도 뉘앙스까지 잡아내 차단하는 기술을 도입했다. 업 그레이드된 ‘클린봇’은 모욕적인 표현, 무례한 뉘앙스까지 탐지해낸다. 네이버는 ‘클린봇’ 2.0 엔진을 포털 뉴스 서비스에 적용했다고 18일 밝혔다. 네이버에 따르면 악플을 차단해주는 인 공지능(AI) 기반 ‘클린봇’의 탐지 능력은 기존보다 5배 향상됐다. 네이버는 댓글 서비스 개편 이후 악플이 줄어들자 댓글 공간이 갖는 소통의 순기능을 회복시키기 위해 차단 기술을 끌어 올렸다. 클린봇은 네이버 스포츠·쥬니버·연예·뉴스 서비스 등에 설치돼 욕설과 비속어가 들어 간 댓글을 탐지하면 자동으로 블라인드 처리해주는 시스템이다. 기존에는 단어 중심으로 찾아 냈다면 업그레이드 이후 문장의 맥락까지 탐지할 수 있게 됐다. 뉴스 기사 기존보다 5배 문장의 맥락 클린봇 탐지 성능은 얼마나 업그레이드 됐 어? 클린봇의 탐지 능력은 몇 배 향상 됐 어? Adversarial example 예시
  • 7. AI NLP Challenge Problem Low performance of Single Model AI NLP Challenge 7 SQuAD 2.0 Leaderboard Performance Gap between Single and Ensemble : SQuAD 2.0 Leaderboard 상에서 상위권은 모두 Ensemble 기법을 활용한 모델이 차지하고 있으며, Single 모델의 최고 순위는 9위에 그침.
  • 8. AI NLP Challenge Step 1 Problem pretrained BERT의 한계 step 2 step 3 Solution 성능 향상을 위한 해결책 Result 모델의 성능향상 결과 AI NLP Challenge 8
  • 9. AI NLP Challenge AI NLP Challenge Solution Data Augmentation Adversarial Training Ensemble Model AI 모델의 질문 이해도를 강화시키기 위해 Adversarial example을 학습과 정에 활용 구문이해 및 질의응답 과제에 활용될 수 있는 다른 Dataset 추가(AI Hub의 newsQA) 채워넣어야함 9
  • 10. AI NLP Challenge AI NLP Challenge Solution Data Augmentation 10 Problem KorQuAD 1.0의 질문 유형 별 구성 비율의 불균형이 심함 Our solution Data augmentation을 통해 각 유형의 데이터 수를 늘려 많은 학습량 확보 Expected result 각 유형에 대한 정답률을 높임으로써 전체 성능 향상 KorQuAD 1.0 : 총 66,181 개 질의응답 쌍 newsQA : 총 252,604 개 질의응답 쌍 AI Hub의 newsQA 데이터 추가 • KorQuAD 1.0보다 약 4배 이상의 질의응답 쌍을 포함한 데이터셋 추가 • 공개한 코드로는 추가한 대용량 데이터를 불러오는 데에 Out-Of- Memory 문제가 발생  모델 학습 도중에 동적으로 데이터를 로딩 하는 방식으로 처리 코드 수정
  • 11. AI NLP Challenge AI NLP Challenge Solution Adversarial Training 11 Fast gradient sign method(FGSM) Random Gaussian Noise • Explaining and Harnessing Adversarial Examples [ICLR 2015] 참고 • image classification에서 adversarial example을 생성 • Image input에 값을 더하여 생성  NLP task에 적용 • Input의 embedding에 에타(η)를 더하여 adversarial example 로 만든 값을 BERT의 input으로 전달 논문 참조 이미지 – 원래 이미지 (왼쪽) 에 에타(η)를 더하여 만든 Adversarial example(오 른쪽). 육안으로는 두 이미지 모두 판다로 보이지만, 분류 모델은 오른쪽을 “긴팔원숭이 (gibbon)”로 잘못 예측 • Adversarial Examples Are a Natural Consequence of Test Error in Noise [ICML 2019] 참고 • Gaussian distribution에서 랜덤 값을 추출  NLP task에 적용 • Input의 embedding에 추출한 랜덤 값을 더하여 adversarial example로 만든 값을 BERT의 input으로 전달 Problem 같은 의미를 갖는 다른 표현의 질문들에 대한 상이한 답변 추론 Our solution Adversarial example을 활용하여 Adversarial training 진행 Expected result 다양한 질문 상황에 대한 모델의 Robust한 답변 가능 논문 참조 이미지 – 원래 이미지 (왼쪽) 에 random gaussian value를 더하여 만든 Adversarial example(오른쪽). 육안으로 두 이미지 모두 우주선으로 보이지만, 분류 모 델은 오른쪽을 잠수함으로 잘못 예측
  • 12. AI NLP Challenge AI NLP Challenge Solution Ensemble Model 12 Gaussian noise model Data augmentation model Gaussian noise model Data augmentation model FGSM model Gaussian noise model FGSM model 1) Ensemble Adversarial Trainings 2) Ensemble Adversarial Training and Data augmentation 3) Ensemble all Problem Single model의 성능보다 Ensemble model의 성능이 더 우수 (SQuAD task 기준) Our solution 1, 2의 solution에 대한 실험에서 최고 성능을 낸 각각의 경우에 대한 모델을 바탕으로 Ensemble 수행 Expected result 좋은 성능을 보인 모델들의 Ensemble로 인해 성능 향상
  • 13. AI NLP Challenge Step 1 Problem pretrained BERT의 한계 step 2 step 3 Solution 성능 향상을 위한 해결책 Result 모델의 성능향상 결과 AI NLP Challenge 13
  • 14. AI NLP Challenge Result 14 Data Augmentation Pretrained-BERT에 대하여, newsQA dataset의 비율을 다르게 하여 학습을 진행한 후, KorQuAD 전체 dataset으로 추가 학습 진행  Dataset의 비율을 증가시킬수록 학습 성능 향상 1 1 newsQA KorQuAD 1/2 1 newsQA KorQuAD 1/4 1 newsQA KorQuAD "EM": 80.08, "f1": 89.63 "EM": 79.18, "f1": 88.77 "EM": 78.71, "f1": 88.47 1) Total newsQA train data 2) 1/2 newsQA train data 3) 1/4 newsQA train data
  • 15. AI NLP Challenge Result 15 Adversarial Training KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 1) newsQA 전체 train data로 Pretrained-BERT에 대하여, 실험 1 추가로 진행(실험 2)  newsQA로 학습한 BERT로 FSGM을 적용한 모델의 성능 향상이 제일 큼(실험 2) 1) KorQuAD + FSGM 2) Pretraining with newsQA  { KorQuAD + FSGM } = 0.007 = 0.01 = 0.05 = 0.05 "EM": 78.65 "f1": 88.50 "EM": 79.08 "f1": 88.79 "EM": 79.68 "f1": 88.78 Hyperparamter: (epsilon) “EM": 81.33 "f1": 90.37
  • 16. AI NLP Challenge Result 16 Adversarial Training KorQuAD 전체 dataset + Gaussian Noise 기법을 활용하여 학습 진행(실험 1) newsQA 전체 train data로 Pretrained-BERT에 대하여, 실험 1 추가로 진행(실험 2)  newsQA로 학습한 BERT로 Gaussian Noise를 적용한 모델의 성능 향상이 제일 큼(실험 2) 1) KorQuAD + Gaussain Noise 2) Pretraining with newsQA  { KorQuAD + Gaussain Noise } "EM": 79.58, "f1": 89.33 "EM": 80.14, "f1": 89.58
  • 17. AI NLP Challenge Result 17 Adversarial Training newsQA 전체 train data로 Pretrained-BERT에 대하여, KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 1) KorQuAD 전체 dataset + FSGM 기법을 활용하여 학습 진행(실험 2)  동일한 조건에서, FSGM 기법이 Gaussian Noise 기법보다 좀 더 높은 성능 향상을 보임(실험 1) 2) Pretraining with newsQA  { KorQuAD + Gaussain Noise } "EM": 80.14, "f1": 89.58 1) Pretraining with newsQA  { KorQuAD + FSGM } = 0.05 “EM": 81.33, "f1": 90.37
  • 18. AI NLP Challenge Result 18 Ensemble Model Gaussian noise model Data augmentation model Data augmentation model FGSM model Gaussian noise model FGSM model 1) 2) 3) Gaussian noise model "EM": 81.24 , "f1": 90.07 "EM": 81.42 , "f1": 90.48 "EM": 81.78 , "f1": 90.50 = 0.05 = 0.05 앞서 수행한 각각의 실험에 대해 가장 높은 성능을 보인 모델들을 Ensemble 수행 (뒤 슬라이드까지 포함)
  • 19. AI NLP Challenge Result 19 Ensemble Model 4) "EM": 81.99 , "f1": 90.76 앞서 수행한 각각의 실험에 대해 가장 높은 성능을 보인 모델들을 Ensemble 수행  실험 4의 성능이 최종적으로 가장 높은 향상을 보임 Gaussian noise model FGSM model *** = 0.05 Data augmentation model FGSM model *** = 0.01 Gaussian noise model*** *** 모덷명이 Italic인 부분은 newsQA로 pretrained한 모델을 활용하여 실험을 진행한 경우임
  • 20. AI NLP Challenge EM 81.97 70.0 85.0 77.27 65.0 78.63 F1 91.01 75.58 88.65 81.96 72.57 88.39 EM 81.97 80.0(+10.00) 90.0(+5.0) 81.81(+4.54) 75.0(+1.00) 81.99 (+3.36) F1 89.97 87.95(+17.95) 91.43(+2.78) 84.48(+2.52) 83.12(+10.55) 90.76 (+2.37) Result (Addition) 20 AI 모델이 KorQuAD의 총 6가지의 질문 유형들에 대하여 질의응답 성능 분석을 수행 • 평가 데이터: KorQuAD Developmentn dataset에 대하여, 각 질문 유형 tagging 작업 수행 • BASELINE 모델(KorQuad v1.0으로 Fine Tuning)과 최고 성능을 보인 모델 비교  최고 성능을 보인 모델이 각각의 질문유형에 대한 성능도 상당히 향상되었음을 확인 구문변형 (61개) 어휘변형(유의어) (20개) 어휘변형(일반상 식) (20개) 여러 문장 근거 (22개) 논리적 추론 (20개) BASELINE BEST 전체 dev 데이터셋 평가 결과