SLM Fine-tuning: Top Results at 9.47% Cost
Speed up your MLOps learning experience. Build a feature pipeline for an H&M personalized recommender.
This weekโs topics:
Looking to speed up your MLOps learning experience?
Fine-tuning SLMs for top-tier results at a fraction of the cost
Build a feature pipeline for an H&M personalized recommender
Looking to speed up your MLOps learning experience?
Looking to speed up your MLOps learning experience? listen up...
Here is an excellent live course you can't miss.
Enters > The ๐๐ป๐ฑ-๐๐ผ-๐ฒ๐ป๐ฑ ๐ ๐๐ข๐ฝ๐ ๐๐ถ๐๐ต ๐๐ฎ๐๐ฎ๐ฏ๐ฟ๐ถ๐ฐ๐ธ๐ course
โ A live course on MLOps with Databricks that starts on the 27th of January.
The course is made and hosted by
and , the founders of .As their second iteration, it is already a bestseller on Maven with a 4.9 ๐ rating.
The No. 1 thing that makes this course stand outโฆ
โ Even if they use Databricks, they will focus on the MLOps principles while applying them to Databricks, which is pure gold!
I have known them for over a year, and I can genuinely say they are exceptional engineers and teachers. A rare combination!
That's why this course will pack tons of value.
It will walk you through an MLOps noobie to a pro:
MLOps principles and components
Developing in Python: best software development principles
From a notebook to production-ready code
Databricks asset bundles (DAB)
MLflow experiment tracking & registering models in Unity Catalog
Git branching strategy & Databricks environments
Model serving architectures
Setting up model evaluation pipeline
Data/model drift detection and lakehouse monitoring
.
This course is for:
ML and DS people who want to get into or level up in MLOps.
MLEs and platform engineers who want to master Databricks.
.
Ready to level up your MLOps game?
โ Next cohort starts January 27th
โ Get 10% off with code: PAUL
โ 100% company reimbursement eligible
Fine-tuning SLMs for top-tier results at a fraction of the cost
Fine-tuning small language models (SLMs) can give you top-tier results on specialized tasks at a fraction of the cost. Here is a step-by-step tutorial โ
Let's assume you want to use an LLM for specialized tasks such as classifying ticket requests or generating personalized emails from your private data.
A ๐ด๐ฒ๐ป๐ฒ๐ฟ๐ถ๐ฐ ๐น๐ฎ๐ฟ๐ด๐ฒ๐ฟ ๐๐๐ , such as Mistral large (>70B parameters), can do the job, but ๐๐ต๐ฒ ๐ฐ๐ผ๐๐๐ can quickly ๐ด๐ฒ๐ ๐ผ๐๐ ๐ผ๐ณ ๐ต๐ฎ๐ป๐ฑ.
You can try directly using ๐๐บ๐ฎ๐น๐น๐ฒ๐ฟ ๐๐๐ ๐, such as Mistral 7B, ๐๐ผ ๐ฟ๐ฒ๐ฑ๐๐ฐ๐ฒ ๐ฐ๐ผ๐๐๐ on these specific tasks, but now the problem is their ๐ฝ๐ฒ๐ฟ๐ณ๐ผ๐ฟ๐บ๐ฎ๐ป๐ฐ๐ฒ ๐ฑ๐ฟ๐ผ๐ฝ๐ ๐ฑ๐ฟ๐ฎ๐๐๐ถ๐ฐ๐ฎ๐น๐น๐.
We encountered the accuracy vs. costs trade-off.
But we don't have to... we can ๐ด๐ฒ๐ ๐๐ต๐ฒ ๐ฏ๐ฒ๐๐ ๐ผ๐ณ ๐ฏ๐ผ๐๐ต ๐๐ผ๐ฟ๐น๐ฑ๐.
๐ง๐ต๐ฒ ๐๐ผ๐น๐๐๐ถ๐ผ๐ป is to fine-tune smaller LLMs to specialize them for your task to achieve good accuracy at low prices.
Using a fully managed platform like Aparajith M., you can easily fine-tune open-source LLMs and automate your business operations.
๐๐ฆ๐ณ๐ฆ ๐ช๐ด ๐ข๐ฏ ๐ฆ๐ฏ๐ฅ-๐ต๐ฐ-๐ฆ๐ฏ๐ฅ ๐ด๐ฐ๐ญ๐ถ๐ต๐ช๐ฐ๐ฏ ๐ฐ๐ฏ ๐ฉ๐ฐ๐ธ ๐ต๐ฐ ๐ฅ๐ฐ ๐ช๐ต ๐ถ๐ด๐ช๐ฏ๐จ ๐ฌ๐ฏ๐ฐ๐ธ๐ญ๐ฆ๐ฅ๐จ๐ฆ ๐ฅ๐ช๐ด๐ต๐ช๐ญ๐ญ๐ข๐ต๐ช๐ฐ๐ฏ ๐ธ๐ช๐ต๐ฉ ๐๐ฏ๐ฐ๐ธ๐ง๐ญ๐ข๐ฌ๐ฆ:
1. Ingest raw data, such as PDFs, emails or user profiles, into a Snowflake table.
2. Clean the data into a different Snowflake table (schedule the data pipelines for data freshness).
3. Create a training instruct dataset by computing the labels (only once) using a larger LLM (mistral-large, Llama 3 70B) on Snowflake Cortex.
4. Using the instruct dataset, fine-tune the smaller LLM (mistral or Llama 7B) and store it in Snowflake's model registry. You can kick off serverless fine-tuning jobs on Cortex through their no-code interface or SQL.
The fine-tuned LLM is available for inference. For example:
5. Load the fine-tuned LLM as a serverless service using Snowflake Cortex. The LLM has fresh features as input available from the clean data collection.
6. Use it in a Streamlit app integrated into Snowflake.
7. Use it in a batch pipeline to process ticket requests or emails on a schedule.
8. The results are saved in Snowflake and consumed through a dashboard or by emailing the users.
This strategy can easily be extrapolated to any tooling.
By using a fully managed platform such as Snowflake, you can reduce your dev time from months to days, as you have no more headaches to:
- ingest and store your data at scale
- transform your data into training datasets
- run fine-tuning and inference jobs
Build a feature pipeline for an H&M personalized recommender
We just released the second lesson of our Hands-on H&M Real-Time Personalized Recommender course on feature pipelines that leverage MLOps best practices.
In this lesson, written by
, we dive deeper into building a feature pipeline for real-time personalized recommendations that tailor H&M product suggestions for users based on the following:Their preferences
Their behaviors.
If you're a:
Data scientist
ML engineer
Passionate about recommender systems
This is your chance to get hands-on experience with a cutting-edge project.
We used the Hopsworks AI Lakehouse to manage and operationalize the entire machine-learning lifecycle without worrying about infrastructure.
Here's what youโll learn in Lesson 2:
process the H&M dataset into recsys features
engineer features for both the two-tower network and ranking models
Use Hopsworks Feature Groups for solving the training-serving skew
lay the groundwork for future steps, such as integrating streaming pipelines to enable real-time data processing and recommendations.
Get started with Lesson 2 โ
Thank you
for this fantastic piece!Images
If not otherwise stated, all images are created by the author.