Checking how many agents are working

How this works
Kontakt
← Blog
Stacks of faint olive pages feeding into one narrow glowing funnel on a near-black navy ground with a dotted grid, the AMARBARO mark centred over it.
✎Post blogowy

Training data: what a model learns from

The short version

A model's skills follow its training data: giving our 72.6 million parameter model ten times more text, mostly Wikipedia-style, lifted its tool test from 22 to 55 of 56 but did not move a common-sense test.

What this is about

A language model learns only from the text you show it. It cannot know a fact that was never in its training data, and it will copy habits that were. So the choice of data is one of the biggest choices in the whole project.

This article explains what training data is, where ours came from, why the mix of different kinds of text matters, and how much text a small model needs.

Why it matters

When someone says a model is good at something, the first question to ask is: what did it read? A model that read mostly encyclopedia text will sound like one. A model that read worked math problems will do arithmetic better. A model that read examples of tool calls will learn to call tools.

The data also decides what the model cannot do. And it sets limits we cannot see from the outside, such as whose words went in and whether we are allowed to use them.

How it works: the parts of a training set

A training set is a big pile of text, cut into small pieces called tokens. The model reads the pieces and tries to guess each next one. We cover that loop in the article on what training means.

Here is what went into our small model, Metis. The first prototype's training mix was about 68.8 million tokens, made of these parts:

  • 60 MB of Wikipedia text, for general reading
  • 59 MB of our own notes, with secrets removed
  • 40 MB of MetaMathQA, a set of math problems and worked answers
  • 14 MB of math word problems that we rewrote to include calculator calls
  • 19.6 MB of redacted transcripts of our own agent sessions

About that last part: we have not finished reading the terms of service of the tools that produced those sessions. We make no claim yet about training on them, and the model's weights stay private until we decide otherwise.

For the next version we added rows that show tool calls. We built them from real calls. Each row has a question, a call, the real result (cut to 1,200 bytes) and an answer taken from that result. The set had 858 training rows for the script runner, 472 for the lookup tool and 224 for the page fetch. We held back 10 percent of the topics. The test questions covered topics the model never saw. This matters: if a test uses topics that were in training, the score tells you about memory, not about skill.

How the mix changes the model

A mix is a recipe. More of one thing means more skill at that thing, and sometimes less at others.

In one of our small runs, the model learned the tool format and its tool score went up. In the same run it got worse at guessing the last word of a passage. Perplexity, where lower is better, rose from 45.5 to 80.2. The data pushed it toward tools and away from plain reading.

The mix also decides how well the tokenizer fits. A tokenizer cuts text into tokens. Our starting tokenizer averaged 3.64 bytes per token on Wikipedia, but only 2.42 on our own notes. That means our notes cost more tokens for the same length of text, so the model sees less of them in one training step. We trained our own tokenizer on a sample with more of our own text to fix part of that.

How much text does a small model need?

This was our biggest lesson. Our first Metis run read about 39 million tokens for 72.6 million parameters. That is roughly half a token of text for every parameter.

Then we gave the same model about ten times more text. That is about 5.5 tokens per parameter. The round used a mix that was mostly Wikipedia-style text, about 82 percent. Same model, same recipe. The tool test went from 22 of 56 to 55 of 56. Our bits-per-byte score on unseen text fell from 1.664 to 1.294.

A later run went further. It continued reading for 1.1 billion new tokens: unseen Wikipedia, papers, code and our own notes. The tool rows from a phone app made up 10 percent of each batch. A failure we had fought for weeks, where the model called one tool 223 times in a single message, dropped to 1 after that run. We cannot say which part of the 1.1 billion tokens did it, because the run mixed several things. We report it as a result and not as a cause.

What more text did not fix

A common-sense test, PIQA, did not move even with ten times more text. A small model with a narrow job can get much better at that job and stay about the same at others. It is a reminder that the data teaches what it contains.

A simple way to think about it

  1. Decide the job. What should the model be able to do?
  2. Match the data to the job. Show it real examples of that job.
  3. Keep a share of general text. It helps the model stay readable.
  4. Hold out test topics. Keep some topics away from training, so the test is fair.
  5. Count tokens per parameter. In our runs, going from half a token per parameter to 5.5 was the biggest single gain.
  6. Check where the data came from. Ask what you are allowed to use.

Words you may not know

  • Training data: the text a model learns from.
  • Token: a small piece of text, often a word or part of one.
  • Held out: kept away from training on purpose, so it can be used for a fair test.
  • Tokenizer: the part that cuts text into tokens.
  • Perplexity: a score for how surprised a model is by text. Lower is better.
  • Redacted: with private details removed.
  • Bits per byte: a score for how well a model predicts unseen text. Lower is better.

Try it

Our tool mokei counts lines of code in 40 languages and also estimates tokens, so you can see how big a file looks to a model. The code is on GitHub.

If you want to ask us about data choices, come to gllm.forum. For a first experiment of your own, count the tokens in a few of your own files and compare them to their size in bytes. In our case, our own notes cost more tokens per byte than Wikipedia text did.

400 Million Tokens for 73 Million Parameters has the full table for the ten-times run. A 73M Model That Calls Our Tools describes the tool rows in more detail.

Komentarze

Brak komentarzy.

Zaloguj się aby skomentować.