- GPT-1: Improving Language Understanding by Generative Pre-Training
- GPT-2: Language Models are Unsupervised Multitask Learners
- GPT-3: Language Models are Few-Shot Learners
De text a deep text ranking framework with berttaeseon ryu
링크드인에서 발표한 논문으로, 제목에서 유추하실수 있듯, 검색 시스템에서 일하시고, 연구하시는 분들이 참고하시면 좋을 논문입니다!
BERT는 분명 NLP에서 뛰어난 성과를 보이고 있지만, 하루에 수천만번 검색이 이루어지는 대형 포털 사이트에서는 검색시스템에 직접적용하기에는 매우 큰 부담입니다. 그렇기에 링크드인에서 직접 다양한 사례를 연구해보며, BERT를 기반으로 모델을 구축하는 Ranking 시스템 프레임 워크 DeTEXT를 소개하며, 오프라인 및 온라인 실험에서도 많은 성능 개선을 이루어 냈습니다!
DeBERTA : Decoding-Enhanced BERT with Disentangled Attentiontaeseon ryu
오늘 소개해 드릴 논문은 구글의 BERT와 페이스북 현재 메타의 RoBERTa를 기반으로 만들어진 모델입니다. RoBERTa + Disentangled Attention과 enhanced mask decode
두가지의 핵심 기술로 RoBERTa를 더욱 개선 시킨 모델이라고 이해하시면 될 것 같습니다. 추가적으로 Scale Invariant Fine Tuning을 도입하여 RoBERTa를 상당히 많은 테스크에서, NLU 테스크에서는 RoBERTa, BERT이상의 성능을 보여준 논문이기도 합니다.
논문의 자세한 리뷰부터, 백그라운드 지식까지, 자연어처리팀 진명훈님이 도와주셨습니다.
De text a deep text ranking framework with berttaeseon ryu
링크드인에서 발표한 논문으로, 제목에서 유추하실수 있듯, 검색 시스템에서 일하시고, 연구하시는 분들이 참고하시면 좋을 논문입니다!
BERT는 분명 NLP에서 뛰어난 성과를 보이고 있지만, 하루에 수천만번 검색이 이루어지는 대형 포털 사이트에서는 검색시스템에 직접적용하기에는 매우 큰 부담입니다. 그렇기에 링크드인에서 직접 다양한 사례를 연구해보며, BERT를 기반으로 모델을 구축하는 Ranking 시스템 프레임 워크 DeTEXT를 소개하며, 오프라인 및 온라인 실험에서도 많은 성능 개선을 이루어 냈습니다!
DeBERTA : Decoding-Enhanced BERT with Disentangled Attentiontaeseon ryu
오늘 소개해 드릴 논문은 구글의 BERT와 페이스북 현재 메타의 RoBERTa를 기반으로 만들어진 모델입니다. RoBERTa + Disentangled Attention과 enhanced mask decode
두가지의 핵심 기술로 RoBERTa를 더욱 개선 시킨 모델이라고 이해하시면 될 것 같습니다. 추가적으로 Scale Invariant Fine Tuning을 도입하여 RoBERTa를 상당히 많은 테스크에서, NLU 테스크에서는 RoBERTa, BERT이상의 성능을 보여준 논문이기도 합니다.
논문의 자세한 리뷰부터, 백그라운드 지식까지, 자연어처리팀 진명훈님이 도와주셨습니다.
네이버에서 진행한 NLP challenge에서 수상 후 발표한 자료입니다.
[대회링크] https://github.com/naver/nlp-challenge
-------------------------------------------------------------------------------
이신의 (lsnfamily02@yonsei.ac.kr)
박장원 (adieujw@gmail.com)
2021년 구글 브레인에서 발표한 눈문에 대한 리뷰입니다.
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
https://arxiv.org/abs/2101.03961
Python과 Tensorflow를 활용한 AI Chatbot 개발 및 실무 적용Susang Kim
도입
AI Chatbot 소개
Chatbot Ecosystem
Closed vs Open Domain
Rule Based vs AI
Chat IF Flow and Story Slot
AI기반의 학습을 위한 Data 구성 방법
Data를 구하는 법 / Train을 위한 Word Representation
Data의 구성 / Data Augmentation(Intent, NER)
자연어처리 위한 AI 적용 방안
Intent (Char-CNN) / QnA (Seq2Seq)
Named Entity Recognition (Bi-LSTM CRF) / Ontology (Graph DB)
Chatbot Service를 위한 Architecture 구성
Chatbot Architecture
NLP Architecture
Web Service Architecture
Bot builder / Chatbot API
Test Codes for Chatbot
실무에서 발생하는 문제와 해결 Tips
Ensemble and voting / Trigger / Synonym(N-Gram)
Tone Generator / Parallel processing / Response Speed
마무리
[설명 코드]
Text Augmentation / Slot Bot / QA Bot / Graph DB / Response Generator
ChatGPT is a natural language processing technology developed by OpenAI. This model is based on the GPT-3 architecture and can be applied to various language tasks by training on large-scale datasets. When applied to a search engine, ChatGPT enables the implementation of an AI-based conversational system that understands user questions or queries and provides relevant information.
ChatGPT takes user questions as input and generates appropriate responses based on them. Since this model considers the context of previous conversations, it can provide more natural dialogue. Moreover, ChatGPT has been trained on diverse information from the internet, allowing it to provide practical and accurate answers to user questions.
When applying ChatGPT to a search engine, the system searches for relevant information based on the user's search query and uses ChatGPT to generate answers to present along with the search results. To do this, the search engine provides an interface that connects with ChatGPT, allowing the user's questions to be passed to the model and the answers generated by the model to be presented alongside the search results.
네이버에서 진행한 NLP challenge에서 수상 후 발표한 자료입니다.
[대회링크] https://github.com/naver/nlp-challenge
-------------------------------------------------------------------------------
이신의 (lsnfamily02@yonsei.ac.kr)
박장원 (adieujw@gmail.com)
2021년 구글 브레인에서 발표한 눈문에 대한 리뷰입니다.
Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
https://arxiv.org/abs/2101.03961
Python과 Tensorflow를 활용한 AI Chatbot 개발 및 실무 적용Susang Kim
도입
AI Chatbot 소개
Chatbot Ecosystem
Closed vs Open Domain
Rule Based vs AI
Chat IF Flow and Story Slot
AI기반의 학습을 위한 Data 구성 방법
Data를 구하는 법 / Train을 위한 Word Representation
Data의 구성 / Data Augmentation(Intent, NER)
자연어처리 위한 AI 적용 방안
Intent (Char-CNN) / QnA (Seq2Seq)
Named Entity Recognition (Bi-LSTM CRF) / Ontology (Graph DB)
Chatbot Service를 위한 Architecture 구성
Chatbot Architecture
NLP Architecture
Web Service Architecture
Bot builder / Chatbot API
Test Codes for Chatbot
실무에서 발생하는 문제와 해결 Tips
Ensemble and voting / Trigger / Synonym(N-Gram)
Tone Generator / Parallel processing / Response Speed
마무리
[설명 코드]
Text Augmentation / Slot Bot / QA Bot / Graph DB / Response Generator
ChatGPT is a natural language processing technology developed by OpenAI. This model is based on the GPT-3 architecture and can be applied to various language tasks by training on large-scale datasets. When applied to a search engine, ChatGPT enables the implementation of an AI-based conversational system that understands user questions or queries and provides relevant information.
ChatGPT takes user questions as input and generates appropriate responses based on them. Since this model considers the context of previous conversations, it can provide more natural dialogue. Moreover, ChatGPT has been trained on diverse information from the internet, allowing it to provide practical and accurate answers to user questions.
When applying ChatGPT to a search engine, the system searches for relevant information based on the user's search query and uses ChatGPT to generate answers to present along with the search results. To do this, the search engine provides an interface that connects with ChatGPT, allowing the user's questions to be passed to the model and the answers generated by the model to be presented alongside the search results.
2. LLM
BERT vs. GPT
Fine-tuning Approach | left-to-right Transformer Feature-based Approach | left-to-right & right-to-left LSTM
Fine-tuning Approach
Strategies for applying pre-trained language representations to down-stream tasks. Both approaches share the same objective
function during pre-training to learn general language representations:
(1) Feature-based
• Use task speci
fi
c architectures that include the pre-trained representations as additional features
• Ex. ELMo (Peters et al., 2018)
(2) Fine-tuning
• Minimal task-speci
fi
c parameters, trained in the downstream tasks by simply
fi
ne-tuning all pre-trained parameters
• Ex. BERT (bidirectional LM), OpenAI GPT-1(unidirectional LM)
3. GPT
Version Comparison
GPT-2 (2019)
• Fine-tuning 과정 생략: Zero-shot
• 학습 시 Input/Task를 입력으로 사용
• Transformer Structure
• Layer norm 위치 변경
• Residual Layer initialization 변경
• Context size 512 1024
• Bigger Model than previous
• GPT-1 모델의 약 12.8배 Parameter
• 약 800만개 문서/40GB Dataset 학습
→
GPT-1 (2018)
• Transformer Decoder (x12) Structure
• Masked self attention
• Pre-training Fine-tuning
• Input Transformation for Fine-
tuning process (Supervised)
→
GPT-3 (2020)
• Fine-tuning 과정 생략: Few-shot
• No Gradient updating
• Transformer Structure
• Sparse attention 사용
• Self-attention layer
• Bigger Model than previous
• GPT-2 모델의 약 12배 Parameter
• 570GB Dataset 학습
↑
• Unidirectional (단방향성) LM Bidirectional (양방향성) LM BERT 논문에서 GPT-1이 지닌 한계로 지적
• Auto-regressive Model GPT 모델의 한계점?
• Text Encoding: Prompt Tokenizer (Byte-pair-encoding, BPE)
←
←
→
4. GPT-1
Improving Language Understanding by Generative Pre-Training(2018)
Unsupervised pre-training model 개발 사전적으로 유용한 정보 획득, 모델의 변화없이 Fine-tuning한 하위 Task에서 향상된 성능 목표
• Task-speci
fi
c input transformations (for
fi
ne-tuning)
• (1) Unsupervised pretext training (2) Supervised
fi
ne-tuning
• Input transformations for
fi
ne-tuning on di
ff
erent tasks.
• Convert all structured inputs into token sequences
to be processed by pre-trained model.
• Analysis: Zero-shot Behaviors
• Transformer기반 pre-training LM의 효과 이해를 목적한 세부 실험
• (Hypothesis) LSTM과 비교하여 Transformer의 structured attentional
memory에서 transfer 방법이 도움이 될 것
• Zero-shot performance: LSTM Variance , Transfer 구조의
Inductive bias가 transfer에 assist (zero-shot의 가능성)
→
→
↑
Task classi
fi
cation 구조/Objective BERT 구조 동일
→
5. GPT-2
Language Models are Unsupervised Multitask Learners (2019)
Unsupervised pre-training model 개발 Fine-tuning 없이 zero-shot만으로 downstream task 수행을 목표
GPT-2 is su
ffi
cient to over- come the ine
ffi
ciencies of uni-directional representations demonstrated by BERT
• Fine-tuning 과정 생략: Zero-shot
• Zero-shot 실험 환경에서 8 task 중 7개에서 SOTA 달성 (Summarization, Q&A 저조)
• Byte 시퀀스에 BPE를 적용하기 때문에 자유롭게 기존의 데이터 셋에 적용이 가능
• p(output | input, task)
• 태스크를 명시적으로 알려주는 것이 아니라, 모델에게 원하는 출력 형식의 예시를 주는 방식
• Translation Train ex: (translate to french, english text, french text), "Translate the following English text to French: '{txt}'"
• Generalization vs Memorization
• Training set 과의 overlap 문제 발생 우려 성능 개선의 큰 요인이 아니며 모델이 아직 under-
fi
tting되어 개선의 여지가 있다고 판단
• 모델의 크기에 따른 성능 증가 결과 제시
→
→
6. GPT-3
Language Models are Few-Shot Learners (2020)
GPT2와 거의 비슷한 구조/목표를 유지. zero-, one-, few-shot 방법으로 다양하게 모델을 Setting, Benchmarking
• Meta-Learning
• Task-Agnostic (Task에 구애받지 않는)
• zero-, one-, and few-shot performance often grows with
model capacity, perhaps suggesting that larger models
are more pro
fi
cient meta-learners.
• Few-shot method Infer할 Input과 few-shot example이 함께
입력되는 형태 (기존에 알려진 Few-shot learning과는 다소 차이가 있음)
→
350M
760M
355M
355M
Transformer Layer 24
Hidden state 1024
SAHead 16
7. Tokenization
LLM Pre-Processing Step
• 트랜스포머는 자연어 문장을 분절한 토큰 시퀀스를 입력으로 받으므로 문장의 토큰화 수행이 필요
• Text Encoding: Prompt (문장) Tokenizer를 이용한 Tokenization (단어) 정수 인코딩 (숫자로 표현)
• GPT는 BPE (Byte-Pair-Encoding) 기법으로 토큰화 수행, BERT는 BPE와 유사한 워드피스 (Word-piece)를 토크나이저로 사용
• 토큰화의 방식: 단어 단위 / 문자 단위 / 서브워드 단위 토큰화
1. Lower Casting
2. Tokenization
• Tokenization = 문장을 토큰 시퀀스로 나누는 과정, Tokenizer = 토큰화를 수행하는 프로그램 (ex. Korean Tokenizer: mecab, kkma..)
• BPE: 단어를 최소 단위로 쪼개어 (byte 시퀀스) 빈도 수를 기반으로 자주 등장하는 byte 쌍을 병합, 해당 과정 반복 (단어의 변형에도 강점)
(Byte-level Version: dog, dog?, dog! 최적으로 사용하지 못함 / Word-level Version)
3. Handling Out-Of-Vocabulary (OOV)
• 단어 사전(단어-인덱스 목록)에 없는 상태의 용어
→ →
https://ratsgo.github.io/nlpbook/docs/preprocess/tokenization/