Fine-Tuning LLMs: Best Practices and When to Go Small // Mark Kim-Huang // MLOps Meetup #124
MLOps.community
@mlopsAbout
The MLOps Community fills the swiftly growing need to share real-world Machine Learning Operations best practices from engineers in the field. While MLOps shares a lot of ground with DevOps, the differences are as big as the similarities. We needed a community laser-focused on solving the unique challenges we deal with every day building production AI/ML pipelines. We’re in this together. Come learn with us in a community open to everyone. Share knowledge. Ask questions. Get answers. Join us every week for a live virtual meetup, Wednesdays at 5 PM UK, 9 AM PT, where top experts share what they’ve learned running pipelines for organizations bigs and small. You can also check out our Slack that’s filled with tips and tricks to overcoming the common obstacles we’ve all hit in the real world. Find the solutions you need. Share, learn, and grow with us, as we work to bring standardization to the chaotic world of ML.
Latest Posts
Video Description
MLOps Community Meetup #123! Two weeks ago, we talked to Mark Kim-Huang, Co-Founder, Head of AI at Preemo Inc. //Abstract With the open source releasing foundational models at a blistering pace there has never been a better time to develop an AI-powered product. In this talk, we walk you through the challenges and state-of-the-art techniques that can help you fine-tune your own LLMs. Additionally, we will provide guidance on how to determine when a small model would be more appropriate for your use case. // Bio Mark is a co-founder and Head of AI at Preemo, a platform that helps companies build custom AI applications by making it extremely easy to fine-tune foundational models and deploy them into production. He has been a tech lead in machine learning teams at Splunk and Box developing and deploying production systems for streaming analytics, personalization, and forecasting. Previously in another life, he was also an algorithmic trader at quantitative hedge funds. // Jobs board https://mlops.pallet.xyz/jobs // Related links Website: https://www.preemo.io/ Presentation slides: https://docs.google.com/presentation/d/1PdGhrLViHu4r0Qs6RZz-qTF1xlUQvilGrAFc8i2OeRU/edit?usp=sharing LLMs in Production Conference Part 2 (June 15-16) Registration: https://home.mlops.community/home/events/llm-in-prod-part-ii-2023-06-20 ----------- ✌️Connect With Us ✌️------------- Join our Slack community: https://go.mlops.community/slack Follow us on Twitter: @mlopscommunity Sign up for the next meetup: https://go.mlops.community/register Catch all episodes, Feature Store, Machine Learning Monitoring, and Blogs: https://mlops.community/ Connect with Demetrios on LinkedIn: https://www.linkedin.com/in/dpbrinkm/ Connect with Ben on LinkedIn: https://www.linkedin.com/in/ben-epstein/ Connect with Mark on LinkedIn: https://www.linkedin.com/in/markhng525/ Timestamps: [00:00] Introduction to Mark Kim-Huang [00:39] Join the LLMs in Production Conference Part 2 on June 15-16! [01:32] Fine-Tuning LLMs: Best Practices and When to Go Small [02:31] Model approaches [05:09] You might think that you could just use OpenAI but only older base models are available [06:10] Why custom LLMs over closed source models? [08:24] Small models work well for simple tasks [09:51] Types of Fine-Tuning [11:06] Strategies for improving fine-tuning performance [11:24] Challenges [13:18] Define your task [13:26] Task framework [14:47] Defining task(s) [15:39] Clustering task diversifies training data and improves out-of-domain performance [16:45] Prompt engineering [17:05] Constructing a prompt [19:23] Synthesize more data [20:50] Constructing a prompt [23:09] Increase fine-tuning efficiency with LoRa [23:51] Naive data parallelism with mixed precision is inefficient [26:13] Further reading on mixed precision [26:40] Parameter efficient fine-tuning with LoRa [33:12] LoRa Data Parallel with Mixed Precision [34:44] Summary [36:20] Q&A [36:44] Mark's journey to LLMs [38:47] Task clustering mixing with existing data sets [40:13] LangChain Auto Evaluator evaluating LLMs [42:26] Cloud platforms costs [45:00] Vector database used at Preemo [46:55] Finding a reasoning path of a model on Prompting [51:40] When to fine-tune versus prompting with a context window [53:20] Wrap up
Upgrade Your Everyday
AI-recommended products based on this video

Kasa Smart Outdoor Smart Plug by TP-Link (KP400) - Smart WiFi Outlet with 2 Sockets, IP64 Waterproof, Works with Alexa and Google Home, 2.4GHz WiFi Required, No Hub Required, Sunset & Sunrise Offset

Wireless Earbuds, Bluetooth 5.4 Headphones in Ear with 4 ENC Noise Cancelling Mic, in Ear Earphones 40H, IP7 Waterproof, Bluetooth Ear Buds for Sports, Gym, Workout, USB C, White

Wireless Earbuds, Bluetooth 5.4 Headphones in Ear with 4 ENC Noise Cancelling Mic, in Ear Earphones 40H, IP7 Waterproof, USB C, Bluetooth Ear Buds for Sports, Gym, Workout, Rose Pink

Wireless Earbuds, Bluetooth 5.4 Headphones in Ear with 4 ENC Noise Cancelling Mic, in Ear Earphones 40H, IP7 Waterproof, USB C, Bluetooth Ear Buds for Sports, Gym, Workout, Black

Fvyao Sleep Earbuds, Mini Wireless Earbuds in Ear, Sleep Headphones Design for Side Sleeper, 24H Bass Stereo, Bluetooth 5.4, with ENC Noise Cancelling, IPX6 Waterproof Ear Buds for Android iOS

Brita Stainless Steel Premium Filtering Water Bottle, BPA-Free, Reusable, Insulated, Replaces 300 Plastic Water Bottles, Filter Lasts 2 Months or 40 Gallons, Includes 1 Filter, Carbon - 20 oz.

Simple Modern Filtered Water Bottle | Insulated Stainless-Steel Carbon Filter Travel Water Bottles | Reusable for Clean Drinking Water On The Go | 24oz, Sea Glass Sage

Motivaris Fitness Tracker Health Watch, 1.47" Step Counter with 24/7 Heart Rate Blood Oxygen Sleep Monitor, 3ATM Waterproof Smart Watch for Women Men, Pedometer Black

FITVII Health & Fitness Tracker (Answer/Make Calls), Smart Watch with 24/7 Heart Rate and Blood Pressure, Sleep Tracking Monitor, 120+ Sport Mode Activity Tracker

AYATAHA AYATAHA Smart Watch for Kids, Smartwatch Fitness Tracker for Boys Girls, Children's Activity Watch 37 Sports Modes SMS Notification, HD Full Touchscreen IP67 Waterproof, Blue

Iaret Iaret Smart Watch for Women, 1.83" HD Fitness Tracker with 4 Bands, Answer/Make Calls, Heart Rate/Sleep/SpO2/Step Tracking, 100+ Sport Modes, Android/iPhone Compatible Gift (Rose Gold)

Hand Warmers 2 Pack, 14000mAh Rechargeable Hand Warmers, Electric Hand Warmer Reusable, Portable Power Bank USB Hand Warmers 4 Levels 8 Heating, Gifts for Raynauds Ski Golf Camping

Hand Warmers Rechargeable, 10000mAh Electric Heated Gloves Power Bank Portable Graphene Handwarmers Pouch with 3 Levels & Double-Sided Heating for Hunting Camping Golf Xmas Gifts for Women Men Kids

2Pack Rechargeable Hand Warmer, 8000mAh Electric Hand Warmer Power Bank, Portable USB-C Hand Warmer for Pocket, Reusable Hand Warmer Up to 8 hrs Each, Warm Gift for Men Women, for Hunting, Camping

GTOCE Portable Charger,40000mAh Power Bank with 22.5W Fast Charging LED Digital Display Battery Pack with 6 Outputs 2 Inputs, Type C Powerbank Portable Charger for iPhone 16 pro Samsung AirPods,Black

Monster Sleep Ear200, Wireless in-Ear Headphones, Bluetooth 6.0 Sleep Headphones, with ANC Active Noise Cancellation Designed for Side Sleepers, 30 Hours of bass Stereo Sound.

Fvyao Sleep Earbuds, Mini Wireless Earbuds in Ear, Sleep Headphones Design for Side Sleeper, 24H Bass Stereo, Bluetooth 5.4, with ENC Noise Cancelling, IPX6 Waterproof Ear Buds for Android iOS

Monster Sleep Ear100 Ear Buds, Sleep Earbuds with Stereo Sound, Design for Side Sleeper, 32H Playtime, Bluetooth 6.0, ENC Noise Cancelling, IPX6 Waterproof Mini Headphones, White

Monster Sleep Ear100 Ear Buds, Sleep Earbuds with Stereo Sound, Design for Side Sleeper, 32H Playtime, Bluetooth 6.0, ENC Noise Cancelling, IPX6 Waterproof Mini Headphones, Black

Hydroponics Growing System Indoor Garden - Herb Garden with Grow Light, 15 Pods Stainless Steel Indoor Garden Kit, Auto Timer, Gardening Gift for All Ages

Umbra Triflora Hanging Planter for Window, Indoor Herb Garden, Set of 5, White/Black

Large Hydroponics Growing System 14 Pods, Indoor Herb Garden with LED Grow Light, 5L Water Tank, Hydroponic Grow Kit with 3 Auto-Timers, Rotatable Light Panel and Child Lock for Home School Gardening

Hanging Planter Hanging Plant Holder, 6 Inch 4 Indoor Plant Pots, Wall/Window Plant Hanger Indoor Herb Garden

slopehill Multi Hair Stylers & Hair Straightener - 2 in 1 Wet to Dry Air Straightener and Hair Dryer Combo with High Speed Air + Rapid Heat-Up + Customizable Temperature(Pink)

Hi.FANCY Portable Laptop Stand with Dual Cooling Fans for 14-17inch Laptops, Grey, 23.5 x 25.9 x 0.95cm

Laptop Stand for Desk, Adjustable Laptop Riser ABS+Silicone Foldable Portable Laptop Holder, Ventilated Cooling Notebook Stand for 10-15.6” Laptops,Tablet-Black

JETech 5 in 1 Case for Samsung Galaxy S25 Ultra 5G with 2-Pack Each Tempered Glass Screen Protector and Camera Lens Protector, Non-Yellowing Shockproof Bumper Phone Cover (Clear)

TAURI for iPhone 17 Pro Max Case 6.9" with 1-Pack Screen Protector, Camera Lens Full Protection, Military-Grade Protection, Shockproof Transparent Back Bumper Phone Cover - Clear Global Recycled Standard

TAURI for iPhone 17 Pro Case 6.3" with 1-Pack Screen Protector, Camera Lens Full Protection, Military-Grade Protection, Shockproof Transparent Back Bumper Phone Cover - Clear Global Recycled Standard

JOINPAYA 1Set Rechargeable Hand Warmer Hand Heater for Winter Heating Levels Compact

Shakven Rechargeable Hand Warmer | Cute Comfortable Portable Hand Warmers,Ergonomic Adjustable Energy-Efficient Small Heater for Travel, Outdoor, Winter

OCOOPA IP45 Waterproof Hand Warmer Rechargeable, Up to 15hrs Heat,10000mAh Durable Quick Charge Electric Hand Heater, PD Compatible, 3 Levels for Outdoors, Heavy Duty, H01-PD PRO




![Build a Slack Agent with Pydantic AI [Step-by-Step Tutorial]](https://imgz.pc97.com/?width=500&fit=cover&image=https://i.ytimg.com/vi/fYpCcJWR-GE/hqdefault.jpg)

