OpenThaiGPT
Latest Update: 29 July 2023
2023: Year of Generative AI
New AI Startup Start From �English LLM
English Language?
Date: Feb 2023
4,145 Models
How about Thai language?
14 Models
Date: Feb 2023
LLMs is foundation for AI Startup
OpenThaiGPT
OpenThaiGPT is a chat-based assistant focused on Thai language that understands tasks, can interact with third-party systems, and retrieve information dynamically.
It can be extended and personalized easily and is developed as free, open-source software.
Collaboration Founding Members
Vision
OpenThaiGPT is to contribute to the advancement of AI technology and its applications in Thailand, and to create a more inclusive and accessible digital environment for Thai language users.
Value Proposition
Building Block for Next Generation AI for Thailand
Open for everyone
Be able to integrate OpenThaiGPT into your application via API or downloadable package under the free and open source license.
Retrieval Knowledge via�Search Engine or External API��Be able to connect to External knowledge, Upgradable without retraining the billions of parameters.
Personalized Chat Assistant�
State-of-the-Art Chat-based Assistant priority on Thai language that can be customized and fine-tuned to all user needed.
OpenThaiGPT นำไปใช้ประโยชน์อะไรได้บ้าง
OpenThaiGPT
Smart Chatbot:
สามารถตอบคำถามใดๆ ตามเนื้อหา
ที่เจ้าของธุรกิจ หรือผู้ให้บริการใส่ความรู้ไว้ให้ได้ และเชื่อม API ไปดึงคำตอบมาได้
Decentralized AI: Building Block พื้นฐานสำคัญของ AI Startup ของไทย
เพราะเป็น Open Source ต่อยอดได้ ปรับแต่งได้ ใช้ทำ Commercial ได้จึง
ไม่มีค่าใช้จ่ายในการเรียกใช้
Finetuning เพื่อใช้ในงาน Generative ด้านอื่นๆ อาทิเช่น เขียนสัญญาทางกฎหมาย เขียนนิทาน ออกแบบละครต่างๆ เป็นต้น เป็นวัตถดิบหลักให้ก่อเกิด Startup AI ในไทย โดย สามารถ Host Model ได้ด้วยตัวเอง และไม่มีค่าบริการเรียกใช้
AGI Classifier: สามารถนำไปสร้างโมเดล AI Classifier แบบ AGI ได้ ด้วยความสามารถของ Few shot Learning โดยไม่ต้องใช้ Data จำนวนมหาศาลแบบ ANI
OpenThaiGPT Road Map
Q3 2023
Mainstream Release
+ Release the first production version of OpenThaiGPT and API.�+ Developing the knowledge retrieval from external source.�+ Allow for business to customization and personalization.
Q4 2023
Reflection
+ Evaluation�+ Quality Improvement�+ What will the Thai society want next?
Q1 2023
PoC
+ Release the PoC of OpenThaiGPT�+ Setup Data Labelling Website�+ PoC RL on Human Feedback (RLHF)�+ PoC of API release�
Q2 2023
Core Development
+ Pre-training the largest auto-gressive LM ever in Thai language.�+ Finetuning with Thai Instruct Dataset.�+ Tuning model with RLHF.
OpenThaiGPT Release Plan
GPT-2 Thai
120 million params
11 March 2023
Finetune: 1-3 Datasets
No RLHF
0.0.4
LLama v1
7,13 billion params
ก-ฮ Character Level Tokens
May 2023
Finetune: 10-20 Datasets
RLHF: Preliminary
0.1.0
Llama v2
7, 13 billion params
Thai Word-Level Tokens�10,000 words
16-17 August 2023
Finetune: 50+ Datasets
RLHF: Conclusived
1.0.0
Dr. Kobkrit Viriyayudhakorn
Dr. Prachya�Boonkwan
Dr. Sumeth�Yuenyong
First Thai Autoregressive�LLM!
First Thai 7b LLM!
8 X Faster than GPT-4 in Thais
Difference between OpenAI ChatGPT vs OpenThaiGPT
Demo (Version 1.0.0)
Version 1.0.0-alpha
Version 1.0.0-beta
Installation Package
1,000 downloads�over 1 month
How to use OpenThaiGPT?
How to use OpenThaiGPT
Zero?
Open Source on Github
18
Open Datasets
Open Training / �Finetuning Code
Open Model / Open Weight
Inference Consumption Needed
Model | fp-16 | 8bit | 4bit | 2bit |
OpenThaiGPT 7b | 16GB | 8GB | CPU OK | CPU OK |
OpenThaiGPT 13b | 32GB | 16GB | 8GB | CPU OK |
OpenThaiGPT 33b | 64GB | 32GB | 16GB | 8GB |
OpenThaiGPT 65b | 128GB | 64GB | 32 GB | 16 GB |
OpenThaiGPT 175b | 340GB | 170GB | 86GB | 44 GB |
VGA GeForce RTX 3090 Ti GAMING X TRIO 24GB GDDR6X 384-bit
34,500 THB (24GB)
NVIDIA Tesla A100 80G Deep Learning GPU Computing Graphics Card OEM Version�600,000 THB (80GB)
Number of parameters are not everything
OpenThaiGPT 7b �Quantized in 4bit model: Running on Macbook Air M2�
Volunteers
150+ persons
Teams
Pretraining�80+ persons�
Finetuning + RLHF
40+ persons
Collaboration + Safety Net + ETC�30+ persons�
Join us!
Appendix�Evaluations
Q: Evaluations on OpenThaiGPT #1
Full Results: https://docs.google.com/spreadsheets/d/1T85vDGDnmwvYDQLrXad5R-2hS55tkufVtUbJPOFe6GA/edit?usp=sharing
Version
Evaluation Dataset:
Q: Evaluations on OpenThaiGPT #2
*คะแนนยิ่งเยอะยิ่งดี
Appendix�Using OpenThaiGPT as Text Classifier
Q: OpenThaiGPT can be used as a text classifier?
A: Yes! It can be done in two ways!
Using temperature = 0 and logit_bias to scope down the choice.
Finetuning : No need
Supported only limited number of examples due to the limit of max input length.
(2) Finetuning
If the examples (training datasets) are large and complex, fine tuning is recommended.
Using the method (1) on the fine tuned SCBGPT weight, which will increase classification accuracy.
No Finetuning Need
Finetuning Need
(1) Fewshot Learning technique for text classification
Q: OpenThaiGPT can be used as a text classifier?
Settings
Advantage
Disadvantage
Setting the list of options into a whitelist.
Q: OpenThaiGPT can be used as a text classifier?
get_logit_bias([“pos”,“neu”,”neg”])
Method (2) Along with Method (1), Fine tuning the Model for Larger examples.
Q: OpenThaiGPT can be used as a text classifier?
Multiclass classification?
Q: OpenThaiGPT can be used as a text classifier?
Evaluating the Accuracy of GPT as a Classifier
Q: OpenThaiGPT can be used as a text classifier?
https://github.com/sh0416/llama-classification
Appendix�ChatGPT Development Steps
ChatGPT Development Steps
https://lifearchitect.ai/chatgpt/
GPT-3 Pretraining
Decoder-only�Transformers Architecture
Large Language�Corpus (~600 Billion tokens)
WebText2
Large Language Model�(LLM)
Pretraining
My name is Julien and I like to
My name is Julien and I like to use C#, which is all I really know. In the C# universe, I have two C# friends, Dan and Kevin. I have two boys. Dan is obsessed with C# and when
Gen
Instruct GPT Finetuning
Large Language Model�(LLM)
Fine Tuned LLM that can�follow instruction.
InstructGPT
13K Training Set Prompts
Why is it important to eat socks after meditating?
Gen
There is no clear answer to this question, but there are many theories and ideas that may explain the apparent need to eat socks after meditating. …
Finetuning
https://arxiv.org/abs/2203.02155
Reward Model (RM)
RM dataset has 33k training prompts
Classifier
RM Model
Classify
Training
https://arxiv.org/abs/2203.02155
Reinforcement Learning from Human Feedback (RLHF)
InstructGPT
RM Model�(Learned from Human Feedback)
Reinforcement Learning:�Proximal Policy
Optimization (PPO)
Adjust Gradient
Prompt�Input
Prompt�Output
31K Prompt for PPO�Training
Generated�Human Feedback
Quality Score : 1.0��Finetuning
Inference
Inference
https://arxiv.org/abs/2203.02155
https://arxiv.org/abs/2203.02155
ETC
OpenThaiGPT Consortium
OpenThaiGPT Consortium
Committees from AIEAT, AIAT, and external partnerships / sponsorships.
OpenThaiGPT Working Group
OpenThaiGPT Usage / Extension
Getting Start
Tasks & Resource Needs
Main Efforts
OpenThaiGPT
Backup Slides
OpenThaiGPT
OpenThaiGPT Volunteer Meet Up #1
2023-03-05
Thai GPT-2�(124 m)
Thai InstructGPT�7,000 Pairs
None
None
OpenThaiGPT�POC Model = 0.0.3
https://github.com/OpenThaiGPT/openthaigpt
OpenThaiGPT
Azure Opensource Day
Microsoft Cloud Squad
Global AI Bootcamp - Thailand
Next for OpenThaiGPT
Thai GPT-2
(124 m)
Thai InstructGPT�7,000 Pairs
None
None
OpenThaiGPT�POC 0.0.3
OpenThaiGPT�POC 0.0.4
Thai GPT-2
(124 m)
Thai InstructGPT�14,000 Pairs + 71 Tagged Dataset
Perplexity + ???
Thai Tweet Toxicity�+ ???
Thai GPT-2-base (124 million) = 0.0.X
Thai GPT-2
(124 m)
Thai InstructGPT�7,000 Pairs
None
None
OpenThaiGPT�POC 0.0.3
OpenThaiGPT�POC 0.1.0
mGPT�(1.5 b)
Thai InstructGPT�14,000 Pairs + 71 Tagged Dataset
Perplexity + ???
Thai Tweet Toxicity�+ ???
mGPT (1.5B) = 0.1.X
OpenThaiGPT - Zero
Thai Text GPT Checker
Coming soon