Here is an underrated machine learning technique that will give you important information about your data and model.
Let's talk about learning curves.
Grab your ☕️ and let's do this thing!
🧵👇
Start by creating a model. Something simple. You are still exploring what works and what doesn't, so don't get fancy yet.
We are now going to plot the loss (model error) vs. the training dataset size. This will help us answer the following questions:
▫️ Do we need more data?
▫️ Do we have a bias problem?
▫️ Do we have a variance problem?
▫️ What's the ideal picture?
▫️ Do we need more data?
As you increase the training size, if both curves converge towards each other and stop improving, you don't need more data.
If there's room for them to continue closing the gap, then more data should help.
This one should be self-explanatory: if our errors stopped improving after adding more data, it's unlikely that more of it will do any good.
But if we still see the loss improving, more data should help push it even lower.
▫️ Do we have a bias problem?
If the training error is too high, we have a high bias problem.
Also, if the validation error is too high, we have a problem with the bias —either low or high bias.
A high bias indicates that our model is not powerful enough to learn the data. This is why our training error is high.
If the training error is low, that's a good thing: our model can fit the data.
High validation error indicates that our model is not performing well on the validation data. We probably have a bias problem.
To know in which direction, we need to look at the training error to decide.
▫️ Low training error: low bias
▫️ High training error: high bias
▫️ Do we have a variance problem?
If there's a big gap between the training error and the validation error, we have high variance.
A low training error also indicates that we have high variance.
High variance indicates that the model fits the data too well (probably memorizing it.)
When testing with the validation set, we should see the big gap indicating that the model did great with the training set, but sucked with the validation set.
A couple more important points:
▫️ High bias + low variance: we are underfitting.
▫️ High variance + low bias: we are overfitting.
▫️ What's the ideal picture?
These are the curves that you should be looking forward to getting.
Training and validation error converged both to a low error.
Here is another chart that does an excellent job at explaining bias and variance.
You want low bias + low variance, but keep in mind there's always a tradeoff between them: you need to find a good enough balance for your specific use case.
If these threads help, then make sure to follow me, and you won't be disappointed.
And for even more in-depth machine learning stories, make sure you head over digest.underfitted.io. The first issue coming this Friday!
🐍
Here is a quick guide that will help you dealing with overfitting and underfitting:
GPT-4o is slower than Flash, more expensive, chatty, and very stubborn (it doesn't like to stick to my prompts).
Next week, I'll post a step-by-step video on how to build this.
The first request takes longer (warming up), but things work faster from that point.
Few opportunities to improve this:
1. Stream answers from the model (instead of waiting for the full answer.)
2. Add the ability to interrupt the assistant.
3. Whisper running on GPU
Unfortunately, no local modal supports text+images (as far as I know,) so I'm stuck running online models.
The TTS API (synthesizing text to audio) can also be replaced by a local version. I tried, but the available voices suck (too robotic), so I kept OpenAI's.
I’m so sorry about anyone who bought the rabbit r1.
It’s not just that the product is non-functional (as we learned from all the reviews), the real problem is that the whole thing seems to be a lie.
None of what they pitched exists or functions the way they said.
They sold the world on a Large Action Model (LAM), an intelligent AI model that would understand applications and execute the actions requested by the user.
In reality, they are using Playwright, a web automation tool.
No AI. Just dumb, click-around, hard-coded scripts.
Their foundational AI model is just ChatGPT + scripts.
Rabbit’s founder lied on their marketing videos, during interviews, when he presented the product, and lied on Discord when answering questions from early supporters.
1. Mojo 🔥 went open-source 2. Claude 3 beats GPT-4 3. $100B supercomputer from MSFT and OpenAI 4. Andrew Ng and Harrison Chase discussed AI Agents 5. Karpathy talked about the future of AI
...
And more.
Here is everything that will keep you up at night:
Mojo 🔥, the programming language that turns Python into a beast, went open-source.
This is a huge step and great news for the Python and AI communities!
With Mojo 🔥 you can write Python code or scale all the way down to metal code. It's fast!