53rd issue! If you missed them, you can read the previous issues of my monthly A.I. & Machine Learning newsletter here.
Hey there, Daniel here.
Iโm an A.I. & Machine Learning Engineer who also teaches the following beginner-friendly machine learning courses:
I also write regularly about A.I. and machine learning on my own blog as well as make videos on the topic on YouTube.
Since there's a lot going on, the utmost care has been taken to keep things to the point.
Enough about me! You're here for this month's A.I. & Machine Learning Monthly Newsletter.
Typically a 500ish (+/-1,000ish, usually +) word post detailing some of the most interesting things on machine learning I've found in the last month.
My brother and I have been working on a food and nutrition tracking/education app and we just released version 1.2.
This update includes being able to set custom calorie and macronutrient goals, simple breakdowns of whole food intakes and 57 new foods in the FoodVision AI model/Nutridex.
If you or someone you know wants to learn more about whole foods and track your nutrition intake, check out Nutrify on the iOS App Store.
New views and features available in Nutrify 1.2 โ create custom calorie intake goals or let Nutrify calculate them for you as well as get simple breakdowns of your whole food intake over time. Source: Nutrify 1.2 blog post.
This monthโs theme is: bringing LLMs into production.
A common trend Iโve seen with the following resources is that many of the previous problems with bringing ML models to production apply to LLMs.
This includes use cases, custom datasets, input optimization/data preprocessing (e.g. prompt engineering), latency and evaluations.
And so even though the capabilities of LLMs are continuing to be discovered and refined, many of the engineering steps around bringing them to production are similar to previous generations of machine learning models.
By Eugene Yan, Bryan Bischof, Charles Frye, Hamel Husain, Jason Liu and Shreya Shankar
Several researchers and practitioners from across the industry combine to give insights into what it takes to put LLM models into production.
The report is broken into three parts: tactical, operational and strategic.
Itโs filled with tried and tested advice such as:
One way to use an LLM to evaluate outputs/options is to do it so comparatively. For example, compare two examples and pick the best one. Source: What we learned from a year of building with LLMs (part 1).
Many of the points Iโve found work really well in practice during my own experimentation and usage of LLMs in production.
A highly recommended read for anyone looking to build LLM-powered applications.
If this was Part 1, Iโm looking forward to Part 2.
The LinkedIn team share their lessons learned from productionizing an LLM-powered system that can answer career-focused and job-focused questions.
Some important findings:
GoDaddy share 10 lessons deploying an LLM-based application to help with customer support channels which receive 60,000+ contacts per day.
Some of my favourites:
If you rely too much on one model for servicing your application, what happens if that model goes down? In an ideal world, another model is called upon to pick up. Source: GoDaddy blog.
Willem writes an excellent post about how many of the current problems with deploying and using LLMs are similar to previous problems with other kinds of machine learning models.
Some excerpts:
gpt-4-0125
and it performed well. But the latest update breaks a few of your tasks.The AWS team share details on how they fine-tuned a BLIP-2 model to generate fashion descriptions for a product image. This is a great way to enrich a website with metadata information on products which is helpful for search engines and search in general.
Thereโs also some great insights on the combination of using Hugging Face Transformers (for baseline models), Accelerate (for faster model training) and PEFT (parameter efficient fine-tuning for quicker model customization) in combination.
AWSโs example fine-tuning and deployment pipeline for a model which is capable of generating product descriptions given an image of an item of clothing. Source: AWS tech blog.
Philipp Schmid, Technical Lead at Hugging Face shares code examples and a walkthrough on fine-tuning your own LLM in 2024.
Inside youโll find:
For a recent concrete example, Iโd also recommend checking out Philโs article on how to fine-tune Google Gemma.
Heck, check out all of Philโs blog in general, itโs full of ML epicness.
Google and Salesforce have released two open-source deep learning based time series foundation models (what a mouthful!).
TimesFM by Google is a Transformer Decoder-only (similar to an LLM but for time series) trained on 100B time series points from a variety of sources. The model is 200M parameters so it can be run on quite small GPUs.
Despite its small size, the model performs very well in a zero-shot setting across a wide range of benchmarks, even against models which have been explicitly trained on the target data.
Code is available on GitHub and the TimesFM model is available on Hugging Face.
Moirai by Salesforce comes in 3 sizes, small (14M parameters), base (91M parameters) and large (311M parameters).
These models have been trained on 29B data points across 9 different domains including energy, transport, climate, sales, healthcare and more.
Code is available on GitHub and the dataset and models available on Hugging Face.
Example of the Marigold depth-estimation model. Source: Marigold Hugging Face demo.
Automatic Data Curation for Self-Supervised Learning: A Clustering-Based Approach
Researchers at Meta, INRIA, Universiteฬ Paris Saclay and Google show how to make highly-curated datasets automatically from large-scale datasets with hierarchical k-means clustering.
As in, you could take a large corpus of images from the internet of 1+ billion samples and then filter it down to the target domain youโre looking to work with, say 10+ million images of cars.
This highly curated dataset could then be used for self-supervised learning or supervised training.
See the code on GitHub.
Outline of hierarchical k-means filtering workflow for curating large-scale datasets into target datasets. Source: Automatic Data Curation for Self-Supervised Learning: A Clustering-Based Approach paper.
ODGEN: Domain-specific Object Detection Data Generation with Diffusion Models
Researchers at Apple show how you can fine-tune diffusion models to generate images with objects similar to your own dataset. Detection models trained with real and synthetic data received a boost of up to 25.3% mAP@.50:.95
.
Synthetic data has come a long way over the past few years. And this shows how itโs expanding to even more specific tasks such as object detection.
Qualitative example of Appleโs ODGEN method for generating data-specific items in bounding boxes. Source: Apple Machine Learning blog.
An Introduction to Vision-Language Modeling
Several researchers across many institutions such as Meta, Universitรฉ de Montrรฉal, McGill University, University of Toronto, MIT and more have collaborated to create a comprehensive introduction to Visual-Language Modeling (VLMs).
The introduction is designed to be a โstart hereโ for many of the concepts in VLMs such as different types of VLMs, how train VLMs, which VLM should you use?, evaluating VLMs, extending VLMs from images and text to videos and more.
If youโre looking to learn more about how LLMs can be bridged to vision data, this is an excellent place to start.
Vicky Boykis is one of my favourite voices in the world of machine learning. And her recent talk at PyCon Italia is filled with excellent advice. The main one being when thinking of building a feature with machine learning or AI, get closer to the metal (as the metal that your code is running on).
How?
How to stay closer to the Metal by Vicky Boykis. Get to the smallest possible piece you can and make it reproducible, then scale it up. Source: Vicky Boykis blog.
And start there.
Another great takeaway I enjoyed was the philosophy of Unix quote by Doug McIlroy, โMake each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new features.โ
Finally, what would you do if you had 1000 interns? Thatโs a way you can think of LLMs. Are there tasks youโd delegate to 1000 smart interns? Maybe theyโd be suitable for LLMs.
You can watch the full talk on YouTube (it starts at 8:25:16 in the video).
What a massive month for the ML world in May!
As always, let me know if there's anything you think should be included in a future post.
In the meantime, keep learning, keep creating, keep dancing.
See you next month,
Daniel
By the way, I'm also an instructor with Zero To Mastery Academy teaching people Machine Learning & AI in the most efficient way possible. You can see a few of our courses below or check out all Zero To Mastery courses.