ChatGPT can come up with original poems, long bits of prose, and all kinds of historical facts, but it often slips up at some of the most basic tasks — and an OpenAI employee has now provided some insight into why.
OpenAI VP Peter Welinder has explained why ChatGPT is unable to reverse words or figure out anagrams. “GPT-3 is amazing at complex tasks like creative writing and summarizing. But it’s surprisingly bad at reversing words,” he tweeted. “The reason is that GPT-3 doesn’t see the world the way we humans do,” he explained. He showed how ChatGPT was unable to reverse words like “alphabet” and “encyclopedia”.
He then went on to explain why this happens. “The first reason GPT-3 is bad at reversing words is due to tokenization: it doesn’t see letters and words as humans do. Instead, it sees “tokens,” he said. “Tokens are chunks of characters. For example, the word “alphabet” gets broken up into the tokens “alph” and “abet”. Short and common words like “the” are a single token,” he says.
Because GPT-3 doesn’t see words as individual letters but as subwords, it’s unable to complete the relatively simple task of reversing letters. But Welinder suggests there’s a workaround. “We can teach it to order characters by having it add numbers to keep track of the letters in the sequence. This simple trick makes the ordering explicit, and GPT-3 now manages to reverse the letters correctly,” he tweeted.
This trick manages to get GPT-3 to produce a better result, but it still isn’t perfect. “It manages to reverse the letter sequence, but fails at removing the spaces in the last step. It’s the tokenization striking again,” Welinder explains.
“GPT-3 has trouble removing the spaces and merging tokens. You can teach it to break down the task into steps. In each step, you remove every other space: “a l p h a b e t” becomes “al ph ab et”, which becomes “alph abet”, and finally “alphabet”,” he says.
He then shared how GPT-3 could be made to reverse words with an algorithm. Users first show GPT-3 what to do with an example word: alphabet.
– Add spaces between letters: alphabet
– Add numbers: 1:a 2:13:p 4:h 5:a 6:b 7:e 8:t
– Reverse numbers and letters: 8:t 7:e 6:b 5:a 4:h 3:p 2:11:a
– Remove numbers: tebahpla
– Merge the letters in groups of two: to ba hp la, teba hpla, tebahpla
– Final result: tebahpla
GPT-3 can now correctly follow the same process for the word encyclopedia.
Word: encyclopedia Reasoning:
– Add spaces between letters: encyclopedia
– Add numbers: 1:e 2:n 3:c 4:y 5:c 6:17:o 8:p 9:e 10:d 11:i 12:a
– Reverse numbers and letters: 12:a 11:i 10:d 9:e 8:p 7:o 6:1 5:c 4:y 3:c 2:n 1:e
– Remove numbers:a idepolcycne
– Merge the letters in groups of two: ai de po lc yc ne, aide polc ycne, aidepolcycne
– Final result: aidepolcycne
Now there are several other simpler ways to reverse words, and one doesn’t need to necessarily need to use GPT-3 to perform this particular task. But this example provides a fascinating insight into how LLMs work, and what are the limitations of their abilities. LLMs are enormously powerful — and can even understand jumbled words — but this little experiment shows they operate differently from humans: tasks that might seem easy to a fifth grader can slip up even the best LLMs with billions of parameters.