Answers.Body: <p>Large Language Models actually can do math. It's an &quot;emergent&quot; property, i.e. it appears only at larger scales. Understanding complex English language does require some analytical ability, which can carry over to math tasks like calculus and even arithmetic. Numbers can be represented as words, so it's definitely not unthinkable that an LLM could learn to add and subtract if it were to see enough examples.</p>
  <p>The graph below from the 2022 paper <a href="https://arxiv.org/pdf/2206.07682.pdf" rel="noreferrer">&quot;Emergent Abilities of Large Language Models&quot;</a> shows that these properties &quot;spontaneously&quot; emerge as models get larger. We're interested in subgraph (A) here. Upto 10^22 FLOPS, the models studied (the largest models available at the time) have basically no arithmetic ability, but scaling the models further rapidly improves their capabilities. We don't know the internals of GPT-4, but it should be larger than these models, so it was expected that it would better at arithmetic.</p>
  <p>It also goes the other way around, <a href="https://aclanthology.org/2021.emnlp-main.557.pdf" rel="noreferrer">Numeracy enhances the Literacy of Language Models</a></p>
  <p><a href="https://i.sstatic.net/ITNQK.png" rel="noreferrer"><img src="https://i.sstatic.net/ITNQK.png" alt="Emergent Properties of Large language models" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-13T03:10:02.960Z
Answers.Text: Language models model the probability P(w_k | w_{k - i}, ..., w_{k - 1} for words w_k, that is the probability of a word w_k appearing in context w_{k - i}, ..., w_{k - 1}. Furthermore, models have been trained to do math computations directly. If the training dataset contains enough examples of math tasks, the model may be able to reproduce these examples, and with enough parameters and enough samples even find some rules. However, it's not very reliable (for now), it's always based on statistics in the end.
Answers.UserDisplayName: Green grün 绿色 vert зеленый
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-13T05:21:36.440Z
Answers.Text: Do we have any reason to believe that they're still using a basic LLM?  A mixed architecture seems like such low-hanging fruit.
Answers.UserDisplayName: Nat
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-17T11:46:31.917Z
Answers.Text: Saying that they can do math makes no sense when they can't even count. Doing math is not just choosing an answer based on what is most likely. You need to do it with probability 1 or 0. There's nothing in between. Everything in between is not math, and that's what all these models do. So, these models do everything, except math.
Answers.UserDisplayName: nbro
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-27T22:38:03.323Z
Answers.Text: Damn . . . . . .
Answers.UserDisplayName: user1953366
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-12T22:12:37.713Z
Answers.LastActivityDate: 2023-04-12T22:18:47.613Z
Answers.LastEditDate: 2023-04-12T22:18:47.613Z
Answers.UserDisplayName: Harsh
Answers.Body: <p>ChatGPT now uses Wolfram Alpha to deal with math as well as other factual information.</p>
  <p><a href="https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/" rel="noreferrer">https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-25T22:50:21.737Z
Answers.Text: Wolfram is offered as a plugin and not used by default to solve mathematical equations with ChatGPT.
Answers.UserDisplayName: Brian
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-23T18:18:50.810Z
Answers.LastActivityDate: 2023-03-23T18:18:50.810Z
Answers.UserDisplayName: Jaume Oliver Lafont
Answers.Body: <p>As far as we know, GPT-4's core capabilities are still based mainly on a Large Language Model (LLM).</p>
  <p>If so, then the apparent capabilities to reason are a somewhat surprising emergent phenomenom from a well-trained sequence prediction engine that has been trained on large amounts of data, and has capacity to create highly complex rules that approximate a &quot;next symbol oracle&quot;.</p>
  <p>Again, assuming this assertion is correct, then maths and logic capabilities of ChatGPT divide into a few different possibilities (these are not formal classifications, just my amateur analysis):</p>
  <ul>
  <li>Rote learning of symbol associations. This is likely to occur with commonly-occurring items in the training data. Special values of trigonometry functions for example.</li>
  <li>Things that look like logical reasoning, but are simply well-formed sentences that are on-topic. This is something we can easily be fooled by. When ChatGPT gives an explanation for a thing, it may not have any representation of it beyond being in an &quot;explainy&quot; state, and generating text that fits.</li>
  <li>Approximate rules and processes. The LLM is a complex neural network, and can in principle learn arbitrary internal functions in order to predict sequence continuation. It learns these statistically, and there will be limitations - for example it is unlikely that it could learn to produce crytpographic hashes given only examples. But it may really learn to add two numbers across a wide range of numerical values given thousands of examples.</li>
  <li>Logic processes embedded in the form of output text. I have seen many examples where a LLM gets a correct answer when it is allowed to &quot;think things through&quot; by showing the working out, whilst forcing a direct answer will be wrong.</li>
  <li>Accurate rules and processes. Some rules in maths are very language-like and could be learned very well by an LLM. That could include some mathematical symbol manipulations such as variable substitution.</li>
  </ul>
  <p>I expect that all the above are occurring in some mix.</p>
  <p>For example, you could conjecture that there is a reasonable chance that GPT can internally count accurately up to some moderate number, and re-use that ability in different contexts to predict numerical symbols and associated words (e.g. <code>one</code> has also representation <code>1</code>) It may also contain more than one such semi-accurate counter, using them in different contexts.</p>
  <p>The sheer quantity of training material - more than any single person could consume in their lifetime - plus learning capacity of the neural network means that there are probably a lot of simple rote rules that are subject-dependent. However, in some areas the model will have a &quot;deeper understanding&quot; in that it will have learned reasonably complex manipulations, and used them to predict a sequence of symbols as accurately as possible, using as little of its learning capacity as possible (because it is being asked to predict text in a huge range of contexts, so benefits when it compresses its rules)</p>
  <p>GPT has not learned primarily by reasoning and from first principles though. Its inner representations and logical units of work are likely to be quite alien to humans, and may freely combine grammar, sentiment, mathematical building blocks and other symbollic context in ways that could seem very odd if they could even be explained. This heady mix of things that occurs in most neural networks during training, is one reason why it is unlikely that OpenAI have wired in separate logic modules for highly structured processing such as math symbols or calculations. Providing such modules is possible, but detecting when to use them, and how to wire them into the network are both hard problems.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-23T15:59:36.493Z
Answers.LastActivityDate: 2023-09-12T07:08:23.307Z
Answers.LastEditDate: 2023-09-12T07:08:23.307Z
Answers.UserDisplayName: Neil Slater
Answers.Body: <p>OpenAI's CEO <a href="https://www.youtube.com/live/outcGtbnMuQ?feature=share&amp;t=1317" rel="nofollow noreferrer">explicitly mentioned</a> last month in the GPT-4 announcement video that GPT-4 isn't hooked up to a calculator.</p>
  <p>One can however install plugins on top of ChatGPT, which may connect it to some other resources such as Wolfram as mentioned in <a href="https://ai.stackexchange.com/users/24014/jaume-oliver-lafont">Jaume Oliver Lafont</a>'s answer.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-17T00:51:03.650Z
Answers.LastActivityDate: 2023-04-17T01:04:09.047Z
Answers.LastEditDate: 2023-04-17T01:04:09.047Z
Answers.UserDisplayName: Franck Dernoncourt
Answers.Body: <p>There is a folk story about <a href="https://en.wikipedia.org/wiki/Josiah_Willard_Gibbs" rel="nofollow noreferrer">J.W. Gibbs</a> that goes something like:</p>
  <blockquote>
  <p>Being a famous scientist, Gibbs was a member of a number of scientific bodies. He was bored by those and never took a podium. Except for one time. The discussion was about redirecting some effort from teaching mathematics towards more effort at teaching foreign languages. Gibbs decided to give a speech that one time. He said: <em>&quot;Mathematics is a language.&quot;</em></p>
  </blockquote>
  <p>I don't know is this story is true or not, but I share the attitude.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-07-27T22:39:37.623Z
Answers.Text: Finally an answer which makes sense. At least GPT's understood it.. Don't know when humans will.
Answers.UserDisplayName: user1953366
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-23T13:26:38.840Z
Answers.LastActivityDate: 2023-03-23T13:26:38.840Z
Answers.UserDisplayName: Kostya
Body: <p>How can GPT 4 solve complex calculus and other math problems. I believe these problems require analytical reasoning and ability to compute numbers. Does it still use a LLM to complete this process or does it add on to this?</p>
  <p><a href="https://openai.com/research/gpt-4" rel="noreferrer">Here</a> is the link to the official results published by OpenAI</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:25:13.793Z
Comments.Text: But you cannot solve mathematics by predicting the next word technique. If that were the case, all English majors could be mathematicians.
Comments.UserDisplayName: desert_ranger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:30:11.457Z
Comments.Text: @desert_ranger Your argument is basically "Reductio ad absurdum".
Comments.UserDisplayName: Dr. Snoopy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:31:26.707Z
Comments.Text: And more importantly, there are not many details of how GPT-4 works or was trained, so this is not objectively answerable.
Comments.UserDisplayName: Dr. Snoopy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:34:31.790Z
Comments.Text: @user253751 An example would be GPT-4's score in GRE Math and AP Math exams.
Comments.UserDisplayName: desert_ranger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:45:42.983Z
Comments.Text: @user253751 My apologies. I have updated my question with the official link.
Comments.UserDisplayName: desert_ranger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:46:26.700Z
Comments.Text: @Dr.Snoopy I am not familiar with these argument terms. Is there a flaw with this type of argument?
Comments.UserDisplayName: desert_ranger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T00:49:35.227Z
Comments.Text: @Dr.Snoopy I wasn't aware that the training details weren't released. Despite that, generative models are usually built using some core algorithm - Autoregressive, Flows, VAE, etc. Therefore, I was hoping that maybe there's a explanation about GPT-4 capabilities and incapabilities.
Comments.UserDisplayName: desert_ranger
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-03-23T01:05:52.333Z
Comments.Text: This is basically the only technical information available: https://arxiv.org/abs/2303.08774
Comments.UserDisplayName: Dr. Snoopy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-12T22:22:18.687Z
Comments.Text: "But you cannot solve mathematics by predicting the next word technique." I don't think this is true. If mathematics can be laid out as text in a textbook, it can be predicted using next word prediction.
Comments.UserDisplayName: Harsh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-04-17T11:49:26.627Z
Comments.Text: They can't do math. They answers to mathematical questions are based on what is most likely given the training data. Yes, there are plugins, and you can query Wolfram Alpha, but the models per se are not doing math.
Comments.UserDisplayName: nbro
Tags: <chatgpt><gpt><gpt-4>
Title: How is GPT 4 able to solve math?
UserDisplayName: desert_ranger
ThreadText: # How is GPT 4 able to solve math?
  
  (Asked by: username_0 on 2023-03-22)
  
  How can GPT 4 solve complex calculus and other math problems. I believe these problems require analytical reasoning and ability to compute numbers. Does it still use a LLM to complete this process or does it add on to this?
  
  [Here](https://openai.com/research/gpt-4) is the link to the official results published by OpenAI
  
  **Tags:** chatgpt, gpt, gpt-4
  > **Comments:**
  > **username_0**: But you cannot solve mathematics by predicting the next word technique. If that were the case, all English majors could be mathematicians.  
  > **username_1**: @desert_ranger Your argument is basically "Reductio ad absurdum".  
  > **username_1**: And more importantly, there are not many details of how GPT-4 works or was trained, so this is not objectively answerable.  
  > **username_0**: @user253751 An example would be GPT-4's score in GRE Math and AP Math exams.  
  > **username_0**: @user253751 My apologies. I have updated my question with the official link.  
  > **username_0**: @Dr.Snoopy I am not familiar with these argument terms. Is there a flaw with this type of argument?  
  > **username_0**: @Dr.Snoopy I wasn't aware that the training details weren't released. Despite that, generative models are usually built using some core algorithm - Autoregressive, Flows, VAE, etc. Therefore, I was hoping that maybe there's a explanation about GPT-4 capabilities and incapabilities.  
  > **username_1**: This is basically the only technical information available: https://arxiv.org/abs/2303.08774  
  > **username_2**: "But you cannot solve mathematics by predicting the next word technique." I don't think this is true. If mathematics can be laid out as text in a textbook, it can be predicted using next word prediction.  
  > **username_3**: They can't do math. They answers to mathematical questions are based on what is most likely given the training data. Yes, there are plugins, and you can query Wolfram Alpha, but the models per se are not doing math.  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_2 on 2023-04-12. Score: 14
  
  Large Language Models actually can do math. It's an "emergent" property, i.e. it appears only at larger scales. Understanding complex English language does require some analytical ability, which can carry over to math tasks like calculus and even arithmetic. Numbers can be represented as words, so it's definitely not unthinkable that an LLM could learn to add and subtract if it were to see enough examples.
  
  The graph below from the 2022 paper ["Emergent Abilities of Large Language Models"](https://arxiv.org/pdf/2206.07682.pdf) shows that these properties "spontaneously" emerge as models get larger. We're interested in subgraph (A) here. Upto 10^22 FLOPS, the models studied (the largest models available at the time) have basically no arithmetic ability, but scaling the models further rapidly improves their capabilities. We don't know the internals of GPT-4, but it should be larger than these models, so it was expected that it would better at arithmetic.
  
  It also goes the other way around, [Numeracy enhances the Literacy of Language Models](https://aclanthology.org/2021.emnlp-main.557.pdf)
  
  [![Emergent Properties of Large language models](https://i.sstatic.net/ITNQK.png)](https://i.sstatic.net/ITNQK.png)
  
  > **Comments:**
  > **username_4**: Language models model the probability P(w_k | w_{k - i}, ..., w_{k - 1} for words w_k, that is the probability of a word w_k appearing in context w_{k - i}, ..., w_{k - 1}. Furthermore, models have been trained to do math computations directly. If the training dataset contains enough examples of math tasks, the model may be able to reproduce these examples, and with enough parameters and enough samples even find some rules. However, it's not very reliable (for now), it's always based on statistics in the end.  
  > **username_5**: Do we have any reason to believe that they're still using a basic LLM?  A mixed architecture seems like such low-hanging fruit.  
  > **username_3**: Saying that they can do math makes no sense when they can't even count. Doing math is not just choosing an answer based on what is most likely. You need to do it with probability 1 or 0. There's nothing in between. Everything in between is not math, and that's what all these models do. So, these models do everything, except math.  
  > **username_6**: Damn . . . . . .  
  
  ---
  
  ### Answer by username_7 on 2023-03-23. Score: 6
  
  ChatGPT now uses Wolfram Alpha to deal with math as well as other factual information.
  
  <https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/>
  
  > **Comments:**
  > **username_8**: Wolfram is offered as a plugin and not used by default to solve mathematical equations with ChatGPT.  
  
  ---
  
  ### Answer by username_9 on 2023-03-23. Score: 3
  
  As far as we know, GPT-4's core capabilities are still based mainly on a Large Language Model (LLM).
  
  If so, then the apparent capabilities to reason are a somewhat surprising emergent phenomenom from a well-trained sequence prediction engine that has been trained on large amounts of data, and has capacity to create highly complex rules that approximate a "next symbol oracle".
  
  Again, assuming this assertion is correct, then maths and logic capabilities of ChatGPT divide into a few different possibilities (these are not formal classifications, just my amateur analysis):
  
  * Rote learning of symbol associations. This is likely to occur with commonly-occurring items in the training data. Special values of trigonometry functions for example.
  * Things that look like logical reasoning, but are simply well-formed sentences that are on-topic. This is something we can easily be fooled by. When ChatGPT gives an explanation for a thing, it may not have any representation of it beyond being in an "explainy" state, and generating text that fits.
  * Approximate rules and processes. The LLM is a complex neural network, and can in principle learn arbitrary internal functions in order to predict sequence continuation. It learns these statistically, and there will be limitations - for example it is unlikely that it could learn to produce crytpographic hashes given only examples. But it may really learn to add two numbers across a wide range of numerical values given thousands of examples.
  * Logic processes embedded in the form of output text. I have seen many examples where a LLM gets a correct answer when it is allowed to "think things through" by showing the working out, whilst forcing a direct answer will be wrong.
  * Accurate rules and processes. Some rules in maths are very language-like and could be learned very well by an LLM. That could include some mathematical symbol manipulations such as variable substitution.
  
  I expect that all the above are occurring in some mix.
  
  For example, you could conjecture that there is a reasonable chance that GPT can internally count accurately up to some moderate number, and re-use that ability in different contexts to predict numerical symbols and associated words (e.g. `one` has also representation `1`) It may also contain more than one such semi-accurate counter, using them in different contexts.
  
  The sheer quantity of training material - more than any single person could consume in their lifetime - plus learning capacity of the neural network means that there are probably a lot of simple rote rules that are subject-dependent. However, in some areas the model will have a "deeper understanding" in that it will have learned reasonably complex manipulations, and used them to predict a sequence of symbols as accurately as possible, using as little of its learning capacity as possible (because it is being asked to predict text in a huge range of contexts, so benefits when it compresses its rules)
  
  GPT has not learned primarily by reasoning and from first principles though. Its inner representations and logical units of work are likely to be quite alien to humans, and may freely combine grammar, sentiment, mathematical building blocks and other symbollic context in ways that could seem very odd if they could even be explained. This heady mix of things that occurs in most neural networks during training, is one reason why it is unlikely that OpenAI have wired in separate logic modules for highly structured processing such as math symbols or calculations. Providing such modules is possible, but detecting when to use them, and how to wire them into the network are both hard problems.
  
  
  ---
  
  ### Answer by username_10 on 2023-04-17. Score: 2
  
  OpenAI's CEO [explicitly mentioned](https://www.youtube.com/live/outcGtbnMuQ?feature=share&t=1317) last month in the GPT-4 announcement video that GPT-4 isn't hooked up to a calculator.
  
  One can however install plugins on top of ChatGPT, which may connect it to some other resources such as Wolfram as mentioned in [Jaume Oliver Lafont](https://ai.stackexchange.com/users/24014/jaume-oliver-lafont)'s answer.
  
  
  ---
  
  ### Answer by username_11 on 2023-03-23. Score: 1
  
  There is a folk story about [J.W. Gibbs](https://en.wikipedia.org/wiki/Josiah_Willard_Gibbs) that goes something like:
  
  > Being a famous scientist, Gibbs was a member of a number of scientific bodies. He was bored by those and never took a podium. Except for one time. The discussion was about redirecting some effort from teaching mathematics towards more effort at teaching foreign languages. Gibbs decided to give a speech that one time. He said: *"Mathematics is a language."*
  
  I don't know is this story is true or not, but I share the attitude.
  
  > **Comments:**
  > **username_6**: Finally an answer which makes sense. At least GPT's understood it.. Don't know when humans will.  
  
  ---
  
  