I asked GPT-NeoX-20B a hundred arithmetic questions
Hey! As the author of the gist, just wanted to clear up what seem to be a few misconceptions:<p>- This isn&#x27;t GPT-3, it&#x27;s the recently-released open-source and open-weights model from EleutherAI, GPT-NeoX-20B. GPT-3 is much larger (175 billion parameters vs NeoX&#x27;s 20 billion).<p>- It&#x27;s well-known that language models don&#x27;t tend to be good at math by default (Gwern, among others, pointed this out back in June 2020). It seems likely that this is at least in part because of how these models currently tokenize their input (they don&#x27;t represent numbers by their individual digits, but by tokens representing commonly-occurring character sequences): <a href="https:&#x2F;&#x2F;www.gwern.net&#x2F;GPT-3#bpes" rel="nofollow">https:&#x2F;&#x2F;www.gwern.net&#x2F;GPT-3#bpes</a> . Someone also pointed me to this paper which looks at number representations (though it uses somewhat older models like BERT): <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1909.07940" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;1909.07940</a><p>- <i>Despite</i> the tokenization, it performs (IMO) surprisingly well at getting close to the true value, particularly for the start and end digits and the overall magnitude. You can see this by looking at the tokenization (indicated by brackets) of its guess vs the correct answer for 28531*8065 (I asked multiple times to get an idea of how consistent it is – it&#x27;s not deterministic because I ran this with temperature = 0.1, which will use random sampling to get the most likely tokens):<p><pre><code>  [What][ is][ 285][31][ *][ 80][65][?][\n][22][77][05][315]
                              Correct: [\n][23][010][25][15]
  [What][ is][ 285][31][ *][ 80][65][?][\n][22][95][01][115]
                              Correct: [\n][23][010][25][15]
  [What][ is][ 285][31][ *][ 80][65][?][\n][22][38][95][015]
                              Correct: [\n][23][010][25][15]
  [What][ is][ 285][31][ *][ 80][65][?][\n][22][99][25][015]
                              Correct: [\n][23][010][25][15]
  [What][ is][ 285][31][ *][ 80][65][?][\n][22][99][17][115]
                              Correct: [\n][23][010][25][15]
</code></pre>
You can see that it manages to find things that are numerically close, even when no individual token is actually correct. And it compensates for different-length tokens, always picking tokens that end up with the correct total number of digits.<p>- Please don&#x27;t use this as a calculator :) The goal in doing this was to figure out what it knows about arithmetic and see if I can understand what algorithms it might have invented for doing arithmetic, not to show that it&#x27;s good or bad at math (we have calculators for that, they work fine).