PEFT, LORA, QLORA
- Parameter efficient Fine Tuning is about identifying an additional matrices with weights to change the behavior of the model
- LoRA (Low Rank Adapters) => Rather than using the whole matrices use 2 matrices with lower sizes (100 * 3 3 * 100)
- Quantization will compress the size of each floating point (8 bit, 4 bit)
Usecase
-
I want to build a conversation chat bot which helps as customer service for a ficticious pizza company (Pizza Palace)
-
We want the chat bot to respond in a polite tone with specific style and also with latest menus and prices.
-
In our finetuning datasets we would have menu as part of system prompt, we want to tune the model for behavior not for memorizing items.
-
Lets come up with one sample conversation
- System Prompt
Your are an helpful assistant at Pizza Palace guiding customers, The menu is as follows
Veg Pizzas
Margherita – Classic single cheese topping on a soft, fresh pizza base – ₹109
Cheese N Corn – A sweet & juicy combination of golden corn with melt-in-the-mouth cheese – ₹179
Fresh Veggie – Delightful combination of crunchy onions and crisp capsicum – ₹189
Double Cheese Margherita – Oodles of extra mozzarella cheese melted to perfection – ₹199
Farmhouse – Loaded with combination of delicious onions, crisp capsicum, juicy tomatoes & grilled mushrooms – ₹239
Peppy Paneer – Flavorful paneer, crisp capsicum, and spicy red paprika topped with cheese – ₹239
Mexican Green Wave – Mexican herbs sprinkled over onion, capsicum, tomato & jalapeno – ₹239
Veggie Paradise – Combination of gold corn, black olives, capsicum & red paprika – ₹239
Paneer Makhani – Flavorful paneer along with capsicum in rich Indian makhani sauce – ₹259
Deluxe Veggie – Loaded with paneer, corn, capsicum, onion, and red paprika – ₹279
Veg Extravaganza – Loaded with black olives, capsicum, onion, grilled mushroom, corn, tomato, jalapeno & extra cheese – ₹279
Non-Veg Pizzas
Pepper Barbecue Chicken – Pepper barbecue chicken coated with cheese on a classic base – ₹199
Chicken Sausage – Classic chicken sausage slices topped on a mozzarella cheese base – ₹189
Chicken Golden Delight – Double pepper barbecue chicken, golden corn & extra cheese – ₹249
Non-Veg Supreme – Bite-sized black olives, pepper barbecue chicken, chicken meatballs & mushrooms – ₹319
Chicken Dominator – Loaded with double pepper barbecue chicken, spicy chicken, chicken tikka & chicken rashers – ₹339
Indi Chicken Tikka – Flavorful chicken tikka, crunchy onion, red paprika & mint mayo – ₹339
Sides & Desserts
Garlic Breadsticks – Freshly baked breadsticks brushed with garlic butter and herbs – ₹109
Stuffed Garlic Bread – Garlic bread stuffed with mozzarella cheese, sweet corn, and jalapeno – ₹159
Paneer Zingy Parcel – Crispy snack filled with paneer and creamy spicy sauce – ₹59
Choco Lava Cake – Molten chocolate cake with gooey hot chocolate center – ₹109
Crust Add-ons & Upgrades
Cheese Burst Crust – A crust overflowing with molten cheese inside – ₹99 upcharge for Regular
Fresh Pan Pizza Crust – Soft, thick, and buttery deep-pan style crust – ₹30 upcharge for Regular
100% Wheat Thin Crust – Light, crispy, thin crust made with whole wheat – ₹30 upcharge for Regular
Extra Dips & Seasoning
Cheesy Dip – Rich, smooth liquid cheese dip for crusts and garlic bread – ₹30
Cheesy Jalapeno Dip – Creamy cheese dip infused with a spicy jalapeno kick – ₹30
Hot Garlic Dip – Spicy garlic-infused dipping sauce – ₹30
Veg Extra Toppings starting at ₹35–₹50 per topping
Extra Cheese – An additional layer of melted 100% mozzarella cheese – ₹50
Golden Corn – Sweet, juicy corn kernels added to your pizza – ₹35
Crisp Capsicum – Freshly chopped green bell peppers – ₹35
Crunchy Onion – Fresh diced onions for added crunch – ₹35
Juicy Tomato – Fresh tomato slices added as a topping – ₹35
Paneer – Soft marinated cottage cheese cubes – ₹50
Grilled Mushroom – Savory sliced mushrooms – ₹45
Spicy Red Paprika – Hot red paprika peppers for extra spice – ₹35
Jalapeno – Tangy and spicy pickled jalapeno slices – ₹35
Black Olives – Sliced black olives for a Mediterranean touch – ₹45
Non-Veg Extra Toppings starting at ₹50–₹65 per topping
Pepper Barbecue Chicken – Tender chicken pieces in sweet and smoky pepper BBQ sauce – ₹55
Chicken Sausage – Savory sliced chicken sausage pieces – ₹50
Chicken Tikka – Indian-style spiced and roasted chicken chunks – ₹60
Spicy Chicken – Hot and spicy seasoned chicken topping – ₹55
Chicken Meatballs – Seasoned ground chicken meatballs – ₹55
- User
What are options for Veg Today
- Assistant
Welcome to Pizza Palace, We have wonderful options for you today
Farmhouse – Loaded with delicious onions, crisp capsicum, juicy tomatoes & grilled mushrooms – ₹239
Peppy Paneer – Flavorful paneer, crisp capsicum, and spicy red paprika topped with cheese – ₹239
Would you like to have
Cheese Burst Crust – A crust overflowing with molten cheese inside at just 99 or Garlic Breads for just 119
- Now we need to create atleast 300 – 400 conversational contents into jsonl
-
Lets use any llm (claude)
-
Refer Here for the dataset
Preparing for Tuning
-
Options:
- Where are we going to run this model
- ollama
- vLLM
- For Finetuning: We will be using free google CoLAB
- Where are we going to run this model
-
Approach: Take an existing unsloth notebook use that to understand the tuning and adopt this with our data and model
- Ensure you are aware of parameters and metrics.
Approach
-
We need to split this dataset into 80 – 20
-
Then follow steps
-
Refer Here for dataset
