SlideShare a Scribd company logo
1 of 50
wicho@hi.snu.ac.kr
Wonik Cho (warnikchow)
SLU? BERT? Distillation?
그게 뭔데… 어떻게 하는
건데… (feat. PyTorch)
• Introduction
• Spoken language understanding
• Pretrained language models
• Knowledge distillation
• Takeaways – Thank you PyTorch!
Contents
Introduction
조원익
B.S. in EE/Mathematics (SNU, ’10~’14)
Ph.D. student (SNU ECE, ’14 Autumn~)
Academic background
EE folk interested in mathematics
Speech processing lab
Currently studying on
Computational linguistics / Spoken language processing
연사 소개
Introduction
Computational linguistics
주로 하는 연구
Introduction
Computational linguistics
주로 하는 연구
Introduction
Computational linguistics
주로 하는 연구
Introduction
Computational linguistics
주로 하는 연구
Spoken language understanding
음성과 텍스트 – 정보 전달의 주요한 두 가지 매체
Speech and spoken language
Spoken language understanding
1. 화자의 발화 (utterance)
2. 발화의 전사 (transcription)
3. 전사된 텍스트의 이해 (natural language understanding)
전통적인 ‘음성언어이해’
장점?
텍스트 기반의 정확한 추론!
Spoken language understanding
1. 화자의 발화 (utterance)
2. 발화의 전사 (transcription)
3. 전사된 텍스트의 이해 (natural language understanding)
전통적인 ‘음성언어이해’
장점?
텍스트 기반의 정확한 추론!
단점?
전사 과정의 오류 전파!
Spoken language understanding
정보, 감정, 의도, 명령, …
‘이해’란 어떤 것인가?
음…그렇군
Spoken language understanding
정보, 감정, 의도, 명령, …
‘이해’란 어떤 것인가?
음…이런
기분이군
음…이런
목적이군
Spoken language understanding
정보, 감정, 의도, 명령, …
‘이해’란 어떤 것인가?
아 네
알겠습니다!
(분주)
Spoken language understanding
기존의 SLU dataset들이 널리 활용되지 못했던 점을 보완
Ex 1) ATIS (비행 예약 데이터셋; 유료)
Ex 2) Google Speech Command (적은 데이터 양)
Fluent Speech Commands
Spoken language understanding
모든 baseline code가 PyTorch로!
https://github.com/lorenlugosch/end-to-end-SLU
예시)
Fluent Speech Commands
Spoken language understanding
전통적인 SLU, 그리고 end-to-end
? Turn the chicken right now
Spoken language understanding
전통적인 SLU에서는 text output에 대해 자유롭게 text 기반으로 훈련된 성능 좋은
모델들을 활용할 수 있었다…
Spoken language understanding
전통적인 SLU에서는 text output에 대해 자유롭게 text 기반으로 훈련된 성능 좋은
모델들을 활용할 수 있었다…
Pretrained language models
Pretrained language model
BERT를 위시한 Sesame street 패거리, 그들은 누구인가?
언어 모델이란?
- Modeling structure itself
- Assigning probability to
word sequence
- Prediction
ex1) "지금 내 눈 앞에서 당장 !! "
ex2) "나 지금 너무 추워 "
>> " "
Pretrained language models
Pretrained language model
BERT를 위시한 Sesame street 패거리, 그들은 누구인가?
어떤 task를 하고 싶은데 이러한 ‘경향성’을 해당 dataset
안에서만 파악하는 것은 쉽지 않다…
어…
‘사랑해’?"지금 내 눈 앞에서 당장 !! "
Pretrained language models
Pretrained language model
BERT를 위시한 Sesame street 패거리, 그들은 누구인가?
어떤 언어 모델을 ‘미리 학습시켜’ 두는것!
- How?
답은
‘사라져’!"지금 내 눈 앞에서 당장 !! "
Pretrained language models
Pretrained language model
사실 word2vec, GloVe, fastText … 모두 다 Pretrained LM 이었다
어떤 언어 모델을 ‘미리 학습시켜’ 두는것!
예컨대, word2vec 에서는 …
“You shall know a word by the company it keeps”
(J. R. Firth 1957:11)
Pretrained language models
Pretrained language model
사실 word2vec, GloVe, fastText … 모두 다 Pretrained LM 이었다
이 때의 문제점: ‘Context’ 안에서 달라지는 단어들의
의미를 반영하기 어렵다!
지금 내 눈앞에서 당장 사라져 !!
vs.
눈은 살아 있다. 떨어진 눈은 살아 있다. 마당 위에 떨어진 눈은 살아 있다.
Pretrained language models
Pretrained language model
비슷한 structure의 LM 학습이지만, 이러한 문제를 해결하고자 나온
Deep contextualized
word representation
지금 내 눈앞에서 당장 사라져 !!
vs.
눈은 살아 있다. 떨어진 눈은 살아 있다. 마당 위에 떨어진 눈은 살아 있다.
Pretrained language models
Pretrained language model
이후 무수한 contextual word embedding 모델들의 등장이 …
Bidirectional encoder representations from Transformers (BERT)
Pretrained language models
Bidirectional encoder representations from Transformers
Objective 1: 빈칸채우기
Objective 2: 관련있는
문장인지 맞추기
Pretrained language models
Bidirectional encoder representations from Transformers
최종 output 𝑇1 ~ 𝑇 𝑁:
각 𝑇는 임베딩 𝐸에 해당하면서도
contextual한 정보를 포함하는 어떤
vector로 표현된다!
>> 어떤 입력 문장에 대한 ‘유용한’
문장 단위 사전학습 결과를 얻을 수
있음
>> Transformer, 그리고 deep한 구조의
특성 상 엄청난 computation과
데이터를 필요로 함
그래서 다 이런 것을 학습해서
공개해 주셨다… (but for PyTorch?)
Pretrained language models
Bidirectional encoder representations from Transformers
For PyTorch? Well-known Hugging Face ‘Transformers’ wrapper!
- TF로 제공되던 모델들을 PyTorch에서 쓸 수 있게 함
- 손쉬운 로딩 및 Fine-tuning
- 다양한 모델들을 비슷한 방식으로 테스트 가능
Pretrained language models
Bidirectional encoder representations from Transformers
Fine-tuning with FSC ground truth scripts!
Pretrained language models
Bidirectional encoder representations from Transformers
Fine-tuning with FSC ground truth scripts!
Pretrained language models
Bidirectional encoder representations from Transformers
Fine-tuning with FSC ground truth scripts!
Pretrained language models
방법 1. ASR output을 활용
ASR output이 항상 옳을 것이라 기대하기 어렵다!
그래서 텍스트로 훈련해서 좋은 성능을 얻었는데, 이걸 어떻게 써먹을 것인가…?
해당 데이터셋을 활용, phoneme
posterior-based pretrained LM을
구현한 Wang et al. (2020)의 실험 결과
– FSC는 ASR 측면에서는 쉽지 않은
task일 수 있다
Pretrained language models
그래서 텍스트로 훈련해서 좋은 성능을 얻었는데, 이걸 어떻게 써먹을 것인가…?
방법 1. ASR output을 활용
ASR output이 항상 옳을 것이라 기대하기 어렵다!
방법 2. ASR pretrained module의 뒷단에 붙여서 활용?
NN 학습이 윗쪽만 freeze시키는 방식으로 되기 어렵다
초기 구상 아키텍쳐
(weight가 꼬임!)
Knowledge distillation
무언가를 ‘증류’ 하다
위스키…?
Knowledge distillation
무언가를 ‘증류’ 하다
위스키…?
‘지식’을요…?
Knowledge distillation
입력 input
출력 output
모델링: input > output 이 될
수 있게 하는 ‘큰’ weight set
(weight ~ trainable param.)
Neural network 기반 학습의 주요 구성 요소
어떻게?
Weight가 update될 수 있도록
출력 layer ‘뒤’로 어떤 정보를
Back propagate한다.
어떤 정보?
Loss
(Weight 기반의 예측과
어떤 target과의 gap)
Knowledge distillation
Neural network 기반 학습의 주요 구성 요소
어떤 정보?
Loss
(Weight 기반의 예측과
어떤 target과의 gap)
어떤 gap?
Target이 무엇이냐에 따라 (Task마다) 다르다!
- Categorical target ~ Cross-entropy loss (분류)
- Non-categorical ~ Mean square error loss (회귀)
- … (다양한 task에서 다양하게 정의 가능)
Loss = f (answer, inference)
Knowledge distillation
그런데 이 ‘loss’에 다른 것을 사용해볼 수도 있다?
가지고 있는 데이터를 이용해
혼자 익히는 모델 (독학)
>> 배우기에 시간이 걸림
여기에 어떤 다른 모델의 inference를
추가적으로 배워볼 수 있다면?
힘들다…
Loss = f (answer, inference)
Loss1 = f answer, inferences
Loss2 = g inferences , inferencet
Knowledge distillation
Distillation as a teacher-student learning
teacher (t)
Loss1 = f answer, inferences
Loss2 = g inferences , inferencet
student (s)
𝑇𝑜𝑡𝑎𝑙 𝐿𝑜𝑠𝑠 = 𝐿𝑜𝑠𝑠1 + 𝐿𝑜𝑠𝑠2
Distilled knowledge
Cross-entropy
Mean square/average error
답지를 알려주는 것 (Loss1) 과의 차이:
어떤 ‘사고과정’을 전달해 줄 수 있다!
Knowledge distillation
일반적으로는 teacher과 student의 구조/입출력이 같다!
(text / image / speech …)
왜 하나?
- Student가 더 빠르고
효율적으로 배울 수 있게
- Size가 작은 모델도 큰 모델만큼
정확히 동작할 수 있게
(distillation for model compression)
Knowledge distillation
입출력이 다를 수도 있다! 이른바 Cross-modality
Speech와 text는 조금 더 특별하다
서로 다른 modality
- Analog vs. Digital
- Audio vs. Unicode
- Frame vs. Token
Knowledge distillation
입출력이 다를 수도 있다! 이른바 Cross-modality
Speech와 text는 조금 더 특별하다
서로 다른 modality
- Analog vs. Digital
- Audio vs. Unicode
- Frame vs. Token
그렇지만 ‘거의’ 같은 내용을 전달할 수 있다!
몇 개 가져가
Should I take some?
How many should I take?
You can take some?
왜 ‘거의’?
일단 지금 하는 FSC task에서는
이 내용은 생각하지 않기로 하자!
Knowledge distillation
입출력이 다를 수도 있다! 이른바 Cross-modality
Modality가 달라도 같은 내용을 전달할 수 있다면?
+ 목적으로 하는 task도 같다면?
>> 다루는 입력 데이터가 달라도
distillation을 할 수 있지 않을까?
e.g., Speech translation
Knowledge distillation
입출력이 다를 수도 있다! 이른바 Cross-modality
Modality가 달라도 같은 내용을 전달할 수 있다면?
+ 목적으로 하는 task도 같다면?
>> 다루는 입력 데이터가 달라도
distillation을 할 수 있지 않을까?
e.g., Speech translation
Spoken language understanding
Accepted at Interspeech 2020!
Knowledge distillation
Cross-modal knowledge distillation (feat. PyTorch)
Knowledge distillation
Cross-modal knowledge distillation
- Distillation 자체도 성공적; Distillation을 사용하지 않은
기존의 학습에 비해 성능 향상
- 다른 성능 개선 방법인 phoneme posterior
-based BERT model의 성능을 상회
Knowledge distillation
Cross-modal knowledge distillation
- 특히 data가 부족할 수 있는 speech의 경우
해당 방법으로 이득을 볼 수 있을 것!
- KD loss의 weight, 그리고 scheduling 등에
영향을 받을 수 있음 (덜 heuristic하게?)
Takeaways
SLU? Spoken language understanding (음성/인식된 음성의 이해)
BERT? 유용한 ‘문장 표현 도구’ (word2vec의 ‘문장’ 버전)
Distillation? 학습을 보다 쉽게 인도해 주는 것 (T-S의 입력이 달라도 가능)
SLU? BERT? Distillation? 그게 뭔데… 어떻게 하는 건데… (feat. PyTorch)
모두 PyTorch로 쉽게 코딩할 수 있었다!
고마워요 PyTorch! 고마워요 Hugging Face!
Thank you for watching.
Q & A

More Related Content

Similar to 2009 DevC Seongnam - NLP

1910 tfkr3 warnikchow
1910 tfkr3 warnikchow1910 tfkr3 warnikchow
1910 tfkr3 warnikchowWarNik Chow
 
CoreDot TechSeminar 2018 - Session3 Doh Seungheon
CoreDot TechSeminar 2018 - Session3 Doh SeungheonCoreDot TechSeminar 2018 - Session3 Doh Seungheon
CoreDot TechSeminar 2018 - Session3 Doh SeungheonCore.Today
 
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진BeomJinPark1
 
Warnikchow - Babeltop 1901
Warnikchow - Babeltop 1901Warnikchow - Babeltop 1901
Warnikchow - Babeltop 1901WarNik Chow
 
Word 2 Vec Algorithm
Word 2 Vec AlgorithmWord 2 Vec Algorithm
Word 2 Vec AlgorithmHyeongmin Lee
 
Deep Learning for Chatbot (1/4)
Deep Learning for Chatbot (1/4)Deep Learning for Chatbot (1/4)
Deep Learning for Chatbot (1/4)Jaemin Cho
 
외계어 스터디 1/5 - Overview
외계어 스터디 1/5 - Overview외계어 스터디 1/5 - Overview
외계어 스터디 1/5 - Overview민태 김
 
<Little Big Data #1> 한국어 채팅 데이터로 머신러닝 하기
<Little Big Data #1> 한국어 채팅 데이터로  머신러닝 하기<Little Big Data #1> 한국어 채팅 데이터로  머신러닝 하기
<Little Big Data #1> 한국어 채팅 데이터로 머신러닝 하기Han-seok Jo
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicKyeongUkJang
 
Brief hystory of NLP and Word2Vec
Brief hystory of NLP and Word2VecBrief hystory of NLP and Word2Vec
Brief hystory of NLP and Word2VecSilverQ
 
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례NUGU developers
 
시나브로 배우는 자연어처리 바벨피쉬 송치성
시나브로 배우는 자연어처리 바벨피쉬 송치성시나브로 배우는 자연어처리 바벨피쉬 송치성
시나브로 배우는 자연어처리 바벨피쉬 송치성Chisung Song
 
presentation creation "STORY"
presentation creation "STORY"presentation creation "STORY"
presentation creation "STORY"Joo Hyun Kang
 
개발자와 영어 Why and how
개발자와 영어 Why and how개발자와 영어 Why and how
개발자와 영어 Why and howMinwoo Park
 
2차 공개강의 : 프레젠테이션에 대한 새로운 시각
2차 공개강의 : 프레젠테이션에 대한 새로운 시각2차 공개강의 : 프레젠테이션에 대한 새로운 시각
2차 공개강의 : 프레젠테이션에 대한 새로운 시각용석 김
 
발표(자막)
발표(자막)발표(자막)
발표(자막)주영 김
 
훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기Changyol BAEK
 

Similar to 2009 DevC Seongnam - NLP (20)

1910 tfkr3 warnikchow
1910 tfkr3 warnikchow1910 tfkr3 warnikchow
1910 tfkr3 warnikchow
 
CoreDot TechSeminar 2018 - Session3 Doh Seungheon
CoreDot TechSeminar 2018 - Session3 Doh SeungheonCoreDot TechSeminar 2018 - Session3 Doh Seungheon
CoreDot TechSeminar 2018 - Session3 Doh Seungheon
 
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진
2019 데분 세션 발표자료(커리어 변신 데이터 분석가)_박범진
 
Warnikchow - Babeltop 1901
Warnikchow - Babeltop 1901Warnikchow - Babeltop 1901
Warnikchow - Babeltop 1901
 
Word 2 Vec Algorithm
Word 2 Vec AlgorithmWord 2 Vec Algorithm
Word 2 Vec Algorithm
 
Deep Learning for Chatbot (1/4)
Deep Learning for Chatbot (1/4)Deep Learning for Chatbot (1/4)
Deep Learning for Chatbot (1/4)
 
Pycon Korea 2020
Pycon Korea 2020 Pycon Korea 2020
Pycon Korea 2020
 
외계어 스터디 1/5 - Overview
외계어 스터디 1/5 - Overview외계어 스터디 1/5 - Overview
외계어 스터디 1/5 - Overview
 
<Little Big Data #1> 한국어 채팅 데이터로 머신러닝 하기
<Little Big Data #1> 한국어 채팅 데이터로  머신러닝 하기<Little Big Data #1> 한국어 채팅 데이터로  머신러닝 하기
<Little Big Data #1> 한국어 채팅 데이터로 머신러닝 하기
 
Natural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - BasicNatural Language Processing(NLP) - Basic
Natural Language Processing(NLP) - Basic
 
Brief hystory of NLP and Word2Vec
Brief hystory of NLP and Word2VecBrief hystory of NLP and Word2Vec
Brief hystory of NLP and Word2Vec
 
Ipenglish
IpenglishIpenglish
Ipenglish
 
2206 Modupop!
2206 Modupop!2206 Modupop!
2206 Modupop!
 
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
 
시나브로 배우는 자연어처리 바벨피쉬 송치성
시나브로 배우는 자연어처리 바벨피쉬 송치성시나브로 배우는 자연어처리 바벨피쉬 송치성
시나브로 배우는 자연어처리 바벨피쉬 송치성
 
presentation creation "STORY"
presentation creation "STORY"presentation creation "STORY"
presentation creation "STORY"
 
개발자와 영어 Why and how
개발자와 영어 Why and how개발자와 영어 Why and how
개발자와 영어 Why and how
 
2차 공개강의 : 프레젠테이션에 대한 새로운 시각
2차 공개강의 : 프레젠테이션에 대한 새로운 시각2차 공개강의 : 프레젠테이션에 대한 새로운 시각
2차 공개강의 : 프레젠테이션에 대한 새로운 시각
 
발표(자막)
발표(자막)발표(자막)
발표(자막)
 
훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기
 

More from WarNik Chow

2206 FAccT_inperson
2206 FAccT_inperson2206 FAccT_inperson
2206 FAccT_inpersonWarNik Chow
 
2204 Kakao talk on Hate speech dataset
2204 Kakao talk on Hate speech dataset2204 Kakao talk on Hate speech dataset
2204 Kakao talk on Hate speech datasetWarNik Chow
 
2108 [LangCon2021] kosp2e
2108 [LangCon2021] kosp2e2108 [LangCon2021] kosp2e
2108 [LangCon2021] kosp2eWarNik Chow
 
2102 Redone seminar
2102 Redone seminar2102 Redone seminar
2102 Redone seminarWarNik Chow
 
2010 INTERSPEECH
2010 INTERSPEECH 2010 INTERSPEECH
2010 INTERSPEECH WarNik Chow
 
2010 PACLIC - pay attention to categories
2010 PACLIC - pay attention to categories2010 PACLIC - pay attention to categories
2010 PACLIC - pay attention to categoriesWarNik Chow
 
2010 HCLT Hate Speech
2010 HCLT Hate Speech2010 HCLT Hate Speech
2010 HCLT Hate SpeechWarNik Chow
 
2008 [lang con2020] act!
2008 [lang con2020] act!2008 [lang con2020] act!
2008 [lang con2020] act!WarNik Chow
 

More from WarNik Chow (20)

2312 PACLIC
2312 PACLIC2312 PACLIC
2312 PACLIC
 
2311 EAAMO
2311 EAAMO2311 EAAMO
2311 EAAMO
 
2211 HCOMP
2211 HCOMP2211 HCOMP
2211 HCOMP
 
2211 APSIPA
2211 APSIPA2211 APSIPA
2211 APSIPA
 
2211 AACL
2211 AACL2211 AACL
2211 AACL
 
2210 CODI
2210 CODI2210 CODI
2210 CODI
 
2206 FAccT_inperson
2206 FAccT_inperson2206 FAccT_inperson
2206 FAccT_inperson
 
2204 Kakao talk on Hate speech dataset
2204 Kakao talk on Hate speech dataset2204 Kakao talk on Hate speech dataset
2204 Kakao talk on Hate speech dataset
 
2108 [LangCon2021] kosp2e
2108 [LangCon2021] kosp2e2108 [LangCon2021] kosp2e
2108 [LangCon2021] kosp2e
 
2106 PRSLLS
2106 PRSLLS2106 PRSLLS
2106 PRSLLS
 
2106 JWLLP
2106 JWLLP2106 JWLLP
2106 JWLLP
 
2106 ACM DIS
2106 ACM DIS2106 ACM DIS
2106 ACM DIS
 
2104 Talk @SSU
2104 Talk @SSU2104 Talk @SSU
2104 Talk @SSU
 
2103 ACM FAccT
2103 ACM FAccT2103 ACM FAccT
2103 ACM FAccT
 
2102 Redone seminar
2102 Redone seminar2102 Redone seminar
2102 Redone seminar
 
2011 NLP-OSS
2011 NLP-OSS2011 NLP-OSS
2011 NLP-OSS
 
2010 INTERSPEECH
2010 INTERSPEECH 2010 INTERSPEECH
2010 INTERSPEECH
 
2010 PACLIC - pay attention to categories
2010 PACLIC - pay attention to categories2010 PACLIC - pay attention to categories
2010 PACLIC - pay attention to categories
 
2010 HCLT Hate Speech
2010 HCLT Hate Speech2010 HCLT Hate Speech
2010 HCLT Hate Speech
 
2008 [lang con2020] act!
2008 [lang con2020] act!2008 [lang con2020] act!
2008 [lang con2020] act!
 

2009 DevC Seongnam - NLP

  • 1. wicho@hi.snu.ac.kr Wonik Cho (warnikchow) SLU? BERT? Distillation? 그게 뭔데… 어떻게 하는 건데… (feat. PyTorch)
  • 2. • Introduction • Spoken language understanding • Pretrained language models • Knowledge distillation • Takeaways – Thank you PyTorch! Contents
  • 3. Introduction 조원익 B.S. in EE/Mathematics (SNU, ’10~’14) Ph.D. student (SNU ECE, ’14 Autumn~) Academic background EE folk interested in mathematics Speech processing lab Currently studying on Computational linguistics / Spoken language processing 연사 소개
  • 8. Spoken language understanding 음성과 텍스트 – 정보 전달의 주요한 두 가지 매체 Speech and spoken language
  • 9. Spoken language understanding 1. 화자의 발화 (utterance) 2. 발화의 전사 (transcription) 3. 전사된 텍스트의 이해 (natural language understanding) 전통적인 ‘음성언어이해’ 장점? 텍스트 기반의 정확한 추론!
  • 10. Spoken language understanding 1. 화자의 발화 (utterance) 2. 발화의 전사 (transcription) 3. 전사된 텍스트의 이해 (natural language understanding) 전통적인 ‘음성언어이해’ 장점? 텍스트 기반의 정확한 추론! 단점? 전사 과정의 오류 전파!
  • 11. Spoken language understanding 정보, 감정, 의도, 명령, … ‘이해’란 어떤 것인가? 음…그렇군
  • 12. Spoken language understanding 정보, 감정, 의도, 명령, … ‘이해’란 어떤 것인가? 음…이런 기분이군 음…이런 목적이군
  • 13. Spoken language understanding 정보, 감정, 의도, 명령, … ‘이해’란 어떤 것인가? 아 네 알겠습니다! (분주)
  • 14. Spoken language understanding 기존의 SLU dataset들이 널리 활용되지 못했던 점을 보완 Ex 1) ATIS (비행 예약 데이터셋; 유료) Ex 2) Google Speech Command (적은 데이터 양) Fluent Speech Commands
  • 15. Spoken language understanding 모든 baseline code가 PyTorch로! https://github.com/lorenlugosch/end-to-end-SLU 예시) Fluent Speech Commands
  • 16. Spoken language understanding 전통적인 SLU, 그리고 end-to-end ? Turn the chicken right now
  • 17. Spoken language understanding 전통적인 SLU에서는 text output에 대해 자유롭게 text 기반으로 훈련된 성능 좋은 모델들을 활용할 수 있었다…
  • 18. Spoken language understanding 전통적인 SLU에서는 text output에 대해 자유롭게 text 기반으로 훈련된 성능 좋은 모델들을 활용할 수 있었다…
  • 19. Pretrained language models Pretrained language model BERT를 위시한 Sesame street 패거리, 그들은 누구인가? 언어 모델이란? - Modeling structure itself - Assigning probability to word sequence - Prediction ex1) "지금 내 눈 앞에서 당장 !! " ex2) "나 지금 너무 추워 " >> " "
  • 20. Pretrained language models Pretrained language model BERT를 위시한 Sesame street 패거리, 그들은 누구인가? 어떤 task를 하고 싶은데 이러한 ‘경향성’을 해당 dataset 안에서만 파악하는 것은 쉽지 않다… 어… ‘사랑해’?"지금 내 눈 앞에서 당장 !! "
  • 21. Pretrained language models Pretrained language model BERT를 위시한 Sesame street 패거리, 그들은 누구인가? 어떤 언어 모델을 ‘미리 학습시켜’ 두는것! - How? 답은 ‘사라져’!"지금 내 눈 앞에서 당장 !! "
  • 22. Pretrained language models Pretrained language model 사실 word2vec, GloVe, fastText … 모두 다 Pretrained LM 이었다 어떤 언어 모델을 ‘미리 학습시켜’ 두는것! 예컨대, word2vec 에서는 … “You shall know a word by the company it keeps” (J. R. Firth 1957:11)
  • 23. Pretrained language models Pretrained language model 사실 word2vec, GloVe, fastText … 모두 다 Pretrained LM 이었다 이 때의 문제점: ‘Context’ 안에서 달라지는 단어들의 의미를 반영하기 어렵다! 지금 내 눈앞에서 당장 사라져 !! vs. 눈은 살아 있다. 떨어진 눈은 살아 있다. 마당 위에 떨어진 눈은 살아 있다.
  • 24. Pretrained language models Pretrained language model 비슷한 structure의 LM 학습이지만, 이러한 문제를 해결하고자 나온 Deep contextualized word representation 지금 내 눈앞에서 당장 사라져 !! vs. 눈은 살아 있다. 떨어진 눈은 살아 있다. 마당 위에 떨어진 눈은 살아 있다.
  • 25. Pretrained language models Pretrained language model 이후 무수한 contextual word embedding 모델들의 등장이 … Bidirectional encoder representations from Transformers (BERT)
  • 26. Pretrained language models Bidirectional encoder representations from Transformers Objective 1: 빈칸채우기 Objective 2: 관련있는 문장인지 맞추기
  • 27. Pretrained language models Bidirectional encoder representations from Transformers 최종 output 𝑇1 ~ 𝑇 𝑁: 각 𝑇는 임베딩 𝐸에 해당하면서도 contextual한 정보를 포함하는 어떤 vector로 표현된다! >> 어떤 입력 문장에 대한 ‘유용한’ 문장 단위 사전학습 결과를 얻을 수 있음 >> Transformer, 그리고 deep한 구조의 특성 상 엄청난 computation과 데이터를 필요로 함 그래서 다 이런 것을 학습해서 공개해 주셨다… (but for PyTorch?)
  • 28. Pretrained language models Bidirectional encoder representations from Transformers For PyTorch? Well-known Hugging Face ‘Transformers’ wrapper! - TF로 제공되던 모델들을 PyTorch에서 쓸 수 있게 함 - 손쉬운 로딩 및 Fine-tuning - 다양한 모델들을 비슷한 방식으로 테스트 가능
  • 29. Pretrained language models Bidirectional encoder representations from Transformers Fine-tuning with FSC ground truth scripts!
  • 30. Pretrained language models Bidirectional encoder representations from Transformers Fine-tuning with FSC ground truth scripts!
  • 31. Pretrained language models Bidirectional encoder representations from Transformers Fine-tuning with FSC ground truth scripts!
  • 32. Pretrained language models 방법 1. ASR output을 활용 ASR output이 항상 옳을 것이라 기대하기 어렵다! 그래서 텍스트로 훈련해서 좋은 성능을 얻었는데, 이걸 어떻게 써먹을 것인가…? 해당 데이터셋을 활용, phoneme posterior-based pretrained LM을 구현한 Wang et al. (2020)의 실험 결과 – FSC는 ASR 측면에서는 쉽지 않은 task일 수 있다
  • 33. Pretrained language models 그래서 텍스트로 훈련해서 좋은 성능을 얻었는데, 이걸 어떻게 써먹을 것인가…? 방법 1. ASR output을 활용 ASR output이 항상 옳을 것이라 기대하기 어렵다! 방법 2. ASR pretrained module의 뒷단에 붙여서 활용? NN 학습이 윗쪽만 freeze시키는 방식으로 되기 어렵다 초기 구상 아키텍쳐 (weight가 꼬임!)
  • 35. Knowledge distillation 무언가를 ‘증류’ 하다 위스키…? ‘지식’을요…?
  • 36. Knowledge distillation 입력 input 출력 output 모델링: input > output 이 될 수 있게 하는 ‘큰’ weight set (weight ~ trainable param.) Neural network 기반 학습의 주요 구성 요소 어떻게? Weight가 update될 수 있도록 출력 layer ‘뒤’로 어떤 정보를 Back propagate한다. 어떤 정보? Loss (Weight 기반의 예측과 어떤 target과의 gap)
  • 37. Knowledge distillation Neural network 기반 학습의 주요 구성 요소 어떤 정보? Loss (Weight 기반의 예측과 어떤 target과의 gap) 어떤 gap? Target이 무엇이냐에 따라 (Task마다) 다르다! - Categorical target ~ Cross-entropy loss (분류) - Non-categorical ~ Mean square error loss (회귀) - … (다양한 task에서 다양하게 정의 가능) Loss = f (answer, inference)
  • 38. Knowledge distillation 그런데 이 ‘loss’에 다른 것을 사용해볼 수도 있다? 가지고 있는 데이터를 이용해 혼자 익히는 모델 (독학) >> 배우기에 시간이 걸림 여기에 어떤 다른 모델의 inference를 추가적으로 배워볼 수 있다면? 힘들다… Loss = f (answer, inference) Loss1 = f answer, inferences Loss2 = g inferences , inferencet
  • 39. Knowledge distillation Distillation as a teacher-student learning teacher (t) Loss1 = f answer, inferences Loss2 = g inferences , inferencet student (s) 𝑇𝑜𝑡𝑎𝑙 𝐿𝑜𝑠𝑠 = 𝐿𝑜𝑠𝑠1 + 𝐿𝑜𝑠𝑠2 Distilled knowledge Cross-entropy Mean square/average error 답지를 알려주는 것 (Loss1) 과의 차이: 어떤 ‘사고과정’을 전달해 줄 수 있다!
  • 40. Knowledge distillation 일반적으로는 teacher과 student의 구조/입출력이 같다! (text / image / speech …) 왜 하나? - Student가 더 빠르고 효율적으로 배울 수 있게 - Size가 작은 모델도 큰 모델만큼 정확히 동작할 수 있게 (distillation for model compression)
  • 41. Knowledge distillation 입출력이 다를 수도 있다! 이른바 Cross-modality Speech와 text는 조금 더 특별하다 서로 다른 modality - Analog vs. Digital - Audio vs. Unicode - Frame vs. Token
  • 42. Knowledge distillation 입출력이 다를 수도 있다! 이른바 Cross-modality Speech와 text는 조금 더 특별하다 서로 다른 modality - Analog vs. Digital - Audio vs. Unicode - Frame vs. Token 그렇지만 ‘거의’ 같은 내용을 전달할 수 있다! 몇 개 가져가 Should I take some? How many should I take? You can take some? 왜 ‘거의’? 일단 지금 하는 FSC task에서는 이 내용은 생각하지 않기로 하자!
  • 43. Knowledge distillation 입출력이 다를 수도 있다! 이른바 Cross-modality Modality가 달라도 같은 내용을 전달할 수 있다면? + 목적으로 하는 task도 같다면? >> 다루는 입력 데이터가 달라도 distillation을 할 수 있지 않을까? e.g., Speech translation
  • 44. Knowledge distillation 입출력이 다를 수도 있다! 이른바 Cross-modality Modality가 달라도 같은 내용을 전달할 수 있다면? + 목적으로 하는 task도 같다면? >> 다루는 입력 데이터가 달라도 distillation을 할 수 있지 않을까? e.g., Speech translation Spoken language understanding Accepted at Interspeech 2020!
  • 45. Knowledge distillation Cross-modal knowledge distillation (feat. PyTorch)
  • 46. Knowledge distillation Cross-modal knowledge distillation - Distillation 자체도 성공적; Distillation을 사용하지 않은 기존의 학습에 비해 성능 향상 - 다른 성능 개선 방법인 phoneme posterior -based BERT model의 성능을 상회
  • 47. Knowledge distillation Cross-modal knowledge distillation - 특히 data가 부족할 수 있는 speech의 경우 해당 방법으로 이득을 볼 수 있을 것! - KD loss의 weight, 그리고 scheduling 등에 영향을 받을 수 있음 (덜 heuristic하게?)
  • 48. Takeaways SLU? Spoken language understanding (음성/인식된 음성의 이해) BERT? 유용한 ‘문장 표현 도구’ (word2vec의 ‘문장’ 버전) Distillation? 학습을 보다 쉽게 인도해 주는 것 (T-S의 입력이 달라도 가능) SLU? BERT? Distillation? 그게 뭔데… 어떻게 하는 건데… (feat. PyTorch) 모두 PyTorch로 쉽게 코딩할 수 있었다! 고마워요 PyTorch! 고마워요 Hugging Face!
  • 49. Thank you for watching.
  • 50. Q & A