Will the Answer Change When I Change the Passage?

At the end of pretraining I gave my model two passages about Alice. Her scarf was red in one and blue in the other. The model said red both times. I wanted to teach it a small, testable skill. If I changed a fact in the text in front of it, could I get it to change its answer?

Showing the model where the answer belongs

I started with SQuAD, a collection of questions people answered by selecting a few words from a Wikipedia passage. Each training example gave the model the passage, the question, the answer and a marker meaning "stop here." I scored its predictions only on the answer and the stop marker. A long passage could give the model plenty to read while a two-word answer told it exactly what to practice. This is supervised fine-tuning, or SFT.

I gave three copies of the same 50.7M-parameter architecture two passes over the same 82,768 examples. The copies differed in what they had read during pretraining. I tested them on 10,566 questions about unseen SQuAD articles, then on 7,719 questions from six other sources, including textbooks and movie plots. The score is word F1 out of 100. An exact answer gets full credit. A partial answer can earn some, and extra words cost points. For the six sources I scored each one separately and gave them equal weight.

What the model read before SFT SQuAD F1 Six other sources, mean F1
1 billion tokens of educational web text 62.36 31.85
10 billion tokens of educational web text (4a) 72.73 38.41
10 billion tokens, with a different mix for the last 2 billion (M2) 72.53 38.41

The extra nine billion tokens bought about ten points on SQuAD and six and a half on the other sources. Choosing between the two ten-billion-token models was harder. M2 had done better on science questions during pretraining, and 4a had predicted ordinary educational text more accurately. After the same reading lessons, their scores on the six new sources agreed to two decimal places.

Changing a name, a year or a number

I went back to the scarf question with a larger test. In 2,655 SQuAD questions I replaced every occurrence of the answer in the passage with another name, year or number of the same kind. I left the question alone and scored against the replacement. M2 earned 68.87 F1 across those questions. It gave the exact old answer on just 0.19% of them. It could still pick the wrong words, especially when the answer was a name. But sticking to the original fact had become a rare mistake.

One choice I would repeat is to let the model finish its own answers when picking a training setting. On M2, a learning rate of 0.0001 gave the lowest loss when I supplied the correct answer one token at a time. When I let it answer unaided, that setting scored 66.99 F1 on development questions. A rate of 0.0003 scored 68.85. A reader using the model only gets the second kind of test.

I also tried moving the same 80 million tokens of general web text around within a one-billion-token run. Putting them all near the end cost 1.20 points on the six sources with one random seed and gained 0.77 with another. Either run on its own would have made a neat story about when to mix the data. Running the pair again gave me a reason to leave the timing alone. Reading experiments · Fine-tuning code