Birthday Paradox

How to test any chatbot's vocabulary with a birthday paradox

Run a question 300 times through any chatbot, count how many different answers you get, and the birthday paradox reveals the true size of its vocabulary.

3 min readTowards Data Science

The birthday paradox is one of those probability party tricks that feels like magic until you do the math. A few weeks ago, someone put it to work on small language models: ask the same question 300 times, count how many times the model repeats itself, and solve for the size of its effective vocabulary. The result, published on Towards Data Science, suggests that small LLMs are selecting from roughly 6 words out of every 40. That is not a headline about model size or parameter counts. It is a concrete, measurable constraint on how these tools think.

We think this matters because it shifts the conversation from "how big is the model" to "how narrow is the model's focus." For anyone who has felt frustrated when a chatbot circles back to the same phrasing or offers variations that are barely variations, this is the underlying mechanism. The birthday paradox reveals a structural limitation that no amount of prompt engineering will fully fix. It connects directly to questions we have explored before, like Why Machine-Verified Proofs Still Need Human Explanation, where the gap between what a system can output and what it can explain remains stubbornly wide. Similarly, the work on Beyond a 90% Cache Hit Rate: What Latency Reveals About AI Prompts shows that surface-level metrics like hit rate can hide deeper patterns in how models reuse tokens. The birthday paradox test is another layer of that same story: what looks like variety is often a small set of options cycling through predictable collisions.

The practical takeaway is straightforward. If you are building workflows that depend on a chatbot's ability to generate diverse responses, you need to know the floor, not just the ceiling. A model that draws from only six words per slot will produce repetitive outputs on long-form tasks, creative prompts, or any scenario where novelty matters. This is not a failure of the model's training; it is a probabilistic limit baked into how it samples. The same Python script works on any chatbot you can type into, which means you can run this test yourself in an afternoon. That is rare transparency in a field where vendors often lean on opaque benchmarks.

What we are left with is an open question: does this constraint matter more for small models, or does it reveal something about all autoregressive generation? The birthday paradox does not care about model size; it cares about the distribution of choices at each step. A larger model may have a wider effective vocabulary, but the same logic applies. The gap between a model's total vocabulary and its effective vocabulary is a measure of how much its training data and architecture constrain its outputs. For users, that gap is where surprises live. The next time a chatbot sounds like it is stuck in a loop, run the test. The answer might be simpler than you think.

From Towards Data Science

Ask the same question 300 times, count the repeats, and solve for N: a few lines of Python that work on any chatbot you can type into.

The post The Birthday Paradox Shows Small LLMs Pick From About 6 of 40 Words appeared first on Towards Data Science.

Read the original at Towards Data Science