shivammittal.in

Side quests/November 2026

GPT-2 had the answer. It said “the” first.

Letting a second model pick GPT-2's next word from its own candidates

Shivam Mittal

27 November 2026

Code, data and every output

Abstract

GPT-2 XL sometimes has the right next word in its top 8 and still ranks something else first. I let a second model, Jev, pick from those 8 words and nothing else. On 500 facts, that took GPT-2 from 9.8% correct to 23.0%, out of a possible 28.4%. Most of the fixes were the same: GPT-2 wanted to say “the”, and the answer was right behind it. The same idea made open-ended writing worse at the word level and gave mixed results at the sentence level. Everything here, including the parts that failed, is in the repo.

1The idea

A language model writes one token at a time. At each step it ranks every possible next word, and plain decoding takes the top one, or samples from the top few. Everything the model knows has to pass through that ranking.

I wanted to know how often the ranking is wrong in a way that can be fixed. If the right word is in the model's top 8 but not first, a second model that can only choose from those 8 should be able to fix it, without writing anything itself.

The picker is Jev, TypeSafe's fast classification model. It takes some text and a list of options and returns one of the options. I gave it the text so far and GPT-2's candidates. The writer is GPT-2 XL: 1.5 billion parameters, from 2019, small enough to run on my laptop. Neither model was trained or fine-tuned for this.

2Facts: the clear win

CounterFact [2] is a set of simple fact prompts like “Beylerbeyi Palace can be found in”. I took 500 of them and looked only at the next word.

  • GPT-2 XL's top word
  • Jev's pick from GPT-2's top 8
ceiling 28.4%

GPT-2's top word

9.8%

Jev picks from the top 8

23.0%

Jev, only when the gate fires

9.6%
0%10%20%30%

correct next word, 500 facts

Figure 1. How often the next word is the right answer, on 500 CounterFact facts. The vertical line is the ceiling: on the other 71.6% the answer is not in GPT-2's top 8 at all, so no picker can reach it. The third bar uses the gate from section 4, which only asks Jev when GPT-2 looks unsure in one particular way.

GPT-2's top word was right 9.8% of the time. With Jev picking from the same top 8, it was right 23.0% of the time. On the 142 prompts where the answer was in the list at all, GPT-2 got 49 and Jev got 115. Jev fixed 69 and broke 3.

The fixes are the interesting part. 52 of the 69 look like this:

PromptGPT-2 saidJev picked
Beylerbeyi Palace can be found intheIstanbul
Unus pro omnibus, omnes pro uno is written intheLatin
John Landy holds a citizenship fromtheAustralia
Virtual Hard Disk was created bytheMicrosoft
Pacific Jazz Records is known for performingthejazz

GPT-2 was not missing the fact. “The” is a safe way to continue almost any sentence, so it wins the ranking, and the answer sits a few places behind it. Asked to choose, Jev takes the answer.

The other 17 fixes were real corrections. Haakon Lie died in Oslo, not Krakow. The Eiger is in Europe, not Africa. Google Checkout was made by Google, not Amazon.

The three it broke are worth a look too. Jev said Marco Di Vaio is a professional “footballer” (the answer key says “soccer”), and that the Chevrolet Van is made by “GM” (the key says “Chevrolet”). Both are arguably right. In the third, it continued “CBS This Morning is to debut on” with “Monday” instead of “CBS”. Exact matching counts all three as wrong.

3Writing: a failure and a half

A fact is one word. Writing is hundreds. For this I used the open-ended generation benchmark from Su and Xu [1]: 100 WikiText-103 prompts of 32 tokens, 256 new tokens each. It scores diversity, MAUVE (how close the text is to human writing [3]) and coherence with the prompt. Higher is better on all three. Each Jev method has a control that picks at random from the same candidates, so any difference comes from the picking.

Word by word, it does not work. Jev steps in when GPT-2 looks unsure (section 4 has the exact rule) and picks from the top 8 words. It is worse than the random control on all three metrics. The reason is visible in the text: Jev loves full stops. Its text has 47.5 full stops per 100 words. The control has 6.0.

The ship's secondary armament consisted of fourteen 45-calibre 6-inch (152 mm) quick-firing (

Jev picks each word

6-pounder) guns. The ship carried a total of 1,000 rounds of ammunition.

The ship carried a total of 1,000 rounds.

The ship carried a total of 1.

The ship carried a .

The ship carried .

.

. .

. . .

Random pick from the same words

6-pounder) guns, each of which could fire a total of 1,000 rounds per minute. The ship's main armament consisted of a total of eight 6-pounder guns, each of which could fire a maximum of 1,000 rounds per minute. The main armament of the ship was also capable of firing a total of 1,000 rounds per minute. The crew of the ship was made up of 1,200 men.

Figure 2. One WikiText-103 prompt (top, in italics), continued by Jev picking words and by the random control. Each sentence Jev writes is shorter than the last, until only full stops are left. The control repeats itself and invents numbers, but it keeps writing. Real outputs from the run, with WikiText's spacing tidied.

My guess, which I have not tested, is that ending the sentence is always a defensible choice. A picker judging one word at a time keeps taking the safe one, and each new sentence gives it another chance to.

Sentence by sentence, it partly works. Here GPT-2 samples 6 candidate sentences and Jev picks one, which gives it a whole thought to judge. Jev's text is more coherent than a random pick from the same 6, on 78 of 100 prompts. But it scores lower on MAUVE than that random pick, and it is behind contrastive search on every metric.

MethodDiversityMAUVECoherence
nucleus sampling (top-p 0.95)92.7898.60-2.961
contrastive search93.6094.59-1.576
Jev picks sentences92.1091.52-2.666
random pick, same 6 sentences93.5396.86-3.049
Jev picks words15.4132.53-1.191
random pick, same 8 words36.3274.86-1.112

Table 1. 100 WikiText-103 prompts, seed 0. Every row is scored the same way on the same prompts, so compare rows with each other. Coherence rewards text that stays close to the prompt, which is why repetitive text scores well on it, so read it next to diversity. The full table, with greedy decoding and a GPT-2 self-ranking control, is in the repo.

4The gate threw the gain away

Calling Jev on every word of a 256-token text would be slow, so the word method only calls it when GPT-2 looks unsure: its top word has under 40% probability, or its top two are within 15 points, and its top 8 words hold at least 70% of the probability. That last condition was meant to skip the steps where GPT-2 has no idea, on the theory that the answer is probably not in the top 8 there anyway. (It also steps in when GPT-2 is about to repeat a 4-token phrase.)

I ran the facts through the same gate. It threw away the entire gain: 9.6% correct, a little below GPT-2 on its own.

  • GPT-2 XL's top word
  • Jev's pick from GPT-2's top 8

Confident

110 prompts

15
27

Unsure, probability spread out

362 prompts

31
86

Unsure, probability concentrated

28 prompts, the only ones where the gate calls Jev

3
2
0255075100

prompts answered correctly

Figure 3. Where Jev's fixes came from. Most of the gain is in the middle group, where GPT-2's probability was spread across many words. The gate was built to skip exactly that group, and it only called Jev on the 28 prompts in the bottom one.

The theory was wrong. The answer was in the top 8 on 29% of the prompts where GPT-2's probability was spread out, the same rate as on the confident ones. The group the gate picked had the lowest rate: 5 of 28. Most of Jev's fixes, 56 of 69, came from the group the gate skips, and 12 more came where GPT-2 was confident and wrong.

5What I take from it

Knowing a fact and ranking it first are different things. In GPT-2 XL they come apart often enough that a model which never writes a word fixed 69 of the 93 misses it could have fixed, with no training for the task.

A picker needs something to judge. One word in the middle of a sentence is too little: Jev took the safe option and the text collapsed. A whole fact or a whole sentence is enough to choose well.

Looking unsure is the wrong trigger. I assumed GPT-2 is wrong when it looks unsure in a particular way. On facts, its fixable mistakes looked like everything else. Deciding when to ask for help is its own problem, and the obvious rule fails it.

The whole run cost under a dollar in Jev calls.

6Limits

References

  1. [1]Yixuan Su and Jialu Xu. An Empirical Study On Contrastive Search And Contrastive Decoding For Open-ended Text Generation. 2022. arXiv:2211.10797
  2. [2]Kevin Meng, David Bau, Alex Andonian and Yonatan Belinkov. Locating and Editing Factual Associations in GPT. NeurIPS 2022. arXiv:2202.05262
  3. [3]Krishna Pillutla, Swabha Swayamdipta, Rowan Zellers, John Thickstun, Sean Welleck, Yejin Choi and Zaid Harchaoui. MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers. NeurIPS 2021. arXiv:2102.01454
  4. [4]Code, data, logs and every generation from this run: github.com/CodeGeek04/jevgpt

More side quests