SlideShare a Scribd company logo
Kyonggi Univ. AI Lab.
PLUG AND PLAY LANGUAGE MODELS:
A SIMPLE APPROACH TO CONTROLLED TEXT GENERATION
2020.10.12
정규열
Artificial Intelligence Lab
Kyonggi Univiersity
Kyonggi Univ. AI Lab.
Index
 도입 배경
 접근 기반
 PPLM
 Bag of word
 DISCRIMINATOR
 hyperparameters 설정 가이드
 수행 결과들
 결론
Kyonggi Univ. AI Lab.
도입 배경
Kyonggi Univ. AI Lab.
도입 배경
 Transformer 기반의 모델로 인해 Text Generation이 발달함
 대규모의 Text 처리를 가능하게 되었다.
 그러나 모델이 이미 학습이 되었을 때 Attribute를 제어하기 힘들다.
 특정 Attribute에 학습 되어 있는 문제를 다른 Attribute로 제어를 해야한다.
 이를 위하여 일반적으로 모델의 변형이나, 하이퍼 파라미터 등의 튜닝이 더 필요하
다.
간단하게 Attribute를 제어하는 기법(PPLM)을 제안한다.
해당 소스 코드 : https://github.com/uber-research/PPLM
Kyonggi Univ. AI Lab.
도입 배경
 예시
 Input이 부정적임
The food is awful The staff are rude and lazy. The food disgusting…
𝑝(𝑥)
기존 모델 :
제안 모델 : The food is awful But there is also the music, the story and the magic…
𝑝 𝑥 𝑎)
긍정의 방향
Input은 부정적이나 그 이후는 긍정으로 바꾸고 싶
다!
Kyonggi Univ. AI Lab.
접근 기반
Kyonggi Univ. AI Lab.
접근 기반
 Computer Vison에 적용된 PPGN(Plug & Play Generative Networks)에 영감을 얻어
접근함.r
 Controllable generation : 𝑝(x | a)
 X : 생성된 샘플, a : 목표로 하는 Attribute
 Generative model : 𝑝(x)
 조건에 맞는 생성을 하기 어렵다!
 Discriminator를 추가하였다. -> 𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x)
가능도(likelihood)
사전 분포 (prior distribution)
사후 분포(posterior)
Hyper parameter를 이용하여 가능도를 조절한다.
Kyonggi Univ. AI Lab.
접근 기반
 정리
Kyonggi Univ. AI Lab.
PPLM
Kyonggi Univ. AI Lab.
PPLM
 PPLM의 핵심 포인트들!
 Transformer를 이용한 언어 모델
 Generation을 목적에 맞게 제어함(Steering Generation)
 생성 언어의 유창성을 보증함(Ensuring Fluency)
 업데이트 방향
Kyonggi Univ. AI Lab.
PPLM
 Transformer를 이용한 언어 모델
 이전 단어들 순서를 입력 받아 다음 단어 예측함
 Transformer 기반의 언어 모델
 Query, key, Value를 이용하는 Attention 기법을 통해 다음 단어를 예측한다.
 Query : 바로 이전 단어 + 현재 포지션 값
 Key , value : 이전에 나온 모든 단어들!
History 정보
Kyonggi Univ. AI Lab.
PPLM
 Generation을 목적에 맞게 제어함(Steering Generation) : Latent updates
𝛼 값을 적절히 세팅 해야 한다.
매 스텝 마다 진행하면 안되고 처음 20 스텝만 이 과정을 진행한다.
Kyonggi Univ. AI Lab.
PPLM
 Steering Generation
 α 값에 따른 결과 비교
 0.0001 : 첫 문장이 과학과 관련이 없다.
 0.001 : 감자의 사용처 등 과학과 관련 없는 내용이
대부분이다.
 0.005 : 마찬가지로 과학과 관련 없는 문장이다
 0.01 : 감자에 관련 과학적인 연구 결과를 서술하였다.
dk 값이 증가 할 수록 과학에 맞는 서술 함을 알 수 있다.
만약 α 계속 커지면 어떻게 될까?
Kyonggi Univ. AI Lab.
PPLM
 α 값에 따른 결과 비교
 0.02 ~ 0.04 : 이런 경우도 과학과 관련 있
는 서술을 하였다.
 그러나 그 이상은 완전 엉뚱한 결과를 서
술한다.
따라서 적절한α 값을 설정해야 한다. !
α -> 0.01, 0.02, 0.03 정도로 설정!
Kyonggi Univ. AI Lab.
PPLM
 Latent updates횟수에 따른 결과
 적당한 α 값을 설정하여도 매 스
텝마다 Latent update를 수행하면
오히려 문장이 퇴화한다.
매 스텝 처음 20 스텝
매 스텝 마다 진행하면 안되고 처음 20 스텝만 이 과정을 진행한다.
Kyonggi Univ. AI Lab.
PPLM
 생성 언어의 유창성을 보증함(Ensuring Fluency)
 KL-Divergence
 업데이트 전 후로 생성된 결과의 분포가 최소화 되도록 함.
 𝜆𝐾𝐿이 0.01 일 때 최적이었다.
 Post-norm Geometric Mean Fusion
 학습에 영향은 없다
 업데이트 전후의 결과 기반으로 산출된 다음 단어의 확률을 적절히 조합한다.
Kyonggi Univ. AI Lab.
PPLM
 업데이트 방향
Kyonggi Univ. AI Lab.
BAG OF WORD
Kyonggi Univ. AI Lab.
Bag of word
 단어 가방을 뜻한다.
 ex)
 Fantasy/Magic
 beast, Cerberus, demon, dragon, fairy, Frankenstein, ghost, Godzilla, giant, horror, hydra, imp,
monster, mummy, ogre, orc, savage, spirit, sprite, titan, troll, undead, unicorn, vampire, witch,
zombie
 Space
 planet, galaxy, space, universe, orbit, spacecraft, earth, moon, comet, star, astronaut, aerospace,
asteroid, spaceship, starship, galactic, satellite, meteor
 𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x)
단어 가방의 모든 단어들에 대한 분포를 이용한다.
Kyonggi Univ. AI Lab.
Bag of word
 다음과 같이 설정 가능하다.
 Science를 적용한다.
 Science와 legal를 적용한다.
Kyonggi Univ. AI Lab.
DISCRIMINATOR
Kyonggi Univ. AI Lab.
DISCRIMINATOR
 Bag of word 대신에 레이어 1개의 신경망으로 사용한다.
 𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x)
 이 신경망의 경우 data set을 이용하여 따로 학습을 진행한다.
 단 기존 GPT-2 모델은 건드리지 않는다.
신경망으로 사용!
0 1 2 3 4
positive negative very positive very negative neutral
SST-5 Data set
Kyonggi Univ. AI Lab.
HYPERPARAMETERS 설정 가이드
Kyonggi Univ. AI Lab.
hyperparameters 설정 가이드
 hyperparameters 설정 가이드
 반복되는 문구가 자주 등장하는 경우
 (For e.g. "science science experiment experiment")
 α 값을 감소 시킨다.
 KL_scale을 증가 시킨다.
 방법에 따른 설정 가이드
결국 최적의 조합을
찾아야 한다.
Kyonggi Univ. AI Lab.
수행 결과들
Kyonggi Univ. AI Lab.
수행 결과들
 story generation
설정한 문구에 맞게 story가 생성 되었다.
Kyonggi Univ. AI Lab.
수행 결과들
 다수의 Bag of word 인 경우
Kyonggi Univ. AI Lab.
수행 결과들
 동일 Bag of word일때 접두어별 대응
막상 해석을 해보면 어색한 부분이 많다
Kyonggi Univ. AI Lab.
수행 결과들
 직접 수행해본 결과
 Korean Air – legal
 교정 전
 Korean Air has announced that it will be offering a new service called "Korean Air Pass" to
its customers starting in January. The service will allow customers to fly on Korean Air
flights from any airport in the world, including Los Angeles International Airport, New
York's JFK Airport, and London's Heathrow Airport. The service will be available to all
Korean Air customers who have a Korean Air Pass. The service will be available for a limited
time, and will be available for a limited time only.
 교정 후
 Korean Air has announced that it will be offering a free flight to the United States for all
passengers who have booked a ticket for the upcoming Korean Air KIA World Tour. The free
flight will be available from the beginning of April, and will be available to all passengers
who have booked a ticket for the Korean Air KIA World Tour
Kyonggi Univ. AI Lab.
수행 결과들
 직접 수행해본 결과
 Korean Air – science
 교정 전
 Korean Air has announced that it will be offering a new service called "Korean Air Pass" to
its customers starting in January. The service will allow customers to fly on Korean Air
flights from any airport in the world, including Los Angeles International Airport, New
York's JFK Airport, and London's Heathrow Airport. The service will be available to all
Korean Air customers who have a Korean Air Pass. The service will be available for a limited
time, and will be available for a limited time only.
 교정 후
 Korean Air is planning to launch a new service in the coming months, which will allow
passengers to book flights from Seoul to other cities in South Korea. The service, called
"Korean Air Express," will allow passengers to book flights from Seoul to other cities in
South Korea, including Seoul, Busan, and Gwangju. The service will be launched in the
coming months, according to a statement from Korean Air. The service will be available
from the beginning of the year, …..
Kyonggi Univ. AI Lab.
수행 결과들
 직접 수행해본 결과
 Korean Air – Positive words
 교정 전
 Korean Air has announced that it will be offering a new service called "Korean Air Pass"
to its customers starting in January. The service will allow customers to fly on Korean
Air flights from any airport in the world, including Los Angeles International Airport,
New York's JFK Airport, and London's Heathrow Airport. The service will be available to
all Korean Air customers who have a Korean Air Pass. The service will be available for a
limited time, and will be available for a limited time only.
 교정 후
 Korean Air is the only airline in the world that offers free Wi-Fi on all flights. The airline
has been offering free Wi-Fi on all flights since the beginning of its service in 2012. The
Wi-Fi is available on all seats, including the first class cabin.
Kyonggi Univ. AI Lab.
결론
Kyonggi Univ. AI Lab.
결론
 기존의 GPT-2 모델을 이용하여 원하는 방향으로 문장 생성이 가능하다
 Latent update를 통하여 조절 가능하다.
 또한 Fluency도 개선 하였다.
 단 일부 하이퍼 파라미터를 적절한 값으로 설정 해야 한다.
 Latent update를 처음 20스텝 정도만 진행한다.
 α -> 0.01, 0.02, 0.03 정도로 설정하여 사용한다.
 bag of word 혹은 DISCRIMINATOR중 상황에 맞는 방법을 사용해야 한다.
 bag of word의 경우 원리는 간단 하나 많은 단어를 넣어야 한다.
 DISCRIMINATOR의 경우는 학습에 소요시간이 크지만 성능은 bag of word 보다 좋은 편이다.

More Related Content

What's hot

Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
Sri Ambati
 
Computer Vision with Deep Learning
Computer Vision with Deep LearningComputer Vision with Deep Learning
Computer Vision with Deep Learning
Capgemini
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
Databricks
 
Deep learning health care
Deep learning health care  Deep learning health care
Deep learning health care
Meenakshi Sood
 
Deep Learning
Deep Learning Deep Learning
Deep Learning
Roshan Chettri
 
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
Universitat Politècnica de Catalunya
 
KERAS Python Tutorial
KERAS Python TutorialKERAS Python Tutorial
KERAS Python Tutorial
MahmutKAMALAK
 
introduction to deep Learning with full detail
introduction to deep Learning with full detailintroduction to deep Learning with full detail
introduction to deep Learning with full detail
sonykhan3
 
Fine tuning large LMs
Fine tuning large LMsFine tuning large LMs
Fine tuning large LMs
SylvainGugger
 
Support Vector Machine (SVM)
Support Vector Machine (SVM)Support Vector Machine (SVM)
Support Vector Machine (SVM)
Sana Rahim
 
Intro to deep learning
Intro to deep learning Intro to deep learning
Intro to deep learning
David Voyles
 
Introduction to TensorFlow
Introduction to TensorFlowIntroduction to TensorFlow
Introduction to TensorFlow
Matthias Feys
 
Introduction To TensorFlow
Introduction To TensorFlowIntroduction To TensorFlow
Introduction To TensorFlow
Spotle.ai
 
First-Generation-1G-Cellular-Network-Technology.pptx
First-Generation-1G-Cellular-Network-Technology.pptxFirst-Generation-1G-Cellular-Network-Technology.pptx
First-Generation-1G-Cellular-Network-Technology.pptx
NischalBhattarai8
 
AlexNet
AlexNetAlexNet
AlexNet
Bertil Hatt
 
Deep learning with keras
Deep learning with kerasDeep learning with keras
Deep learning with keras
MOHITKUMAR1379
 
Representational Continuity for Unsupervised Continual Learning
Representational Continuity for Unsupervised Continual LearningRepresentational Continuity for Unsupervised Continual Learning
Representational Continuity for Unsupervised Continual Learning
MLAI2
 
Image Classification using deep learning
Image Classification using deep learning Image Classification using deep learning
Image Classification using deep learning
Asma-AH
 
Machine learning workshop
Machine learning workshopMachine learning workshop
Machine learning workshop
Lakshya Sivaramakrishnan
 
Deep Learning - Overview of my work II
Deep Learning - Overview of my work IIDeep Learning - Overview of my work II
Deep Learning - Overview of my work II
Mohamed Loey
 

What's hot (20)

Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
 
Computer Vision with Deep Learning
Computer Vision with Deep LearningComputer Vision with Deep Learning
Computer Vision with Deep Learning
 
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
A Tale of Three Deep Learning Frameworks: TensorFlow, Keras, & PyTorch with B...
 
Deep learning health care
Deep learning health care  Deep learning health care
Deep learning health care
 
Deep Learning
Deep Learning Deep Learning
Deep Learning
 
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
Medical Imaging (D3L3 2017 UPC Deep Learning for Computer Vision)
 
KERAS Python Tutorial
KERAS Python TutorialKERAS Python Tutorial
KERAS Python Tutorial
 
introduction to deep Learning with full detail
introduction to deep Learning with full detailintroduction to deep Learning with full detail
introduction to deep Learning with full detail
 
Fine tuning large LMs
Fine tuning large LMsFine tuning large LMs
Fine tuning large LMs
 
Support Vector Machine (SVM)
Support Vector Machine (SVM)Support Vector Machine (SVM)
Support Vector Machine (SVM)
 
Intro to deep learning
Intro to deep learning Intro to deep learning
Intro to deep learning
 
Introduction to TensorFlow
Introduction to TensorFlowIntroduction to TensorFlow
Introduction to TensorFlow
 
Introduction To TensorFlow
Introduction To TensorFlowIntroduction To TensorFlow
Introduction To TensorFlow
 
First-Generation-1G-Cellular-Network-Technology.pptx
First-Generation-1G-Cellular-Network-Technology.pptxFirst-Generation-1G-Cellular-Network-Technology.pptx
First-Generation-1G-Cellular-Network-Technology.pptx
 
AlexNet
AlexNetAlexNet
AlexNet
 
Deep learning with keras
Deep learning with kerasDeep learning with keras
Deep learning with keras
 
Representational Continuity for Unsupervised Continual Learning
Representational Continuity for Unsupervised Continual LearningRepresentational Continuity for Unsupervised Continual Learning
Representational Continuity for Unsupervised Continual Learning
 
Image Classification using deep learning
Image Classification using deep learning Image Classification using deep learning
Image Classification using deep learning
 
Machine learning workshop
Machine learning workshopMachine learning workshop
Machine learning workshop
 
Deep Learning - Overview of my work II
Deep Learning - Overview of my work IIDeep Learning - Overview of my work II
Deep Learning - Overview of my work II
 

Similar to plug and play language models a simple approach to controlled text generation

Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
Kieran Alden
 
A Custom Robotic ARM In CoppeliaSim
A Custom Robotic ARM In CoppeliaSimA Custom Robotic ARM In CoppeliaSim
A Custom Robotic ARM In CoppeliaSim
Jim Jimenez
 
Presentation
PresentationPresentation
Presentation
Anas Ambri
 
Stochastic latent actor critic - deep reinforcement learning with a latent va...
Stochastic latent actor critic - deep reinforcement learning with a latent va...Stochastic latent actor critic - deep reinforcement learning with a latent va...
Stochastic latent actor critic - deep reinforcement learning with a latent va...
KyuYeolJung
 
Evaluating the Impact of Android Best Practices on Energy Consumption
Evaluating the Impact of Android Best Practices on Energy ConsumptionEvaluating the Impact of Android Best Practices on Energy Consumption
Evaluating the Impact of Android Best Practices on Energy Consumption
Karthik Mohan
 
Ontologies in Physical Science
Ontologies in Physical ScienceOntologies in Physical Science
Ontologies in Physical Science
petermurrayrust
 
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test OraclesExactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Iosif Itkin
 
Particle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its ApplicationsParticle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its Applications
adil raja
 
Wo w project
Wo w projectWo w project
Wo w project
Snyder16
 
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
Liang Gong
 
nature inspired algorithms
nature inspired algorithmsnature inspired algorithms
nature inspired algorithms
Gaurav Goel
 
ISHOLA Babatunde Isaac (CV)
ISHOLA Babatunde Isaac (CV)ISHOLA Babatunde Isaac (CV)
ISHOLA Babatunde Isaac (CV)
Babatunde Ishola
 
20190708 bumsookim yolact
20190708 bumsookim yolact20190708 bumsookim yolact
20190708 bumsookim yolact
Brian Kim
 
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACEAN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
Babatunde Ishola
 
Advanced Robotics Projects For Undergraduate Students
Advanced Robotics Projects For Undergraduate StudentsAdvanced Robotics Projects For Undergraduate Students
Advanced Robotics Projects For Undergraduate Students
Emily Smith
 
TRPO(trust region policy optimization)
TRPO(trust region policy optimization)TRPO(trust region policy optimization)
TRPO(trust region policy optimization)
KyuYeolJung
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
Muhammad Jahanzaib
 
Artificial Intelligence for Undergrads
Artificial Intelligence for UndergradsArtificial Intelligence for Undergrads
Artificial Intelligence for Undergrads
Jose Berengueres
 
Mixing Python and Java
Mixing Python and JavaMixing Python and Java
Mixing Python and Java
Andreas Schreiber
 
2014 10-15-Nextbug edinburgh
2014 10-15-Nextbug edinburgh2014 10-15-Nextbug edinburgh
2014 10-15-Nextbug edinburgh
Yannick Wurm
 

Similar to plug and play language models a simple approach to controlled text generation (20)

Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
Tools for Building Confidence in Using Simulation To Inform or Replace Real-W...
 
A Custom Robotic ARM In CoppeliaSim
A Custom Robotic ARM In CoppeliaSimA Custom Robotic ARM In CoppeliaSim
A Custom Robotic ARM In CoppeliaSim
 
Presentation
PresentationPresentation
Presentation
 
Stochastic latent actor critic - deep reinforcement learning with a latent va...
Stochastic latent actor critic - deep reinforcement learning with a latent va...Stochastic latent actor critic - deep reinforcement learning with a latent va...
Stochastic latent actor critic - deep reinforcement learning with a latent va...
 
Evaluating the Impact of Android Best Practices on Energy Consumption
Evaluating the Impact of Android Best Practices on Energy ConsumptionEvaluating the Impact of Android Best Practices on Energy Consumption
Evaluating the Impact of Android Best Practices on Energy Consumption
 
Ontologies in Physical Science
Ontologies in Physical ScienceOntologies in Physical Science
Ontologies in Physical Science
 
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test OraclesExactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges Test Oracles
 
Particle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its ApplicationsParticle Swarm Optimization: The Algorithm and Its Applications
Particle Swarm Optimization: The Algorithm and Its Applications
 
Wo w project
Wo w projectWo w project
Wo w project
 
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
 
nature inspired algorithms
nature inspired algorithmsnature inspired algorithms
nature inspired algorithms
 
ISHOLA Babatunde Isaac (CV)
ISHOLA Babatunde Isaac (CV)ISHOLA Babatunde Isaac (CV)
ISHOLA Babatunde Isaac (CV)
 
20190708 bumsookim yolact
20190708 bumsookim yolact20190708 bumsookim yolact
20190708 bumsookim yolact
 
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACEAN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
AN IMPROVED OPERATIONAL AMPLIFIER ILAB WITH A MORE REALISTIC LOOKING INTERFACE
 
Advanced Robotics Projects For Undergraduate Students
Advanced Robotics Projects For Undergraduate StudentsAdvanced Robotics Projects For Undergraduate Students
Advanced Robotics Projects For Undergraduate Students
 
TRPO(trust region policy optimization)
TRPO(trust region policy optimization)TRPO(trust region policy optimization)
TRPO(trust region policy optimization)
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Artificial Intelligence for Undergrads
Artificial Intelligence for UndergradsArtificial Intelligence for Undergrads
Artificial Intelligence for Undergrads
 
Mixing Python and Java
Mixing Python and JavaMixing Python and Java
Mixing Python and Java
 
2014 10-15-Nextbug edinburgh
2014 10-15-Nextbug edinburgh2014 10-15-Nextbug edinburgh
2014 10-15-Nextbug edinburgh
 

More from KyuYeolJung

Marl의 개념 및 군사용 적용방안
Marl의 개념 및 군사용 적용방안Marl의 개념 및 군사용 적용방안
Marl의 개념 및 군사용 적용방안
KyuYeolJung
 
Cpgan content-parsing generative
Cpgan   content-parsing generativeCpgan   content-parsing generative
Cpgan content-parsing generative
KyuYeolJung
 
MARL based on role
MARL based on roleMARL based on role
MARL based on role
KyuYeolJung
 
Style gan
Style ganStyle gan
Style gan
KyuYeolJung
 
Rethinking attention with performers
Rethinking attention with performersRethinking attention with performers
Rethinking attention with performers
KyuYeolJung
 
Attn-gan : fine-grained text to image generation
Attn-gan :  fine-grained text to image generationAttn-gan :  fine-grained text to image generation
Attn-gan : fine-grained text to image generation
KyuYeolJung
 
Language gans falling short
Language gans falling shortLanguage gans falling short
Language gans falling short
KyuYeolJung
 
COMA(counterfactual multi-agent policy gradients)
COMA(counterfactual multi-agent policy gradients)COMA(counterfactual multi-agent policy gradients)
COMA(counterfactual multi-agent policy gradients)
KyuYeolJung
 

More from KyuYeolJung (8)

Marl의 개념 및 군사용 적용방안
Marl의 개념 및 군사용 적용방안Marl의 개념 및 군사용 적용방안
Marl의 개념 및 군사용 적용방안
 
Cpgan content-parsing generative
Cpgan   content-parsing generativeCpgan   content-parsing generative
Cpgan content-parsing generative
 
MARL based on role
MARL based on roleMARL based on role
MARL based on role
 
Style gan
Style ganStyle gan
Style gan
 
Rethinking attention with performers
Rethinking attention with performersRethinking attention with performers
Rethinking attention with performers
 
Attn-gan : fine-grained text to image generation
Attn-gan :  fine-grained text to image generationAttn-gan :  fine-grained text to image generation
Attn-gan : fine-grained text to image generation
 
Language gans falling short
Language gans falling shortLanguage gans falling short
Language gans falling short
 
COMA(counterfactual multi-agent policy gradients)
COMA(counterfactual multi-agent policy gradients)COMA(counterfactual multi-agent policy gradients)
COMA(counterfactual multi-agent policy gradients)
 

Recently uploaded

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

plug and play language models a simple approach to controlled text generation

  • 1. Kyonggi Univ. AI Lab. PLUG AND PLAY LANGUAGE MODELS: A SIMPLE APPROACH TO CONTROLLED TEXT GENERATION 2020.10.12 정규열 Artificial Intelligence Lab Kyonggi Univiersity
  • 2. Kyonggi Univ. AI Lab. Index  도입 배경  접근 기반  PPLM  Bag of word  DISCRIMINATOR  hyperparameters 설정 가이드  수행 결과들  결론
  • 3. Kyonggi Univ. AI Lab. 도입 배경
  • 4. Kyonggi Univ. AI Lab. 도입 배경  Transformer 기반의 모델로 인해 Text Generation이 발달함  대규모의 Text 처리를 가능하게 되었다.  그러나 모델이 이미 학습이 되었을 때 Attribute를 제어하기 힘들다.  특정 Attribute에 학습 되어 있는 문제를 다른 Attribute로 제어를 해야한다.  이를 위하여 일반적으로 모델의 변형이나, 하이퍼 파라미터 등의 튜닝이 더 필요하 다. 간단하게 Attribute를 제어하는 기법(PPLM)을 제안한다. 해당 소스 코드 : https://github.com/uber-research/PPLM
  • 5. Kyonggi Univ. AI Lab. 도입 배경  예시  Input이 부정적임 The food is awful The staff are rude and lazy. The food disgusting… 𝑝(𝑥) 기존 모델 : 제안 모델 : The food is awful But there is also the music, the story and the magic… 𝑝 𝑥 𝑎) 긍정의 방향 Input은 부정적이나 그 이후는 긍정으로 바꾸고 싶 다!
  • 6. Kyonggi Univ. AI Lab. 접근 기반
  • 7. Kyonggi Univ. AI Lab. 접근 기반  Computer Vison에 적용된 PPGN(Plug & Play Generative Networks)에 영감을 얻어 접근함.r  Controllable generation : 𝑝(x | a)  X : 생성된 샘플, a : 목표로 하는 Attribute  Generative model : 𝑝(x)  조건에 맞는 생성을 하기 어렵다!  Discriminator를 추가하였다. -> 𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x) 가능도(likelihood) 사전 분포 (prior distribution) 사후 분포(posterior) Hyper parameter를 이용하여 가능도를 조절한다.
  • 8. Kyonggi Univ. AI Lab. 접근 기반  정리
  • 9. Kyonggi Univ. AI Lab. PPLM
  • 10. Kyonggi Univ. AI Lab. PPLM  PPLM의 핵심 포인트들!  Transformer를 이용한 언어 모델  Generation을 목적에 맞게 제어함(Steering Generation)  생성 언어의 유창성을 보증함(Ensuring Fluency)  업데이트 방향
  • 11. Kyonggi Univ. AI Lab. PPLM  Transformer를 이용한 언어 모델  이전 단어들 순서를 입력 받아 다음 단어 예측함  Transformer 기반의 언어 모델  Query, key, Value를 이용하는 Attention 기법을 통해 다음 단어를 예측한다.  Query : 바로 이전 단어 + 현재 포지션 값  Key , value : 이전에 나온 모든 단어들! History 정보
  • 12. Kyonggi Univ. AI Lab. PPLM  Generation을 목적에 맞게 제어함(Steering Generation) : Latent updates 𝛼 값을 적절히 세팅 해야 한다. 매 스텝 마다 진행하면 안되고 처음 20 스텝만 이 과정을 진행한다.
  • 13. Kyonggi Univ. AI Lab. PPLM  Steering Generation  α 값에 따른 결과 비교  0.0001 : 첫 문장이 과학과 관련이 없다.  0.001 : 감자의 사용처 등 과학과 관련 없는 내용이 대부분이다.  0.005 : 마찬가지로 과학과 관련 없는 문장이다  0.01 : 감자에 관련 과학적인 연구 결과를 서술하였다. dk 값이 증가 할 수록 과학에 맞는 서술 함을 알 수 있다. 만약 α 계속 커지면 어떻게 될까?
  • 14. Kyonggi Univ. AI Lab. PPLM  α 값에 따른 결과 비교  0.02 ~ 0.04 : 이런 경우도 과학과 관련 있 는 서술을 하였다.  그러나 그 이상은 완전 엉뚱한 결과를 서 술한다. 따라서 적절한α 값을 설정해야 한다. ! α -> 0.01, 0.02, 0.03 정도로 설정!
  • 15. Kyonggi Univ. AI Lab. PPLM  Latent updates횟수에 따른 결과  적당한 α 값을 설정하여도 매 스 텝마다 Latent update를 수행하면 오히려 문장이 퇴화한다. 매 스텝 처음 20 스텝 매 스텝 마다 진행하면 안되고 처음 20 스텝만 이 과정을 진행한다.
  • 16. Kyonggi Univ. AI Lab. PPLM  생성 언어의 유창성을 보증함(Ensuring Fluency)  KL-Divergence  업데이트 전 후로 생성된 결과의 분포가 최소화 되도록 함.  𝜆𝐾𝐿이 0.01 일 때 최적이었다.  Post-norm Geometric Mean Fusion  학습에 영향은 없다  업데이트 전후의 결과 기반으로 산출된 다음 단어의 확률을 적절히 조합한다.
  • 17. Kyonggi Univ. AI Lab. PPLM  업데이트 방향
  • 18. Kyonggi Univ. AI Lab. BAG OF WORD
  • 19. Kyonggi Univ. AI Lab. Bag of word  단어 가방을 뜻한다.  ex)  Fantasy/Magic  beast, Cerberus, demon, dragon, fairy, Frankenstein, ghost, Godzilla, giant, horror, hydra, imp, monster, mummy, ogre, orc, savage, spirit, sprite, titan, troll, undead, unicorn, vampire, witch, zombie  Space  planet, galaxy, space, universe, orbit, spacecraft, earth, moon, comet, star, astronaut, aerospace, asteroid, spaceship, starship, galactic, satellite, meteor  𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x) 단어 가방의 모든 단어들에 대한 분포를 이용한다.
  • 20. Kyonggi Univ. AI Lab. Bag of word  다음과 같이 설정 가능하다.  Science를 적용한다.  Science와 legal를 적용한다.
  • 21. Kyonggi Univ. AI Lab. DISCRIMINATOR
  • 22. Kyonggi Univ. AI Lab. DISCRIMINATOR  Bag of word 대신에 레이어 1개의 신경망으로 사용한다.  𝑝(x | a) ∝ 𝑝(a | x) 𝑝(x)  이 신경망의 경우 data set을 이용하여 따로 학습을 진행한다.  단 기존 GPT-2 모델은 건드리지 않는다. 신경망으로 사용! 0 1 2 3 4 positive negative very positive very negative neutral SST-5 Data set
  • 23. Kyonggi Univ. AI Lab. HYPERPARAMETERS 설정 가이드
  • 24. Kyonggi Univ. AI Lab. hyperparameters 설정 가이드  hyperparameters 설정 가이드  반복되는 문구가 자주 등장하는 경우  (For e.g. "science science experiment experiment")  α 값을 감소 시킨다.  KL_scale을 증가 시킨다.  방법에 따른 설정 가이드 결국 최적의 조합을 찾아야 한다.
  • 25. Kyonggi Univ. AI Lab. 수행 결과들
  • 26. Kyonggi Univ. AI Lab. 수행 결과들  story generation 설정한 문구에 맞게 story가 생성 되었다.
  • 27. Kyonggi Univ. AI Lab. 수행 결과들  다수의 Bag of word 인 경우
  • 28. Kyonggi Univ. AI Lab. 수행 결과들  동일 Bag of word일때 접두어별 대응 막상 해석을 해보면 어색한 부분이 많다
  • 29. Kyonggi Univ. AI Lab. 수행 결과들  직접 수행해본 결과  Korean Air – legal  교정 전  Korean Air has announced that it will be offering a new service called "Korean Air Pass" to its customers starting in January. The service will allow customers to fly on Korean Air flights from any airport in the world, including Los Angeles International Airport, New York's JFK Airport, and London's Heathrow Airport. The service will be available to all Korean Air customers who have a Korean Air Pass. The service will be available for a limited time, and will be available for a limited time only.  교정 후  Korean Air has announced that it will be offering a free flight to the United States for all passengers who have booked a ticket for the upcoming Korean Air KIA World Tour. The free flight will be available from the beginning of April, and will be available to all passengers who have booked a ticket for the Korean Air KIA World Tour
  • 30. Kyonggi Univ. AI Lab. 수행 결과들  직접 수행해본 결과  Korean Air – science  교정 전  Korean Air has announced that it will be offering a new service called "Korean Air Pass" to its customers starting in January. The service will allow customers to fly on Korean Air flights from any airport in the world, including Los Angeles International Airport, New York's JFK Airport, and London's Heathrow Airport. The service will be available to all Korean Air customers who have a Korean Air Pass. The service will be available for a limited time, and will be available for a limited time only.  교정 후  Korean Air is planning to launch a new service in the coming months, which will allow passengers to book flights from Seoul to other cities in South Korea. The service, called "Korean Air Express," will allow passengers to book flights from Seoul to other cities in South Korea, including Seoul, Busan, and Gwangju. The service will be launched in the coming months, according to a statement from Korean Air. The service will be available from the beginning of the year, …..
  • 31. Kyonggi Univ. AI Lab. 수행 결과들  직접 수행해본 결과  Korean Air – Positive words  교정 전  Korean Air has announced that it will be offering a new service called "Korean Air Pass" to its customers starting in January. The service will allow customers to fly on Korean Air flights from any airport in the world, including Los Angeles International Airport, New York's JFK Airport, and London's Heathrow Airport. The service will be available to all Korean Air customers who have a Korean Air Pass. The service will be available for a limited time, and will be available for a limited time only.  교정 후  Korean Air is the only airline in the world that offers free Wi-Fi on all flights. The airline has been offering free Wi-Fi on all flights since the beginning of its service in 2012. The Wi-Fi is available on all seats, including the first class cabin.
  • 32. Kyonggi Univ. AI Lab. 결론
  • 33. Kyonggi Univ. AI Lab. 결론  기존의 GPT-2 모델을 이용하여 원하는 방향으로 문장 생성이 가능하다  Latent update를 통하여 조절 가능하다.  또한 Fluency도 개선 하였다.  단 일부 하이퍼 파라미터를 적절한 값으로 설정 해야 한다.  Latent update를 처음 20스텝 정도만 진행한다.  α -> 0.01, 0.02, 0.03 정도로 설정하여 사용한다.  bag of word 혹은 DISCRIMINATOR중 상황에 맞는 방법을 사용해야 한다.  bag of word의 경우 원리는 간단 하나 많은 단어를 넣어야 한다.  DISCRIMINATOR의 경우는 학습에 소요시간이 크지만 성능은 bag of word 보다 좋은 편이다.