Using an LLM to make a model choice measurable.
Classifying web pages into the IAB Content Taxonomy is a natural job for embeddings, but there was no labeled data to tell which model to use or how small its vectors could be. I built the test set with Claude, then scored every candidate model on it, and picked the model from the scores.
Picking an embedding model when no test set existed.
The IAB Content Taxonomy has about 700 categories, and classifying a page into it is a natural job for embeddings. But which model, and how big a vector? There was no labeled data to measure against. So I made some: Claude Haiku generated one realistic publisher page per category, 704 in all, each with a known correct answer. Every candidate model was then scored on the same test.
- Embed the taxonomy once per model and cache it, so runs are cheap to repeat.
- Embed each test page with the same model and rank categories by cosine similarity.
- Score top-1 and top-5 accuracy against the known answer.
- Test smaller vectors. Some models are trained so a shortened vector still works. Smaller vectors mean less to store, send and search, so the goal was the smallest size that keeps the accuracy.
Built on Cloudflare Workers AI and Vectorize, in TypeScript. github.com/IABTechLab/iab-taxonomy-classifier
Results across 704 test pages
Want to talk about it?
I'm based in Los Angeles and open to product and engineering roles.
therevoltingx@gmail.com