Model Distillation: Same LLM Power but 3240x Smaller
Adam Lucek
@adamlucekAbout
teach them to long for the endless immensity of the sea For inquiries, refer to the email in my links section.
Latest Posts
Video Description
Foundation model performance at a fraction of the cost- model distillation is a powerful technique to leverage the advanced generation capabilities of foundation models like Llama 3.1 405B, GPT-4, or Claude Opus as teachers, distilling their knowledge and performance on a given task to a student model. The result is a task-specific lightweight language model that provides the same performance, capability, or style as the foundation model without all the extra parameters. In this video we demonstrate this by using Llama 3.1 405B to perform sentiment analysis on a dataset of tweets, and use that generated dataset to train RoBERTa, a 125 million parameter model, to perform with the same accuracy on tweet sentiment classification tasks. Comparable performance using a model 3240 times smaller! Resources: Code: https://github.com/ALucek/LLM-distillation-guide Llama 3.1 405B Tweet Dataset: https://huggingface.co/datasets/AdamLucek/twittersentiment-llama-3.1-405B-labels Distilled Model: https://huggingface.co/AdamLucek/roberta-llama3.1405B-twitter-sentiment Moritz Laurer Blog: https://huggingface.co/blog/synthetic-data-save-costs AutoTrain: https://huggingface.co/autotrain A Survey on Knowledge Distillation of Large Language Models: https://arxiv.org/pdf/2402.13116 Chapters: 00:00 - Intro 01:11 - Model Distillation Trend 04:49 - Use Case: Instruction Following 05:45 - Use Case: Multi-Turn Dialogue 06:17 - Use Case: Retrieval Augmented Generation 06:59 - Use Case: Tool & Function Calling 07:52 - Use Case: Text Annotation 08:16 - Code: Distilling Llama 3.1 405B Overview 09:32 - Code: Initializing Tweet Dataset 10:57 - Code: Setting Up LLM & Annotation Prompt 15:10 - Code: Creating Annotated Dataset 17:25 - Training: RoBERTa & AutoTrain 18:30 - Training: Setting up AutoTrain Environment 19:02 - Training: Running Training Job on RoBERTa 21:42 - Evaluate: Using our Fine Tuned RoBERTa Model 22:23 - Evaluate: Visualizing Accuracy 23:37 - Evaluate: Visualizing Label Distribution 24:14 - Evaluate: Cost & Time Considerations 24:49 - Outro #machinelearning #ai #coding
Master Model Distillation Today
AI-recommended products based on this video

2026 New Embroidery Stitch Book Kit, Stitch Book Embroidery, All-in-One Embroidey StitchBook & Sewing Kit, Comes with a Complete Toolkit and Instructional Tutorial (1set)

EZDIY-FAB RTX 3000 Series 12 Pin to Dual 8 Pin PCIe Sleeved Extension Cable 300 MM- Connector for NVIDIA Ampere GEFORCE RTX 3060ti 3070 3080 FE Funder Edition- White

Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

NEXPOW Car Jump Starter,Car Battery Jump Starter Pack 1500A Peak Q10S for Up to 7.0L Gas and 5.5L Diesel Engine12V Auto Battery Booster,Jumper Cables,Portable Lithium Jump Box with LED Light/USB QC3.0

Firefly Variety 8 Pack - Fire Starter Accessory for Swiss Army Victorinox Knives (Neon Green-Yellow Glow)

9-in-1 5000A 150PSI Car Battery Booster Jump Starter with Air Compressor (All Gas/9L Diesel), Portable Car Battery Booster Pack, Safe Durable Car Jump Starter with Extended Jumper Cables, Glove, Light

BOSGAME P3 Mini PC Desktop, AMD Ryzen 9 6900HX, 32GB DDR5, 1TB PCIe 4.0 SSD, Dual LAN 2.5G/Wi-Fi 6E/BT5.2, 4K Triple Display, Micro Gaming Computer for Gaming, Office, Design

BOSGAME P3 Mini Gaming PC, AMD Ryzen 9 6900HX, 16GB DDR5, 512GB PCIe 4.0 SSD, Dual LAN 2.5G/Wi-Fi 6E/BT5.2, 4K Triple Display, Micro Desktop PC for Gaming, Office, Design

ASUS ROG Strix G16 Gaming Laptop, GeForce RTX 5070 Ti 12GB GDDR7, AMD Ryzen 9 8940HX, 64GB DDR5, 2TB SSD, Backlit Keyboard, Wi-Fi 6E, 16" WUXGA 165Hz Display, Win 11, Gray, 1TB Docking Station Set

Lenovo Legion Pro 5 16" WQXGA 165Hz Gaming Laptop, AMD Ryzen 9 9955HX, GeForce RTX 5070, 32GB DDR5, 3TB Storage (2TB SSD+1TB Docking Station Set), 24-Zone RGB Backlit Keyboard, WiFi 7, Win 11, Black

Crucial 64GB DDR5 RAM, 5600MHz (or 5200MHz or 4800MHz) Desktop Memory Kit, UDIMM 288-Pin, Compatible with 13th Gen Intel Core and AMD Ryzen 7000 - CT2K32G56C46U5

Western Digital 4TB Elements Desktop External Hard Drive, USB 3.0 external hard drive for plug-and-play storage - WDBWLG0040HBK-NESN

Western Digital 4TB My Book Desktop External Hard Drive, USB 3.0, External HDD with Password Protection and Backup Software - WDBBGB0040HBK-NESN

Western Digital 4TB My Passport Portable External Hard Drive HDD, USB 3.0, USB 2.0 Compatible, Black - WDBPKJ0040BBK-WESN




