Experiences, reflections and what I keep learning
Articles on programming, mathematics and AI with an analytical eye.
11 articles across all areas
Page 1 of 2How serverless works under the hood, and when it beats a server
The same AWS Lambda function takes 0.51 s to answer the first time and 0.25 s the second, because for the first request there was no server yet. What serverless really means, where it came from, how it works under the hood (measured on a real account), what it changes in your code, what it costs next to a server, and when to choose each.
Why C is being replaced by Rust, and why C won't disappear
A twenty-line C program compiles without a single warning, prints exactly what it should and reads memory that has already been freed. The same program in Rust won't compile. What C leaves to the programmer, five classic errors and how Rust prevents them, what Rust doesn't fix, what switching costs, when to choose each, and why C isn't going away anyway.
How to evaluate a language model: who decides whether an answer is right
Four answers to the same question, and the classic measures rank the only false one first. Why grading what a language model writes is nothing like grading a classifier, the four judges that can decide whether an answer is right (a reference answer, a program, a person and another model), what each one sees and misses, and when to trust the number that comes out.
How a vector database searches without comparing everything, and the price it pays
A vector database doesn't find the vectors most similar to a query. It almost always finds almost all of them, and lets you decide how close to "all" is close enough. This article covers what a vector database is and isn't, the algorithms that decide where to look and how much of each vector to keep, what databases had to add on top, and how the options compare in public benchmarks.
Why cosine for comparing embeddings, and why it is not a metric
Nearly all language processing compares embeddings with cosine similarity, and nearly every library calls it a metric when it isn't one. This article covers how cosine won out over so many other measures, why not being a metric rarely matters (and when it does), and where cosine stops being the right tool.
Why relational databases index with B-trees, when there are so many ways to search
A hash index finds one order among 3 million by reading three pages, and a B-tree reads four, yet almost every relational database indexes with B-trees. This post explains what a B-tree is, what changes in the B+tree databases actually use, and why it beat the hash table, the binary tree and the sorted file: reading pages is what's expensive, and an index has to do far more than find a key.
How a database runs a JOIN, and why it sometimes ignores your index
A JOIN between customers and orders, an index created for that JOIN, and a database that decides not to use it. This post explains why "for each row, look it up in the other table" is only one of three ways to run a JOIN, how the database chooses between them, and what changes in a column store.
Articles 1–7 of 11
Sign in to be notified when a new article goes up