Building with Instruction-Tuned LLMs
A Step-by-Step Guide�by: Chris Alexiuk, and Greg Loughnane
A Motivating Example 🟠 🟢 ✈️!
Instruction
Identify the odd one out and explain your choice.
Input
Orange, Green, Airplane.
2
© 2023 FourthBrain
Identifying the odd one out 🟠 🟢 ✈️!
Instruction-Tuned Model
Response:
✈️ Airplane is the odd one out.
Explanation:
Non-Instruct-Tuned (Base) Model
Response:
🟠 Orange is the odd one out.
Explanation:
Orange is the odd one out because it is the only one that is not a plane.
3
© 2023 FourthBrain
Outline
4
LLM Context
Supervised Fine-Tuning, a.k.a Instruction-Tuning
D1: Instruction-Tuning
OpenLLaMA and Dolly15k with QLoRA
D2: Fine-Tuning Input/Output Schema
BLOOMZ with PEFT-LoRA
Conclusions
© 2023 FourthBrain
LLM Context
Generative Pre-Trained Transformers (GPTs)
Built on foundation of:�
6
© 2023 FourthBrain
Adapting Large Models (LLMs) to New Tasks
Zero-shot learning
Few-shot learning
Fine-Tuning
7
https://www.deeplearning.ai/the-batch/issue-198/
© 2023 FourthBrain
Prompting (a.k.a. Prompt Engineering)
Whether zero-shot or few-shot:�
8
A 3D visualization of latent space in the style of Salvador Dali
https://www.deeplearning.ai/the-batch/issue-197/
© 2023 FourthBrain
What task should our LLM have superpowers on?
Large Language Models
�Your Models & GenAI Apps
9
© 2023 FourthBrain
Instruction-Tuning vs. “Fine-Tuning”
Large Language Models
�Your Models & GenAI Apps
10
© 2023 FourthBrain
Instruction-Tuning (a.k.a. Instruct-Tuning)
Large Language Models
11
Instruction Tuning enhances Supervised Fine-Tuning!
https://openai.com/research/instruction-following
© 2023 FourthBrain
Instruction Tuning IS Fine-Tuning
�
12
All possible Fine-Tuning
Instruction-Tuning
© 2023 FourthBrain
Instruct-Tuning, Step-by-Step
Dolly 15k, OpenLLaMA, qLoRA
Dolly 15k Dataset
Categories of Instructions
14
© 2023 FourthBrain
OpenLLaMA
By OpenLM Research (UC Berkeley)
15
© 2023 FourthBrain
QLoRA: Efficient Fine-Tuning of Quantized LLMs
16
© 2023 FourthBrain
Let’s check it out!
Important Notes!
Training
�
Rule of Thumb, Instruct-Tuning
18
© 2023 FourthBrain
Recall…
Instruction-Tuning vs. “Fine-Tuning”
Large Language Models
�Your Models & GenAI Apps
20
© 2023 FourthBrain
Fine-Tuning the “Structure” or “Input-Output Schema”
Your Models & GenAI Apps
21
Vestibulum congue tempus
© 2023 FourthBrain
Fine-Tuning, Step-by-Step
BLOOMZ + PEFT-LoRA Fine-Tuning of an AI Marketing Assistant
© 2023 FourthBrain
© 2023 FourthBrain
Let’s check it out!
Important Notes!
Training
General Process, Fine-Tuning I/O Schema for single task superpowers
26
© 2023 FourthBrain
Conclusions
27
© 2023 FourthBrain
Shared Resources from today’s event!
© 2023 FourthBrain
Thanks! Questions?
29