Notes on machine learning
Technical notes written while learning: honest evaluation, data leakage, deployment, LLM applications and the mistakes behind each lesson. They come from the projects on this site, with the code one click away.

transformers.js, ONNX Runtime Web and tfjs: I benchmarked all three browser ML runtimes with real numbers
I built a benchmark to measure transformers.js, ONNX Runtime Web and tfjs running the same sentence-embedding task, plus an identical MLP on the two runtimes that can actually run it. WASM beat WebGPU on both tasks, tfjs's backend choice mattered more than which runtime I picked, and along the way I found a backend that would not even start by default on this machine.
Read article
BM25 versus embeddings: I added semantic search to my search (with real numbers)
I added an optional toggle to Ask that re-ranks BM25 results with MiniLM embeddings. Before turning it on by default I tried 15 real questions in both languages: it won clearly in 1, helped a little in 2, tied in 8, lost outright in 1, and both approaches missed in 3. This is the full count, not rounded up.
Read article
Papers, plainly: LoRA
The 2021 paper that made adapting giant models cheap fits in one idea: instead of touching every weight, learn a small low-rank shortcut and add it in. Second entry in the series, with a real experiment: a tiny GPT trained on Shakespeare and adapted to Don Quijote five different ways, to measure what each one actually costs and forgets.
Read article
I benchmarked my BPE tokenizer against tiktoken and BERT: the numbers were not kind
I retrained the BPE from transformer-from-scratch to an 8,000-token vocabulary and pitted it against cl100k_base, o200k_base, GPT-2 and multilingual BERT on the same English, Spanish and code corpora. The Spanish gap was worse than expected, and the real reason was not the one I had assumed.
Read article
Everything that happens when you press Enter in my search
The technical version: from the key event to the ranking, with the 735-fragment index, BM25 with k1=1.5 and b=0.75, the language boost and the decisions made along the way. For readers of the jargon-free version who want to see the gears.
Read article
Running models in the browser: what building a whole lab taught me
This portfolio has over twenty ML demos running in your browser with no server: networks training live, a transformer generating text, diffusion, a GAN. This is the practical guide that would have saved me weeks: formats, sizes, traps, and which technique fits which job.
Read article
Papers, plainly: Attention is all you need
The 2017 paper underneath every current chatbot fits in one idea: let each word decide which other words to look at. First entry in a series where I read classic papers and retell them the way I wish someone had told me.
Read article
Post-mortem: twelve days shipping a broken deploy without knowing
From June 29 to July 11 this site did not deploy once, while I was convinced it did. The full story of Cloudflare's 3 MB limit, how I found it, how I fixed it, and the three lessons I am keeping.
Read article
How this site's search finds me (with no servers)
Bottom right there is a button that answers questions about this portfolio. It calls no server: it scores 600 text fragments in your browser with a formula from the nineties that still wins battles. Here is how it works, jargon-free.
Read article
How does a machine learn? Explained without a single formula
My mother asked me what exactly I study. This article is the answer: how a machine learns, told without jargon and with an experiment right here so you can check it yourself.
Read article
You draw a 7 and it knows: what happens inside
Your drawing becomes 784 numbers, the 784 numbers become ten probabilities, and the highest one wins. The full journey, jargon-free, with the experiment inside the article.
Read article
Why the computer knows dog and cat are alike
Words become lists of numbers, and similar lists end up close together. That trick powers half the internet, from your search engine to question-answering assistants. Jargon-free, with an interactive map inside.
Read article
Calibrated probabilities: when a 0.7 has to mean 70%
A classifier can rank well and still lie with its numbers: saying 0.9 where the real frequency is 0.6. If someone is going to decide with that probability, you calibrate it, check it with the reliability curve and the Brier score, and only then pick a threshold.
Read article
What I learned implementing a transformer from scratch
Multi-head attention, causal masking and a BPE tokenizer handwritten in PyTorch, without torch.nn.Transformer. Three lessons no course had given me, including a surprise in the ablations.
Read article
Publishing ten CLIs on PyPI: what nobody tells you
Names already taken, a new-project limit that is not in the documentation, and why the package name does not have to match the command name. Notes from publishing a full suite of tools.
Read article
Your eval dropped from 90 to 89%: real regression or noise?
A new model scores 89.4% where the old one scored 90.0% on 1,000 examples. It looks like a regression. At that sample size it is noise. How to tell them apart before blocking a deploy.
Read article
Leakage between train and test: the mistake that inflates every metric
A row that appears in both training and test makes the model look better than it is. It is easy to introduce by accident and hard to see by eye. Where it creeps in and how to catch it before you trust your numbers.
Read article
From notebook to an inference API that survives production
A model trained in a notebook is not a product. Turning it into a service that validates its input, responds with predictable latency and can be monitored is the work that separates a demo from a system.
Read article
When is it worth using an LLM — and when is it not?
LLMs solve certain problems better than anything else. Others they solve worse than a three-line classifier. The question to ask before opening the OpenAI API.
Read article
How to evaluate whether an ML model actually works
A model with 95% accuracy can be completely useless. A model that looks worse in validation may be the one that actually works in production. What separates honest evaluation from the kind that inflates results.
Read article
Why the decision threshold matters more than the model
Moving the decision threshold from 0.5 to the right value for your business cost can improve the operational result more than switching from logistic regression to XGBoost. Why nobody explains it that way.
Read article
RAG: verifiable answers over your documents
How retrieval-augmented generation works: indexing, semantic retrieval, chunking and evaluation. Why every answer should be able to cite where it comes from …
Read article
MLOps: the difference between a model in a notebook and one in production
A notebook is an exploration environment, not a system. What it takes for a model to work in production, maintain itself and not degrade silently.
Read article
Drift: how to detect that your model is degrading
The model does not change. The data does. And if nobody is watching, the model can be giving bad predictions for weeks without anyone knowing. How to monitor drift in practice.
Read article