Project6 minutes to read

What a dataset is in AI, explained with a box of recipes

A dataset is the set of examples an AI model learns from. A box of recipe cards shows how it works and why what's in it shapes the model.

Picture a cook who has never eaten out, never watched a cookery programme and never had a lesson. Everything they know comes from one box of recipe cards on the kitchen shelf. Give them that box and they'll learn to cook. Whatever they make for the rest of their life will be shaped by what was on those cards.

In AI, that box is the dataset. A dataset is a collection of examples a model learns from. Each card is one example. The cook is the model, and learning from the box is training. Keep that kitchen in mind, because almost everything that matters about datasets shows up in it.

What goes on the cards

The examples in a dataset depend on what the model is meant to do.

For a chat model, the cards are text: web pages, books, articles, forum threads, computer code. A model that writes text learns by reading a vast amount of it and getting better at guessing what comes next.

For a model that recognises pictures, each card might be a photo with a short note of what's in it. A well-known example is ImageNet, a collection of photos sorted into categories, built by a university team and published in 2009. Much of the early progress in teaching computers to see was measured on it.

For a speech model, a card might be a recording with the words that were said, written out beside it.

Many chat models start from a common pantry. Common Crawl, a non-profit, has collected copies of public web pages for years and publishes them openly. Teams take that raw collection, throw away what they don't want, and add books, code and other text of their own.

The box decides the menu

Suppose most of the cards in our box are Italian. The cook gets very good at pasta and risotto. Ask for a curry and they'll try, because they've learned general things about heat, salt and timing, but the result will be shaky. They saw too few examples to know how it should go.

Models work the same way. A model trained mostly on English text writes English well. Ask it something in a language that made up a small share of its dataset and the answers get weaker, the grammar slips, and it may answer in English without being asked. A model that saw lots of computer code writes code. One that saw very little medical writing will be vague on medicine.

This is why two models of a similar size can behave so differently. The design may be close, but the boxes were filled differently.

Copies, mistakes and missing pages

The makeup of the box matters in smaller ways too.

Copies. Say one lasagne card was photocopied fifty times and slipped in all through the box. The cook sees it so often they could recite it, and starts reaching for lasagne when it doesn't fit. The web is full of repeated text, the same notice pasted onto thousands of pages, so teams spend real effort removing copies. Text a model sees again and again is the text it's most likely to repeat back word for word.

Mistakes. If a card says a tablespoon of salt where it meant a teaspoon, the cook learns it that way. Datasets gathered from the web carry spelling errors, wrong facts and broken code. A model has no way to tell a careful card from a careless one unless someone sorted them first. Filtering, keeping the good cards and dropping the bad, is a large part of building a dataset.

Gaps. If nobody put dessert recipes in the box, the cook has never heard of baking. Models have gaps like this, and they're hard to spot from outside, because the model will often produce something that sounds right anyway.

Who wrote the cards. Every recipe carries its writer's habits. One says "a pinch", another says "a gram", one assumes everyone owns an oven. A dataset carries the habits and assumptions of the people whose writing went into it: which places they live in, which topics they write about, what they take for granted. The model picks those up along with everything else.

When the box was closed. A recipe box shut on a given day holds no dish invented after it. A dataset has a date too, which is why a model can be confidently out of date.

The shape of the cards matters as well

Two boxes can hold the same dishes and still teach different things. One holds cards with full step-by-step instructions. The other holds only lists of ingredients. A cook trained on the second box knows what goes into a dish and has no idea of the order.

For AI, the shape of each example teaches the model what sort of output to produce. Plain web text teaches a model to continue text. A dataset of questions paired with good answers teaches it to reply to questions. Many chat models are trained first on a huge, mixed box and then on a smaller, carefully written one that teaches them how to hold a conversation. Same cook, a second, more careful box.

A dataset story from our Lab

We run into this in our own work. When DeepNile runs a model across several computers, a small helper on your computer guesses the next few words ahead, so the chain wastes fewer trips. The better its guesses, the faster the answer.

One idea we tried was to train that guesser on the model's own answers, a different box of cards from the one it had learned from. It made things worse. Over three tries, the share of right guesses in English fell from 72.6% to 68.0%, and the idea was closed. The full entry, with its numbers, is in the Lab's write-up of that experiment.org. A different box gave a different cook, and in this case a worse one.

How to tell what's in a model's box

You can't open a model and read its cards. Training turns the examples into the model's numbers, and the cards themselves aren't kept inside it. So you learn about a dataset in two ways.

The first is to read what the builders publish. Some open models come with a description of their dataset: which sources, which languages, how it was filtered, when it was collected. Some describe it only in general terms. A detailed description is worth more than a vague one, because it tells you where to expect strength and where to expect gaps.

The second is to taste the cooking. Ask a model the same question in two languages and compare. Ask about a niche you know well. Ask it to write code in a common language and then in a rare one. Where the answers thin out, the box was probably thin too.

Why it all comes back to the box

A model can't know what was never on its cards, and it tends to copy what was on them most. That's the whole reason datasets get so much care: the sorting, the removing of copies, the balance between languages and topics. A better box doesn't guarantee a good cook, but a poor box almost guarantees a poor one.

If you'd like to see how a project tests ideas like these one experiment at a time, with the failures kept alongside the wins, the Lab.org lists every idea we've tried and what happened.

More about the Project

All posts about the Project