A model writes one word at a time after a prompt. Every word in the text, the prompt’s and each one the model writes, needs a key and a value worked out once it’s in the text: that’s what later words listen to in “Listen and collect”. Write work_to_write(prompt_length, new_words): how many words’ keys and values it has to work out to write new_words words after the prompt, if it never works anything out twice.
A 5-word prompt, then 3 words written one at a time. Every word in the text needs its key and value worked out, and each new word listens to all of them. Done the lazy way, every step works them all out again. How many keys and values, if nothing is worked out twice?
work_to_write(prompt_length, new_words)| prompt_length | how many words the prompt has | e.g. 5 |
| new_words | how many words the model writes after it, one at a time | e.g. 0 |
| returns | how many words' keys and values it works out in all | |