<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Konstantine Arkoudas on Medium]]></title>
        <description><![CDATA[Stories by Konstantine Arkoudas on Medium]]></description>
        <link>https://medium.com/@konstantine_45825?source=rss-ce1442da7923------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Konstantine Arkoudas on Medium</title>
            <link>https://medium.com/@konstantine_45825?source=rss-ce1442da7923------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:21:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@konstantine_45825/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[GPT-4 still can’t reason. But it’s a phenomenally useful tool anyway.]]></title>
            <link>https://medium.com/@konstantine_45825/gpt-4-still-cant-reason-but-it-s-a-phenomenally-useful-tool-anyway-326176c68541?source=rss-ce1442da7923------2</link>
            <guid isPermaLink="false">https://medium.com/p/326176c68541</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Konstantine Arkoudas]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 18:06:09 GMT</pubDate>
            <atom:updated>2024-04-11T18:06:09.727Z</atom:updated>
            <content:encoded><![CDATA[<p>[<strong>Note to followers:</strong> Because Medium seems to be becoming an increasingly closed platform, I’m moving to Substack; please<a href="https://konstantinearkoudas.substack.com/"> join me there</a>.]</p><p>I wrote the position paper “GPT-4 Can’t Reason” in late July of 2023, mostly in reaction to some incredible claims that were being circulated about <br>GPT-4’s reasoning abilities. The paper went viral immediately (and recently <a href="https://www.preprints.org/activity/award/anouncement?utm_source=Email&amp;utm_medium=Link&amp;utm_campaign=WinnerNoti1st_0401">earned an award</a> as the second most popular preprint of 2023). Many agreed with its message, but the paper also got a lot of flak (often meted out with the sort of vehemence that religious zealots used to reserve for heretics). After the noise is stripped away, here are the main substantive criticisms that remain:</p><ul><li><strong><em>There are no screenshots</em></strong>. These couldn’t be included in the Latex PDF without blowing up its size to over 100 pages and disrupting the formatting. But full screenshots and timestamps for all problems were included in the postscript of a version of the paper that was published as <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-2eab795e2523">a Medium article</a>.</li><li><strong><em>I can’t reproduce these results</em></strong>. That is also addressed in the same postscript. And it’s addressed even more extensively in <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-addendum-ed79d8452d44">an addendum to the original article</a>, whose main purpose was to: <br>“<em>demonstrate that for a fixed version of GPT-4, it is indeed possible, even in the presence of nondeterminism, to elicit robust, reproducible failures from the model on straightforward reasoning problems. To that end, this article introduces a fresh collection of 12 reasoning problems and shows that GPT-4 fails on them repeatedly and consistently. This is first shown on the OpenAI playground, with detailed screenshots. But this time I also place repeated calls to the GPT-4 API for each problem and record the results. Each problem is sent to the API with a chain-of-thought prompt at least 10 different times, and with a range of different temperatures. I use mostly the standard model with a context size of 8K, but occasionally the 32K version as well. The results show that GPT-4 fails to solve these problems consistently. Different calls might produce different mistakes, due to nondeterminism, but the failures are robust. A tarball including all API calls for all the problems, along with detailed GPT-4 responses, can be downloaded here.”</em></li><li><strong><em>Why is this a new paper if there’s no new test set and no benchmarking?</em></strong> First, this was not “a new paper” intended for publication in a conventional venue (as should be obvious from its size and style). It was a <em>position paper</em> that was simply intended to provoke debate — which it did. Second, the paper discussed the drawbacks of conventional benchmarks, from contamination risks to the fact that multiple-choice tests are inappropriate for LLM evaluation, because the reasoning process leading to a particular choice is anyone’s guess and it’s not uncommon for LLMs to arrive at the right answer for the wrong reason. In my view, in-depth qualitative evaluation in an interrogational style over a number of turns, using novel and carefully phrased problems, is indispensable for a thorough assessment of a model’s capabilities, particularly for tasks like reasoning that are both highly generative and very sensitive to tiny text perturbations.<br>The flakiness of the usual benchmarks has been increasingly recognized since then, by the way. New models regularly come out claiming a top spot in this or that benchmark, but people soon find that the performance of these models in practice disappoints. <a href="https://arxiv.org/pdf/2402.01781v1.pdf">A recent paper</a> (one of whose authors is a former colleague and co-author of mine) showed more systematically that “under existing leaderboards, the relative performance of LLMs is highly sensitive to (often minute) details” and that taking leaderboard rankings at face value “is a (potentially costly) mistake.”</li><li><strong><em>I just tried problem X and it works fine!</em></strong> As noted in <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-2eab795e2523">the Medium version of the article</a>: “<em>Is it possible that new versions of GPT-4 or various tweaks/hacks released by OpenAI might result in consistent behavioral changes to some of these particular problems? Of course. Are such releases likely to fix all possible issues and result in a systematically robust reasoner that can handle more or less any problem thrown its way? If one believes in Church’s thesis then that’s basically impossible, as explained in the introduction.</em>”<br>Admittedly, the last 6–8 months have seen improvements in GPT-4’s overall performance. The one reasoning-related area that has seen the greatest improvement by far, in my view, is reasoning-by-computation: Problems that can be easily solved with a bit of Python code are now much more reliably solved, precisely by compiling them into Python programs. That’s far from foolproof, of course. Oftentimes the code doesn’t work, either because running it produces an error or because the translation was wrong and the result was incorrect, especially if the problem is a bit off the beaten path. More importantly, however, the vast majority of challenging reasoning problems cannot be compiled into simple Python programs. There are deep theoretical reasons for that.</li><li><strong><em>Your paper disses GPT-4 as a stochastic parrot — we all know that’s not true!</em></strong> The paper does no such thing. In fact, it starts out by referring to an earlier article I’d written about GPT-3.5, and summarizes the upshot of that article as follows: “The key takeaways [of the earlier article] were that ChatGPT was a <em>seminal breakthrough</em>; that LLM-based systems are <em>not</em> mere stochastic parrots but build genuine abstractions and can exhibit creativity; that such systems will enable a large array of new and exciting applications.” [my italics] <br>The paper also claimed that GPT-4 delivered “very substantial improvements across the board’’ by comparison to GPT-3.5. <br>Now, if someone claims that (a) GPT-3.5 is <em>not</em> a stochastic parrot; and that (b) GPT-4 is a substantial improvement over GPT-3.5; then it is not a challenging inference to conclude that the someone in question is not dismissing GPT-4 as a stochastic parrot. <br>For good measure, the paper continued with the following: “I remain impressed and excited by the general capabilities and potential of LLMs, and I have little doubt that their performance will continue to improve.” <br>Once more, for the record: Unlike critics like Gary Marcus, who actually believe that GPT-4 <em>is</em> a stochastic parrot, I believe that systems like <br>GPT-4 display signs of genuine intelligence and creativity (though far from AGI levels), and present incredibly exciting opportunities. At the same time, it would be narrow-minded to ignore their limitations. And reasoning, particularly deductive reasoning, remains their Achilles heel. Which is why the article said: “Despite all of the above [impressive capabilities of LLMs], these systems are still severely limited in their reasoning abilities.” There is no contradiction there. But it does require the ability to hold two opposing ideas in mind at the same time without suffering a meltdown.</li></ul><p>Have there been any significant changes since early August? Not really. There have been improvements, of course. The system continues to become more useful across the board, on average. I’ve been using it more or less on a daily basis, both for personal reasons and to solve business problems. But its reasoning performance has not changed much, with the possible exception mentioned above: There is definite improvement on simple reasoning problems that can be straightforwardly translated into code. But, as also mentioned above, most interesting reasoning problems cannot be so translated. Even for the ones that can, if the translation is slightly challenging, the system fails. See below for a example.</p><p>There is another deep underlying reason for the difficulties that was also mentioned above: Reasoning is both highly generative and very sensitive to tiny text perturbations. That sensitivity is one of the reasons why deep learning might simply be the wrong technology for logico-mathematical reasoning. Deep learning tends to work best when the manifold hypothesis holds, i.e., when the data of the problem domain lies in a manifold of a much smaller dimension than that of the encoding space. If you think about images encoded in 2-D pixel arrays, the vast majority of those arrays are not going to represent any meaningful images, they’re just going to be noise. Meaningful images impose a lot more constraints on the pixels of an array. Likewise for text. The vector embedding representation of a page of text has extremely high dimensionality, but any given page of text that is not random noise will be very constrained by comparison (first, it must be composed of words, not just arbitrary ink marks; and then the structure of natural language — grammar and syntax and semantics — imposes a huge number of additional constraints on the set of all possible sequences of words).</p><p>Now, when you think about a piece of text, let’s say a paragraph, there are a lot of nearby similar paragraphs that express pretty much the same meaning. And you can think of those as neighboring points on the text manifold. One can be morphed into another along a smooth continuous path. Once a deep learning model has learned the structure of these manifolds, generalization boils down to interpolation — <em>estimating</em> values for new datapoints based on the learned structure. But if you’re given an uninterpreted logic formula to prove, or a Sudoku puzzle for that matter, it’s not even clear what the manifold neighborhood of that point would look like. Very small changes in the formula (or in the board) often result in huge changes in semantics. The key point is that logico-mathematical information is inherently crisp and not naturally amenable to the sort of approximation/interpolation methodology that underpins deep learning.</p><p>This is not to say that LLMs cannot do <em>some</em> reasoning. Can GPT-4 do fairly shallow abductive and pragmatic reasoning, and perhaps some trivial deductive reasoning? Yes. Abductive and pragmatic reasoning are inherently more elastic anyway, as there is rarely one perfect answer. <br>GPT-4 could already do all that back in the summer. But probe just a bit deeper and the veneer of intelligence quickly fades away. Here is an example I made up and tried yesterday:</p><p><em>Suppose we have 8 square blocks, each colored either green (G), red (R), or white (W), and stacked on top of one another on the 2 x 2 grid formed by the four adjacent plane cells whose lower left coordinates are (0,0), (0,1), (1,0), and (1,1).</em></p><p><em>The initial configuration is this:</em></p><p><em>(0,0): [W, R] (meaning that cell (0,0) has a white block on it, and then a red block on top of that white block.<br>(0,1): [G, G] (green on top of green)<br>(1,0): [W, G] (green on top of white) <br>(1,1): [W, W] (white on top of white)</em></p><p><em>The only move you are allowed to make is to pick up one of the top blocks from a non-empty cell and put it op top of another top block. For example, applying the move (0,1) -&gt; (1,1) to the initial configuration would produce the following configuration:</em></p><p><em>(0,0): [W, R]<br>(0,1): [G] <br>(1,0): [W, G]<br>(1,1): [W, W, G]</em></p><p><em>Either give a sequence of moves resulting in a configuration where no white box is directly on top of another white box, or else prove that no such sequence exists.</em></p><p><em>Think out your answer carefully and step-by-step and explain your reasoning.</em></p><p>Now this is an entirely trivial problem that can be solved in one move: Starting from the initial configuration, pick up the top white block (from cell (1,1)) and put it on top of <em>any</em> other stack. Problem solved. Here is <br>GPT-4’s response:</p><p><em>To solve this, we can analyze the initial configuration and strategize to ensure no white block (W) is directly on top of another white block in the final configuration. The initial setup is:</em></p><p><em>(0,0): [W, R] <br>(0,1): [G, G] <br>(1,0): [W, G] <br>(1,1): [W, W]</em></p><p><em>We want to rearrange these blocks so that no white block is on top of another white block. Let’s analyze the constraints:</em></p><p><em>There are three white blocks, and at least one of them must be at the bottom of a stack because there are only four stacks (one for each cell) and more than four blocks in total. This means we can have at most one stack with a white block at its bottom. To avoid having a white block on top of another white block, we can place them either as the bottom of separate stacks (which isn’t fully possible given the constraint above) or directly on top of blocks of a different color. Since we’re limited in moves to placing one block on top of another stack, we should aim to minimize movements by planning strategically which blocks to move first. The key to solving this is to place the white blocks either at the bottom of stacks or on top of green or red blocks. We have two green blocks initially stacked on top of each other and one red block. This setup allows us to have each white block on a different color block since we have exactly three white blocks and three non-white blocks (two green, one red).</em></p><p><em>Here’s a step-by-step strategy:</em></p><ol><li><em>Move the top green block from (0,1) to on top of the red block at (0,0). This move does not directly contribute to our final goal but helps in repositioning the blocks for future moves.<br>(0,0): [W, R, G] <br>(0,1): [G] <br>(1,0): [W, G] <br>(1,1): [W, W]</em></li><li><em>Move the top white block from (1,1) to on top of the green block at (0,1). This starts to align with our goal by not having this white block directly on another white block.<br>(0,0): [W, R, G] <br>(0,1): [G, W] <br>(1,0): [W, G] <br>(1,1): [W]</em></li><li><em>Now, move the top white block from (1,0) to on top of the white block at (1,1). Although this seems counterintuitive, it’s a preparatory move to free up a different colored block to move under one of the white blocks.<br>(0,0): [W, R, G] <br>(0,1): [G, W] <br>(1,0): [W] <br>(1,1): [W, W]</em></li><li><em>Move the green block from (0,1) to on top of the white block at (1,0). This is the critical move that starts to bring our final configuration into view, placing a green block between the white blocks.<br>(0,0): [W, R, G] <br>(0,1): [W] <br>(1,0): [W, G] <br>(1,1): [W, W]</em></li><li><em>Lastly, move the green block from (1,0) to on top of the stack at (1,1). This final move achieves our goal.<br>(0,0): [W, R, G] <br>(0,1): [W] <br>(1,0): [W] <br>(1,1): [W, W, G]</em></li></ol><p><em>However, upon completing step 4, I realized there’s an oversight in the proposed solution, as it doesn’t align with the goal of having no white block directly on top of another white block in the final configuration. Let’s correct the approach with the aim of meeting our goal more precisely. The challenge lies in ensuring no two white blocks are on top of each other, which was not correctly addressed in the last step.</em></p><p><em>Upon reevaluation, achieving the goal without having any white block on top of another seems impossible with the given configuration and rules because:</em></p><p><em>There are three white blocks but only two blocks (one green and one red) that can serve as intermediaries. At least one white block needs to be at the bottom of a stack due to the sheer number of blocks versus available spaces. Without an additional non-white block to act as a buffer, one white block will inevitably end up directly on top of another white block, given the need to stack all eight blocks within the four available cells.</em></p><p><em>This constraint makes it impossible to configure the blocks such that no white block sits directly atop another, adhering strictly to the initial request and considering the limitations of moveable actions (i.e., only being able to place top blocks onto other top blocks).</em></p><p><em>Thus, with the given constraints and starting configuration, it’s impossible to achieve a configuration where no white block is directly on top of another white block.</em></p><p>All of the usual types of flagrant errors illustrated in the August paper are still occurring. GPT-4 starts out by incorrectly counting the number of white blocks: <em>There are three white blocks, and at least one of them must be at the …</em> (there are, of course, four white blocks, not three). It then incorrectly infers that at least one white block “must be at the bottom of a stack because there are only four stacks (one for each cell) and more than four blocks in total.” This is actually irrelevant to the problem, but it’s false anyway.</p><p>After a number of other incorrect statements, the model goes on to list a sequence of 5 moves, some of them invalid, without any rhyme or reason at all. (In fact the goal is accidentally reached after the second move, but the model fails to realize it.) Afterwards, the model reverses course and falsely argues that the problem is unsolvable.</p><p>Here are the screenshots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*fi5LT89hFGJF9QBnhd0SDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*OrrhaUlZRD8DtaQFAlAwbA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*8sCy1WRAFMpzMoBpBaNrBQ.png" /></figure><p>No system can seriously be said to be able to reason as long as simple (or even trivial) problems can elicit such egregious performance. I look forward to future improvements (and to GPT-5), but as of now, GPT-4 is still not able to reason, as tremendously useful for other purposes as it is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=326176c68541" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LLM Prompting and Classical AI: Budding Romance or a Tango with Two Left Feet?]]></title>
            <link>https://medium.com/@konstantine_45825/llm-prompting-and-classical-ai-budding-romance-or-a-tango-with-two-left-feet-bc7e3800facd?source=rss-ce1442da7923------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc7e3800facd</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[tree-of-thought]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Konstantine Arkoudas]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 16:48:14 GMT</pubDate>
            <atom:updated>2024-09-15T23:34:54.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>On Tree-of-Thoughts prompting, baselines, and coin flipping</h3><h3>Abstract</h3><p>Tree-of-Thoughts (ToT) is an advanced prompting technique that combines LLMs with classical AI search in an attempt to enhance the reasoning capabilities of the former. Impressive performance improvements on problems that are known to be hard for general-purpose LLMs, such as Sudoku, have been reported. ToT is a well-motivated line of work; classical AI search had already been explored <a href="https://arxiv.org/pdf/2112.08726.pdf">in connection with autoregressive decoding</a>, and pursuing a tighter and more explicit integration was the logical next step in an effort to make LLM generation more computationally flexible. Nevertheless, a number of uneasy questions about this research program have remained open, and this article raises and attempts to answer some of these questions:</p><ol><li>The sample problems discussed in the papers that introduced ToT were very small (e.g., the largest Sudoku puzzles tackled were 5x5), so an important empirical question is this: Can ToT scale to larger problem instances, such as conventional 9x9 Sudoku puzzles?</li><li>What accounts for ToT’s reported performance improvements over single-round techniques such as plain COT and self-consistency? Is it the incremental decomposition of a problem into more manageable chunks over multiple rounds, or are there other factors at play?</li><li>What exactly is the contribution of the LLMs? In particular, what do LLMs bring to the table above and beyond classical AI techniques?</li></ol><p>I examine these questions in the setting of Sudoku and game-of-24 puzzles, the two main problems used to introduce ToT. Here is a summary of the corresponding findings:</p><ol><li>For easy 9x9 Sudoku puzzles, ToT’s performance drops from 80% (for 5x5 puzzles) to 14%, even while doubling the iteration budget.</li><li>For Sudoku, the main cause of ToT’s reported gains is plain repetition. ToT poses a problem instance to the LLM dozens or hundreds of times. But because the LLM calls can be viewed as Bernoulli trials (statistically independent and with the same probability of success, given a fixed model and problem), the chances of finding a solution with more trials increase in accordance with the binomial distribution. To test this hypothesis, I used an utterly simplistic algorithm, P+ (“P-plus’’), that does nothing but simply send a single problem instance (with a fixed COT prompt) to the LLM repeatedly, up to the same number of rounds <em>N</em> used in ToT experiments (<em>N</em> = 100 or <em>N</em> = 200). Both for Sudoku and for game-of-24 puzzles, this algorithm outperforms ToT. For instance, using GPT-4 as the LLM and a budget of 100 conversation rounds, ToT’s reported accuracy on the game of 24 was 69%. By contrast, using P+ and GPT-4 on the exact same set of problems with a budget of <em>N</em> = 100 repetitions achieves an accuracy of 89%.</li><li>Blind (uninformed) classical depth-first search that does no reasoning at all outperforms ToT on Sudoku. It solves 100% of all problems (4x4, 5x5, and 9x9) and does so within an average number of iterations that is smaller than the average number of conversation rounds needed by ToT. For game-of-24 puzzles, simple hill-climbing (beam search with beam width 1) based on a naive sampling heuristic of limited horizon outperforms ToT with exactly 4 iterations on average (compared to the 100 iterations allotted to ToT).</li></ol><p>All code and data for the above findings can be found <a href="https://github.com/konstantine4096/tree-of-thoughts/tree/main">here</a>. For those who are not familiar with Sudoku or the game of 24, a brief introduction can be found in the appendix.</p><h3>1. Introduction</h3><p>The difficulties that LLMs face with tasks that require reasoning and the sort of deliberate analysis carried out by “<a href="http://matt.colorado.edu/teaching/highcog/readings/s96.pdf">system 2</a>” cognitive processes <br>have been well-documented by now. (See, for example: <a href="https://arxiv.org/abs/2305.18654"><em>Faith and Fate: Limits of Transformers on Compositionality</em></a>; <a href="https://cacm.acm.org/blogs/blog-cacm/276268-can-llms-really-reason-and-plan/fulltext"><em>Can LLMs Really Reason and Plan?</em></a>; <a href="https://arxiv.org/abs/2309.13638"><em>Embers of Autoregression: Understanding Large Language Models Through the Problem They are Trained to Solve</em></a>; <a href="https://arxiv.org/abs/2309.15129"><em>Evaluating Cognitive Maps and Planning in Large Language Models with CogEval</em></a>; <a href="https://arxiv.org/pdf/2311.09247.pdf"><em>Comparing Humans, GPT-4, and GPT-4V On Abstraction and Reasoning Tasks</em></a>; <a href="https://arxiv.org/pdf/2306.05836.pdf"><em>Can Large Language Models Infer Causation from Correlation?</em></a>;<a href="https://arxiv.org/abs/2309.12288"><em> The Reversal Curse: LLMs trained on “A is B” fail to learn “B is A”</em></a>; and my own <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-2eab795e2523"><em>GPT-4 Can’t Reason</em></a> and its <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-addendum-ed79d8452d44"><em>addendum</em></a>.)</p><p>A fundamental issue underlying these difficulties derives from the <br>inherent computational-complexity limitations of current LLM <br>architectures. In their present form, LLMs generate outputs in low-polynomial time (as a function of the input size and the number of layers), essentially in linear time in the number of layers if we hold input size fixed. But problems that require extensive reasoning or combinatorial analysis are computationally hard. Most of them are NP-hard at best, when given<br>narrow formulations. In unrestricted forms, they become significantly harder (e.g., uncomputable). It would be nothing short of a miracle if a general-purpose tool could reliably solve arbitrary reasoning problems at the push of a button.</p><p>A natural attempt to finesse this challenge is to use LLMs iteratively, <br>making a potentially unbounded number of LLM calls in the course of solving a single problem instance. In practice, of course, there will be hard bounds on such use, imposed by the time spent looking for a solution and the economic cost of LLM inference. But in principle this iterative approach could mitigate the computational limitations mentioned above.</p><p>A prominent line of work along these lines has been Tree-Of-Thoughts (ToT) prompting, which tries to forge a closer working relationship between LLMs and classical AI techniques, most notably classical search algorithms, in the hope of extending the problem-solving reach of LLMs and making them applicable to more demanding system-2-type problems. There are a few different variants of ToT prompting, but they all share the same basic intuition and motivation: leveraging LLMs to explore a classical search space more efficiently. The two papers that independently introduced ToT (<a href="https://arxiv.org/pdf/2305.08291.pdf">one by Long</a> and <a href="https://arxiv.org/pdf/2305.10601.pdf">the other by Yao et al.</a>) illustrated the approach with Sudoku, the game of 24, Mini Crosswords, and “creative writing.” Problems like Sudoku, and even the game of 24, are particularly challenging for LLMs. As of December 2023, even the easiest possible Sudoku puzzles cannot be solved natively by GPT-4 (with a single trial).</p><p>Instead of demanding a solution in one fell swoop, with a single prompt, ToT breaks up the application of LLMs to such problems into a number of steps. In a Sudoku puzzle, for instance, every step might ask the model to fill in one or two blank cells only. Then a ToT “controller” receives the LLM’s output and checks to see if any mistakes were made (e.g., if any Sudoku rules were violated). If there are no errors, we push ahead. Otherwise, the controller gives error feedback to the LLM and asks it to try something else. The process terminates upon finding a solution or exceeding a fixed upper bound on iterations (conversation rounds).</p><p>For those familiar with classical search, this is basically relegating state expansion to the LLM, while the exploration of the search tree itself (e.g., via depth-first search, backtracking, breadth-first search, etc.) is dictated by the controller. The LLM can have other potential uses in such a setting, above and beyond generating states, e.g., it might evaluate the promise of a state by producing a heuristic estimate of its distance from a goal state; these estimates can then be used to perform best-first search, with or without a beam. Such heuristic estimates are produced, for example, by the ToT variant introduced by Yao et al. (The papers also mention more optimal search algorithms like A* as possibilities, but A* imposes stringent formal requirements on the heuristic function and it would be anyone’s guess whether the LLM estimates would adhere to those requirements.)</p><p>Results showed that ToT performance on these problems was significantly better than single-round prompting, whether it was simple prompting, COT prompting, or ensemble-COT prompting (such as self-consistency methods). For example, using GPT-4, <a href="https://arxiv.org/pdf/2305.10601.pdf">Yao et al.</a> reported that their approach solved 74% of 100 game-24 puzzles, whereas GPT-4 queried in plain-COT single-round style solved only 4% of those puzzles. (The 74% figure was subsequently <a href="https://github.com/princeton-nlp/tree-of-thought-llm/blob/master/README.md">replaced by 69%</a>, a change attributed to GPT-4’s non-determinism.) Likewise, working with 10 4x4 Sudoku puzzles, <a href="https://arxiv.org/pdf/2305.08291.pdf">Long</a> reported that GPT-3.5 was able to solve only half (5) of the 10 puzzles when using few-shot COT prompting; only 4 puzzles with one-shot COT; and only 2 puzzles with zero-shot COT. By contrast, his ToT algorithm solved 9 out of the 10 puzzles. These are intriguing results.</p><p>The driving ambition behind this work is to enable LLMs to tackle challenging problems that require intricate reasoning and combinatorial analysis. (For instance, Long suggests that ToT could be applied to propositional satisfiability and constraint-satisfaction problems such as 3-SAT and graph coloring.) I am sympathetic to that objective and any efforts in that direction, because it is clear that general-purpose LLMs as they stand today cannot perform non-trivial reasoning on their own, so it is important to push the envelope, explore alternatives, and see how far the technology can be stretched. It is particularly interesting to see whether classical AI algorithms and LLMs can work in synergy. So the researchers who investigated this approach should be applauded, and I earnestly appreciate their contributions to our collective understanding of these issues.</p><p>However, there is a different interpretation of their results, one which suggests that this particular proposal to marry LLMs with classical search techniques is unlikely to produce a lasting union. The rest of this article will explain why that is the case, and it is structured as follows. Sections 2, 3, and 4 introduce some new datasets and results shedding light on the three issues listed in the abstract: ToT scaling; the effect of repetition; and classical-search baselines. In section 5, I characterize easy and moderately difficult Sudoku puzzles as those that can be solved by Boolean constraint propagation (or unit clause propagation in the setting of propositional satisfiability and DPLL). All 200 Sudoku puzzles that I generated for the experiments reported in this article are of this sort — they can all be solved by exact deduction without the need for any backtracking. This is important because it obviates the need for a scratchpad and erasures; any competent reasoner should be able to solve these puzzles entirely “in their head”. Section 6 wraps things up with some concluding thoughts. For those who are not familiar with Sudoku or the game of 24, the appendix provides brief descriptions of both, as well as their formulations as classical search problems.</p><p>My <a href="https://github.com/konstantine4096/tree-of-thoughts">GitHub repo</a> for this work includes a Python implementation of all classical AI search algorithms operating on tree- and graph-structured state spaces (depth-first, breadth-first, iterative deepening, best-first, beam search, and A*), along with corresponding formulations of Sudoku and games of 24 as classical search problems. The Sudoku source code includes a purely deductive solver that does not rely on search or backtracking.</p><h3>2. Size of Problem Instances and Datasets</h3><p>All of the results reported in the papers that introduced ToT were based on toy problems. Long’s paper, in particular, reported results only on 3x3, 4x4, and 5x5 Sudoku puzzles, all of which are very small. Moreover:</p><ul><li>5 is not even a square number, so 5x5 Sudoku puzzles are different from — and easier than — conventional <em>n</em>² x <em>n</em>² puzzles, which impose additional constraints on all <em>n</em> x <em>n</em> boxes (sub-grids). In fact, even <br>for the square (4x4) puzzles, Long’s code did not check any sub-grid constraints (the source code had a “To Do” note for that check).</li><li>The datasets themselves were small, with results presented only for 10 puzzles from each category (10 3x3 puzzles, 10 4x4 puzzles, and 10 5x5 puzzles). The reported performance was as follows (using the diagram from page 8 of <a href="https://arxiv.org/pdf/2305.08291.pdf">Long’s paper</a>):</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*h5WgH0yhvQAc8Komr0epAQ.png" /><figcaption>ToT results on Sudoku puzzles compared against zero-, one-, and few-shot single-round COT prompting</figcaption></figure><p>To address these points, I generated 100 new 4x4 puzzles and 100 easy 9x9 puzzles, extended Long’s validity checker to ensure that all 2x2 and 3x3 boxes contain unique entries, and ran Long’s ToT code on both datasets, with a budget of 100 conversation rounds for the 4x4 puzzles and 200 for the 9x9 puzzles. The original results had been obtained using GPT-3.5, so I used the same model, but also ran the code using the chat version of LLaMA-70b. Accuracy results (fractions of puzzles that were solved) are as shown in the following table. (Given LLaMA’s poor performance on the 4x4 puzzles, I did not run it on the 9x9 puzzles at all.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*BrPhDD2is6wSQ9O43tnhXw.png" /><figcaption>ToT performance on 100 4x4 and 100 9x9 easy Sudoku puzzles</figcaption></figure><p>Even for the 4x4 puzzles, the results are considerably lower than those originally reported (62% vs 90%), but performance drops even more dramatically for 9x9 puzzles, even with 200 conversation rounds.</p><h3>3. The Role of Repetition</h3><p>Let’s assume that the probability that a task-agnostic LLM will solve an easy Sudoku puzzle in one round (with a single fixed prompt) is given by a Bernoulli random variable <em>X</em> ∼ <em>Bernoulli</em>(0.005). Even though this probability is much higher than what would be expected from a system that was making completely random guesses, it still represents a very low level of skill. If we gave that LLM 50 easy puzzles to solve, one after the other, the smart money would be on the LLM flunking all 50 of them. Not exactly stellar performance.</p><p>But suppose we give the LLM 200 easy puzzles to solve. Now you should bet that the LLM will manage to solve at least one puzzle. The LLM’s problem-solving skills haven’t changed, of course; they’re still as underwhelming as before. However, because the API calls to the LLM are statistically independent, and because the probability of success is fixed across the various calls, the number of successes (solutions) in <em>n</em> trials is a binomial random variable. Consequently, if we try the experiment 200 times in a row, the probability that <em>at least one</em> of the trials will succeed is over 60% (0.634, to be exact). This means that our chances of finding a solution have suddenly increased 126-fold, from 0.005 in one trial to 0.634 in 200 trials — not because we’re doing anything clever, but simply because we’re flipping a lot of coins. No matter how biased a coin might be against heads, as long as the probability of tails is not 1, if we flip the coin enough times it will eventually land heads. In this example, if we call the LLM 500 times, the probability of finding a solution will be 91%. And if we call it 1000 times, we are practically guaranteed to get a solution (the probability would exceed 99%).</p><p>In the case of Sudoku, simply sending a problem to the LLM repeatedly performs slightly better than ToT. In particular, using the same LLM <br>(GPT-3.5) and the same maximum number of rounds (100 for 4x4 puzzles and 200 for 9x9 puzzles) yields the following accuracies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*iS-vCEfYN8ir-cjpEAdkuA.png" /></figure><p>(For the 4x4 case, all 100 puzzles were used for the above comparison; for the 9x9 case, only the first 73 puzzles were used, since the large majority of 9x9 puzzles were not solvable within 200 iterations and even with a relatively low maximum number of tokens, the bill was going up rapidly. But even with only 73 puzzles, the absolute number of successes with P+ was already greater than the absolute number of ToT’s successes on 100 puzzles.)</p><p>For the game of 24, the naive P+ method gives an accuracy of 89%, compared to the 69% of ToT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*hskLCyn_3DlJi2jhPkzomA.png" /></figure><p>Both ToT and P+ used GPT-4 as the LLM (though ToT used the version of GPT-4 that was available several months earlier). Note that only 8 out of the 100 games of 24 were solved by P+ on the first try, so if single-round prompting was being tested with only one attempt, the accuracy would have been a meager 8%. On average, GPT-4 required 22.2 attempts to arrive at a correct solution. Refer to the appendix (or to the <a href="https://github.com/konstantine4096/tree-of-thoughts/blob/main/main.py">source code</a>) for the prompts that were used for both problems. Here is the exact frequency distribution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suUpst7K4GOVdGybfFh_Ng.png" /></figure><p>As expected, this is a right-skewed, geometric-like distribution for the number of trials needed to get a success (a solution in our case), with the peak of the probability mass concentrated on the first trial and a long tail extending to the maximum allowed number of trials (100).</p><h3>4. Classical AI Search Baseline</h3><p>Another elephant in the ToT room is this: For the types of combinatorially challenging problems targeted by ToT-style methods, <em>we already have techniques that perform very well</em>, so what is the point of bringing LLMs to bear on these problems? Is there any evidence to suggest that the combination of general-purpose LLMs with classical AI techniques <br>outperforms classical AI techniques by themselves, <em>sans</em> LLMs? To put it another way: What do LLMs bring to the table? What contribution do they make above and beyond the classical techniques?</p><p>Oddly enough, it seems that this question has not been addressed. The papers that introduced ToT compared its performance only against single-round LLM prompting, but not against pre-existing algorithms. It turns out that, for the two problems discussed here, the LLMs either make no contribution at all, or, in the case of Sudoku, make a net negative contribution. In particular, ToT does worse than essentially <em>blind</em> depth-first search, which does not do any reasoning but instead simply chooses a blank cell and puts there any value that doesn’t yet appear in the cell’s row and column. Out the 100 freshly generated 4x4 Sudoku puzzles, Long’s ToT algorithm powered by GPT-3.5 solves 62 of them within 100 conversation rounds, but the simple DFS (depth-first search) algorithm just mentioned solves all 100 of them. Moreover, it solves them with the same or smaller average number of iterations than that required by ToT (22 DFS iterations vs ToT’s 27 rounds of conversation), and with the significant added advantage of being orders of magnitude faster and cheaper. When we graduate to regular (9x9) Sudoku puzzles, albeit easy ones, the performance gap becomes much wider: From 100 easy 9x9 puzzles, ToT solves 14 of them with 180 iterations on average, while DFS solves all 100 of them instantly, with an average of 128 iterations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*oxqqXqYdSIs2vcYviaVGPw.png" /></figure><p>Why does uninformed search perform better than ToT? Mostly because LLMs find novel ways to make mistakes, beyond the making of simply incorrect Sudoku moves. ChatGPT, for instance, makes formatting mistakes, e.g., neglecting to output the requested JSON; it makes notational mistakes, e.g., it might fill in a blank cell with 0 instead of a valid digit from 1 to 9; it might stop producing output prematurely; it makes JSON mistakes, e.g., using single instead of double quotation marks; sometimes it fails to make a move at all, giving as output the exact same board given as input (with plenty of blank cells waiting to be filled); it erases numbers from the input board, turning them into blanks, e.g., a row in the input board like [[2, 1, *, *, *, *, *, 4, 8]] might become [[*, 1, *, *, *, *, *, 4, 8]] in ChatGPT’s output, and indeed sometimes it might go, in one single step, from a fully — if incorrectly — filled board to an almost completely blank one; it changes the dimensions of Sudoku boards, e.g., some rows in the output might contain fewer or more cells than other rows; it might reject puzzles that are not 9x9 (e.g., complaining that “a standard Sudoku grid is a 9x9 grid consisting of 9 3x3 subgrids”); it might simply refuse to produce an output, complaining that “as a language model, I cannot solve puzzles”; if the temperature is high the model might literally start producing gibberish in the middle of the output; and so on. None of these errors are possible with a few lines of code that simply pick a cell and put any plausible number there.</p><p>For the game of 24, simple DFS also solves all 100 problems, but with a higher average number of iterations (around 500). A simple heuristic distance function based on sampling allows for extremely efficient beam search. The heuristic randomly combines all available numbers in a state with numeric operations (up to a maximum number of samples), and then takes the minimum absolute distance of the combined results from 24; this is very similar to — but more systematic than — what GPT-4 does in the state-evaluation phase of ToT for games of 24. Using this heuristic and a maximum of only 20 samples, best-first search with a beam width of 1 outperforms ToT with GPT-4, solving 80% of the problems with essentially zero search.</p><h3>5. A Closer Look at Easy Sudoku Puzzles</h3><p>It is worth stressing that all of the Sudoku problems used in these experiments, both in the 4x4 and in the 9x9 category, can be solved by exact deduction, i.e., using reasoning only, <em>without the need for<br>any backtracking</em>. For example, consider one of the 9x9 puzzles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*yCkiTITIc4mp1Spk8DjQCg.png" /></figure><p>We see that the third row is missing 6 digits, among them 1. So 1 must be placed <em>somewhere</em> in the third row. Now, it cannot go into the blank cell (3,1), because the column of that cell already contains 1. It cannot go anywhere in the second box either (positions (3,4), (3,5), or(3,6)), because that box already contains 1 (in cell (2,6)). The only candidates left are (3,8) and (3,9). But (3,8) can also be ruled out, because that cell’s column already contains 1. Hence, on the third row, 1 <em>must</em> go into the very last column; there is no other alternative. We thus say that cell (3,9) is <em>uniquely determined</em> (or a <em>naked single</em> in Sudoku terminology):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*2TubvCJBKkcnlsalygDyQQ.png" /></figure><p>To put it slightly more formally, we know a priori that 1 must go into one of the 6 blank cells of row 3. Using letter-number notation <strong>[1]</strong>, this can be expressed as the following disjunction:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*iKE9i-d1cpnXXnp2-RTfng.png" /></figure><p>But we have already noted all of the following negative conclusions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*3vAOZ5RIZ2CG-PbfErajnQ.png" /></figure><p>Thus, from these two sentences we infer <em>C9</em> = 1.</p><p>There are many other exact deductions we can make along similar lines, e.g., cell <em>A1</em> must contain 2, <em>A6</em> must contain 7, <em>C8</em> must contain 3, and so on. In total, we can deduce the values of 13 out of the puzzle’s 42 blanks cells:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*Ln4y5kEYiz4Zsu_wczEVoA.png" /></figure><p>But these deductions have consequences. For instance, the 1 that we put in <em>C9</em> in turn fixes the position of 1 on the very first row, which now <em>must</em> go into <em>A3</em>, making that cell uniquely determined:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/1*r3w0gbddrK2AIt_cEyZ02g.png" /></figure><p>In fact, our first round of 13 deductions enables a second round of 11 exact deductions, i.e., it renders an additional 11 cells uniquely determined. These 11 deductions, in turn, enable a third round of another 11 exact deductions, followed by a final round of 7 exact deductions, at which point the puzzle is fully solved.</p><p>Of course, the reasoning does not need to proceed in that exact order. But the point is that there is no guesswork involved, no need to “try out” something and then backtrack if the attempt fails. This is not true in general. Harder Sudoku puzzles do require guessing and backtracking. But none of the puzzles used in these experiments did.</p><p>The deductions illustrated above capture the essence of <em>Boolean constraint propagation</em>, or BCP for short, one of the most straightforward and computationally efficient reasoning procedures, and one that is not only widely used in computational logic but is also pervasive in everyday life <br>(even if we’re not explicitly aware of it). BCP operates on conditionals of the form</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*TAneb1abzA0ySQkixhvxVg.png" /></figure><p><em>n</em> &gt; 0, where the <em>lᵢ</em> and <em>l</em> are <em>literals</em> (namely, either atomic sentences or negations thereof). If we manage to derive all <em>n</em> antecedents, <em>l</em>₁, …, <em>lₙ</em>, we can then apply modus ponens to the above conditional and the conjunction <em>l</em>₁ ∧ … ∧ <em>lₙ </em>to conclude <em>l</em>. Then <em>l</em> by itself might become a premise in a second round of BCP, and so on until we reach a fixed point (when no new conclusions can be extracted). This is precisely the reasoning that characterizes the solving of easy and moderately difficult Sudoku puzzles.</p><p>Note that the above conditional is equivalent to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*Y19PQ2MKhyUYjPZ99LZnlg.png" /></figure><p>where the bar over the <em>lᵢ </em>here denotes <em>complementation </em><strong>[2]</strong>. The equivalence holds because a conditional <em>p</em> ⇒ <em>q</em> means the same thing as ¬ <em>p </em>∨ <em>q</em>. (To see this, recall that the conditional <em>p</em> ⇒ <em>q </em>can only be false if <em>p</em> is true and <em>q</em> is false. It is true under all of the other three ways of assigning truth values to <em>p</em> and <em>q</em>: (1) <em>p</em> ↦ <em>true</em>, q ↦ <em>true</em>; (2) <em>p</em> ↦ <em>false</em>, <em>q</em> ↦ <em>true</em>; and (3) <em>p</em> ↦ <em>false</em>, <em>q</em> ↦ <em>false</em>. The disjunction ¬ <em>p</em> ∨ <em>q</em> captures exactly these three possibilities.) When the antecedent <em>p</em> is a conjunction <em>p</em>₁ ∧ … ∧ <em>pₙ</em>, then ¬ <em>p</em> ∨ <em>q</em> becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*t6Ta7hg01u8riw4QJwzdrA.png" /></figure><p>which, by De Morgan’s laws, becomes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/249/1*gEfVYGxqusFSDNQmkvEjHA.png" /></figure><p>The formula</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/1*eZGlF4DSGNHUopHmpbl6gQ.png" /></figure><p>is simply a more convenient formulation of the above.</p><p>We can now formulate BCP more precisely as the following inference rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*VqUgyQp-GVGobim3dmSpqw.png" /></figure><p>or, equivalently, as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/1*N4bnu4_ns0tOf02teG30jg.png" /></figure><p>In the context of resolution theorem proving and satisfiability, this is known as <em>unit clause resolution</em> (because the second premise, the complement of <em>l</em>₁, is a unit clause, with only one literal). In that setting, BCP boils down mostly <strong>[3]</strong> to <em>unit clause propagation</em>, or simply <em>unit propagation</em>, which has an extremely efficient implementation (linear-time in the number of clauses).</p><p>To illustrate the practical relevance of this type of reasoning, suppose you are home and about to drive to work. You walk outside to your car and realize you forgot your car key inside. You remember that you’ve left the key either in the bedroom or in the living room, <em>B</em> ∨<em> L</em>, so you don’t need to search the entire house. You go back in, you look in the bedroom, and do not find the key there: ¬ <em>B</em>. Accordingly, you now conclude that the key is in the living room, <em>L, </em>and you go and find it there. This is an instance of the above rule schema, with <em>n</em> = 1. We reason like that all the time, even if we don’t consciously realize it.</p><p>Applying unit clause propagation to the disjunction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*90ez04X87fmGeS10FHPFHw.png" /></figure><p>and the negative conclusion <strong><em>C1</em> ≠ </strong>1 gives the disjunction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*bC9YbJyD9BDUIObMe3KDSA.png" /></figure><p>Now applying unit clause propagation to this disjunction and <em>C4 ≠ 1</em> narrows things further to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*OpVQpXddfHoVIGoKRzxgoA.png" /></figure><p>Continuing with the rest of the negative conclusions eventually leads to the conclusion <em>C9</em> = 1.</p><p>The negative conclusions can themselves be derived through unit clause propagation, applied to general Sudoku rules and positive observation literals, such as <em>E1</em> = 1. For instance, the conditional <em>E1</em> = 1 ⇒ <em>C</em>1 ≠ 1, which is equivalent to the disjunction <em>E</em>1 ≠ 1 ∨ <em>C</em>1 ≠ 1, is a general Sudoku constraint reflecting the rule that only one cell in the first column may contain the digit 1. Applying unit clause propagation to this rule and the literal <em>E</em>1 = 1, which follows by simple inspection of the given board, yields the first negative conclusion <em>C</em>1 ≠ 1 above.</p><h3>6. Conclusions</h3><p>In this article I have argued that ToT-like attempts to integrate LLMs with classical AI search techniques are ineffective. They are unlikely to scale successfully to realistic problem instances, and, even for toy problems, they are outperformed by the naive method of repeatedly sending a problem instance to an LLM. They are also outperformed by naive classical search algorithms. Waiting for 200 LLM “conversation rounds” to solve a trivial 9x9 Sudoku puzzle takes 20–30 minutes, requires GPU computation (expensive hardware consuming several hundred watts of electricity) that might cost about 25 cents as of early 2024, and results in failure with probability 92%. By contrast, uninformed depth-first search succeeds 100% of the time in a few milliseconds (in Python; the time would be sub-millisecond in a language like C++), and costs an infinitesimal fraction of a cent, running on a cheap CPU that consumes about 50 watts of electricity. Indeed, search algorithms routinely solve problems in state spaces comprising quintillions (billions of billions) of states; for concrete examples, see Section 1.3 of <a href="https://shop.elsevier.com/books/heuristic-search/edelkamp/978-0-12-372512-7"><em>Heuristic Search: Theory and Applications</em></a>. Likewise, contemporary SAT and SMT solvers solve problems with many millions of variables and clauses, while CSP solvers can solve <em>N</em>-queens problems (placing <em>N</em> queens on a <em>N</em> x <em>N</em> chess board so that no queen can attack any other queen) for values of <em>N</em> exceeding 1,000,000. It is difficult to imagine that bringing LLMs into the picture will provide any benefits. (For perspective, cutting-edge LLMs have trouble placing N ≤ 8 queens on a chessboard.)</p><p>One might think that ToT can be more effective on unstructured problems that do not have a crisp formulation as conventional state-space search problems. The task of “creative writing” proposed by <a href="https://arxiv.org/pdf/2305.10601.pdf">Yao et al.</a> might be an example: 4 random English sentences are given as input and the system has to generate a “coherent” passage of 4 paragraphs, where the last sentence of each paragraph must be one of the 4 input sentences. Because the task is ambiguous (e.g., what texts count as coherent is somewhat subjective), there is no sharp formulation of it as a search problem. Indeed, it’s not clear what the states are, what the successor operators are, or what constitutes a goal state, apart from whatever judgments are made by the LLM itself (that is to say, there is no objective criterion for determining whether a solution has been found, apart from the LLM’s own opinion). To call this a “search problem” in the classical AI sense strains the meaning of the term to the point where it becomes applicable to any generation process comprising a sequence of steps, some of which generate candidate outputs and others evaluate them. Indeed, Yao et al.’s own ToT formulation of creative writing is much more similar to methods with a generate-and-test flavor (such as <a href="https://arxiv.org/pdf/2203.11171.pdf">self-consistency</a>) than it is to classical search: First the LLM generates five “plans” for how to come up with the requested story, then it generates five stories by following the best plan, and finally it picks the best of the five. What counts as the best plan and the best story is determined by the LLM.</p><p>Finally, throughout this article I have consistently talked about “general-purpose” or “task-agnostic” LLMs. Models that are fine-tuned to solve <em>specific</em> problems might well perform better. It is not unreasonable, for example, to expect that a large model that has been fine-tuned on many individual Sudoku moves, possibly along with corresponding explanations, might develop useful representations and heuristics enabling it to perform much better than generic off-the-shelf models.</p><p>More importantly, I am not at all suggesting that machine learning has nothing to offer to classical AI. Statistical and symbolic AI techniques have already been productively coupled for decades, from narrow applications such as learning linear ranking functions to control classical search in planning systems or using beam search and A* in probabilistic parsing to entire fields such as ILP (inductive logic programming) and SRL (statistical relational learning). But the question is whether general-purpose LLMs can be combined with classical AI algorithms to produce a system that is greater than the sum of its parts. The jury might still be out on that question, but the current offerings do not provide an affirmative answer.</p><h3>Appendix: Background on Sudoku and Game of 24</h3><p>A regular Sudoku puzzle comes in a 9x9 grid whose every cell is either blank or else contains a number from 1 to 9. The objective is to fill in the blank cells with the missing numbers, in such a way that every number from 1 to 9 appears <em>exactly once</em> in every row, every column, and every 3x3 sub-grid (“box”). Generalizing, we may consider Sudoku puzzles of dimension <em>n</em>² x <em>n</em>² for any integer <em>n</em> &gt; 1: 4x4, 9x9, 16x16, and so on. In each case, the numbers we have to work with are 1 through <em>n</em>². Note, however, that there is nothing special about numbers; the game can be played just as well with any <em>n</em>² distinct objects (e.g., letters). In the generalized setting, it is easy to show that the problem of solving a Sudoku puzzle of dimension <em>n</em>² x <em>n</em>² is NP-complete, by reducing to it the NP-hard problem of <a href="https://en.wikipedia.org/wiki/Latin_square">Latin square</a> completion. At first glance these puzzles might appear to be idle games, but their NP-completeness means that they actually have practical applications. For instance,<a href="https://www.khoury.northeastern.edu/home/koods/papers/hajirasouliha07latin.pdf"> wavelength routing in optical networks is essentially a Latin square completion problem</a>, which is the logical core of Sudoku.<strong> [4]</strong></p><p>Sudoku has also been studied by <a href="https://bpb-us-w2.wpmucdn.com/web.sas.upenn.edu/dist/c/183/files/2016/08/Lee-Goodwin-Johnson-Laird-2008-Sudoku-THINKING-REASONING-16xkg99.pdf">psychologists of reasoning</a>. Johnson-Laird views Sudoku as a game that depends “on pure deduction,” as the rules of Sudoku depend only on an understanding of the meaning of alternating quantifiers (for example, “every number must occur exactly once in every row” is a universal quantifier followed by a unique existential quantifier and then a final universal quantifier), which makes Sudoku puzzles “natural experiments in reasoning” <strong>[5]</strong>.</p><p>Setting up <em>n</em>² x <em>n</em>² Sudoku puzzles as classical search problems is straightforward. A state is a partially filled board. A state representing an incomplete board can be expanded into<em> k</em> successor states, for some <em>k</em> ≤ <em>n</em>², by choosing a blank cell to fill (say, the first blank cell found when scanning the grid from top to bottom and from left to right); a unique successor state is obtained for every possible number that can be put in the chosen cell. For details, see <a href="https://github.com/konstantine4096/tree-of-thoughts/blob/main/sudoku.py">the formulation in the repo</a>.</p><p>In the <a href="https://en.wikipedia.org/wiki/24_(puzzle)">game of 24</a>, the objective is to apply standard arithmetic operations (addition, subtraction, multiplication, and division) to four given integers in such a way as to produce the result 24. For example, given the numbers 2, 4, 5, and 10, we can compute 24 as follows: (10 + 4) + (2 * 5). Each of the four numbers must be used exactly once.</p><p>A solution can always be expressed as a sequence of three equations, in this case: (i) 10 + 4 = 14; (ii) 2 * 5 = 10; (iii) 14 + 10 = 24. This is also how <a href="https://arxiv.org/pdf/2305.10601.pdf">Yao et al.</a> formulate the game as a search problem, and I’ve done the same. As can be seen <a href="https://github.com/konstantine4096/tree-of-thoughts/blob/main/twenty_four.py">in the source code</a>, a state consists of a list of 0 to 3 equations, along with a list containing the remaining <em>available numbers</em>. Accordingly, a state can be viewed as a pair of lists (<em>E</em>,<em>A</em>), where <em>E</em> contains equations and <em>A</em> contains numbers. Given four numbers <em>a</em>, <em>b</em>, <em>c</em>, and <em>d</em>, the initial state is ([],[<em>a</em>, <em>b</em>, <em>c</em>, <em>d</em>]), i.e., initially all 4 numbers are available and there are no equations. A state<em> s</em> = (<em>E</em>,<em>A</em>) represents a solution iff <em>A</em> = [24]. We can expand a state <em>s</em> = (<em>E</em>,<em>A</em>) into a list of successor states only if <em>A</em> contains at least two numbers, otherwise <em>s</em> is a leaf state. If <em>s</em> does have at least two available numbers, successor states <em>s</em>’ = (<em>E’</em>, <em>A’</em>) are obtained by choosing any two distinct indices <em>i</em> and <em>j</em> from the list <em>A</em> <strong>[6]</strong> and an arithmetic operation <em>op</em>; we then have:</p><p><em>E’</em> = <em>E </em>+ [(<em>A</em>[<em>i</em>] <em>op</em> <em>A</em>[<em>j</em>] = <em>v</em>)] and <em>A’</em> = (<em>A</em> \ {<em>i</em>, j}) + [<em>v</em>],</p><p>where + here denotes list concatenation; <em>v</em> is the result of performing the operation <em>op</em> on <em>A</em>[<em>i</em>] and <em>A</em>[<em>j</em>]; and <em>A</em> \ {<em>i</em>, <em>j</em>} is the list obtained by removing from <em>A</em> the elements corresponding to indices <em>i</em> and <em>j </em>(in Python notation, the list obtained by performing <em>A.pop(i)</em> and <em>A.pop(j)</em>). In the example of 2, 4, 5, and 10, a complete path from the initial state to a solution can be depicted as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cM6m_y9NL1JY24l2JwV-uA.png" /></figure><p>Here is the single one-shot prompt that I used with P+ for games of 24:</p><blockquote>You are an expert solver of game-of-24 puzzles, where you are given 4 positive integers and you use the four arithmetic operators +, -, *, and /, along with left and right parentheses, to come up with an expression whose value is 24. Each of the four given integers must appear exactly once in the output expression. Here is an example of how such a puzzle is solved when the four given integers are 6, 8, 12, and 5. The puzzle is solved by coming up with three intermediate equations:</blockquote><blockquote>First intermediate equation: 8 + 12. This gives a result of 20. Thus, the available numbers now are 6, 5, and 20.<br>Second intermediate equation: 20 / 5. This gives a result of 4. Thus, the available numbers now are 6 and 4. <br>Third intermediate equation: 6 * 4. This gives the desired result of 24.</blockquote><blockquote>Thus, putting it all together, the output expression is: ((8 + 12) / 5) * 6. This expression is a solution because its value is 24 and it uses every given integer exactly once. Now please try to solve the puzzle where the four given integers are these: &lt;4 integers here&gt; . Take a deep breath and think this out step-by-step, explaining your reasoning along the way. Return your final solution in the following JSON format: { “expression”: “&lt;your output expression&gt;” }.</blockquote><p>The prompt that P+ used for the 9x9 Sudoku puzzles is essentially the same text that Long used in his paper, and uses only one 3x3 example:</p><blockquote>Here is an example showing how to solve the 3x3 Sudoku puzzle [[1, *, *], [*, 1, *], [*, 2, *]], where * represents a blank cell to be filled in. First, notice that the second column already has 1 and 2, so the first cell in the second row needs to be 3. After this step, the first row has 1 and 3. Hence the last cell in the first row must be 2. Now, look at the cell at the intersection of the second row and the third column. It must be 3. As a result, the cell at the intersection of the third row and the third column must be 1. The remaining cells are now easy to fill in. In conclusion, the puzzle solution is [[1, 3, 2], [2, 1, 3], [3, 2, 1]].</blockquote><blockquote>Please try to solve this &lt;grid dimension here&gt; Sudoku puzzle: &lt;puzzle here&gt;. Make sure to fill in all the blank cells, and return your solution in the following JSON format: { “rows”: [] }.</blockquote><h3>Endnotes</h3><p><strong>[1]</strong> In this notation, which is popular in Sudoku circles, the rows are labeled <em>A</em> through <em>I</em> and the columns are numbered 1 through 9 (so that, for example, the leftmost cell of the first row is <em>A1</em>).</p><p><strong>[2]</strong> For a positive literal <em>l = A</em> (for some atomic sentence <em>A</em>), the complement of <em>l </em>is the negation ¬ <em>A:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/126/1*2pnb_YKP3m7bt7VOS9dTmg.png" /></figure><p>When l is a negative literal, <em>l =</em> ¬ <em>A</em>, the complement is simply A:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/114/1*PIqvpPfnX-x8SfBCWX4U3w.png" /></figure><p><strong>[3]</strong> In the context of SAT solving, BCP includes a similar technique known as <em>pure-literal propagation</em>. See Section 4.13 of <a href="https://mitpress.mit.edu/9780262035538/fundamental-proof-methods-in-computer-science/"><em>Fundamental Proof Methods in Computer Science</em></a> for details.</p><p><strong>[4]</strong> Of course, for the purposes of solving puzzles of a <em>fixed</em> size (say, conventional 9x9 puzzles), NP-completeness is not particularly pertinent; from a computational-complexity perspective, all <em>n</em>² x <em>n</em>² puzzles for fixed <em>n</em> are solvable in O(1) time, as there is a finite number of such puzzles and their solutions can be simply memorized — in theory anyway.</p><p><strong>[5]</strong> See Johnson-Laird’s <a href="https://global.oup.com/academic/product/how-we-reason-9780198569763"><em>How we Reason</em></a>, pp. 264–265.</p><p><strong>[6]</strong> In Python notation, <em>i</em> and <em>j</em> are elements of the range from 0 to <em>len</em>(<em>A</em>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc7e3800facd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPT-4 Can’t Reason: Addendum]]></title>
            <link>https://medium.com/@konstantine_45825/gpt-4-cant-reason-addendum-ed79d8452d44?source=rss-ce1442da7923------2</link>
            <guid isPermaLink="false">https://medium.com/p/ed79d8452d44</guid>
            <category><![CDATA[reasoning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[agi]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Konstantine Arkoudas]]></dc:creator>
            <pubDate>Sun, 03 Sep 2023 15:44:57 GMT</pubDate>
            <atom:updated>2023-09-03T15:44:57.040Z</atom:updated>
            <content:encoded><![CDATA[<p>In a recent preprint of a position paper I argued that <a href="https://www.preprints.org/manuscript/202308.0148/v2">GPT-4 can’t reason</a>. That position was largely based on an analysis of GPT-4’s behavior on a diverse set of over 20 simple reasoning problems. GPT-4 outputs for these problems were obtained on the OpenAI playground over a period of months, stretching from April to late July. Screenshots depicting these interactions were provided <a href="https://medium.com/@konstantine_45825/gpt-4-cant-reason-2eab795e2523">for all of the problems</a>, along with corresponding timestamps.</p><p>During that time period, however, GPT-4’s behavior changed, due to model updates made by OpenAI. As a result, the outputs described in the paper for some of these problems could not be easily reproduced. Of course, even with a <em>fixed</em> model one might get different outputs for the exact same input, due to GPT-4’s <a href="https://152334h.github.io/blog/non-determinism-in-gpt-4/">rampant nondeterminism</a>. But certainly the deployed GPT-4 model changed repeatedly during that period, in ways that were not transparent; and these changes, in combination with nondeterminism, made it challenging to reproduce some (though far from all) of the paper’s results.</p><p>To a large extent that is immaterial, as the paper was intended to provoke discussion, and the position it put forth doesn’t rest on any one particular example of even subset of examples. Nevertheless, I would like to demonstrate that for a <em>fixed</em> version of GPT-4, it is indeed possible, even in the presence of nondeterminism, to elicit robust, reproducible failures from the model on straightforward reasoning problems. To that end, this article introduces a fresh collection of 12 reasoning problems and shows that GPT-4 fails on them repeatedly and consistently. This is first shown on the OpenAI playground, with detailed screenshots. But this time I also place repeated calls to the GPT-4 API for each problem and record the results. Each problem is sent to the API with a chain-of-thought prompt at least 10 different times, and with a range of different temperatures. I use mostly the standard model with a context size of 8K, but occasionally the 32K version as well. The results show that GPT-4 fails to solve these problems consistently. Different calls might produce different mistakes, due to nondeterminism, but the failures are robust. A tarball including all API calls for all the problems, along with detailed GPT-4 responses, can be downloaded <a href="https://www.dropbox.com/scl/fi/lmsc9wz5s58f4uo8p2798/gpt4_12_reasoning_problems.tar?rlkey=aundss91libkqsyuzdopo8iu7&amp;dl=0">here</a>.</p><p>Needless to say, GPT-4’s behavior on these problems too might change in the future as OpenAI tweaks their model. This will not mean that the underlying issues will have suddenly vanished. Indeed, in the absence of radical architecture/paradigm changes, it is quite unlikely that any incremental changes to the model will make a substantial difference in reasoning capability.</p><h3>1. String Structure</h3><p>Here we give GPT-4 a simple grammar that generates all and only strings of the following form: a number <em>n</em> ≥ 0 of a’s, followed by <em>n+2</em> b’s, followed by <em>n</em> c’s. We then ask it to give us a few strings generated by this grammar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*kHXOLrzfQWTbXGScyjIeVg.png" /></figure><p>Only one of these 20 strings is correct — the very first one, for n = 0. None of the other strings are generated by the given grammar. One recurring error is that every block of <em>n &gt; 0</em> c’s is immediately preceded by an ‘a’ instead of a block of <em>n+2</em> b’s. But this is not the only error. The counts are often wrong as well, e.g., for <em>n = 2</em> we get the output <em>aabbacc</em>, which only has 2 b’s (it should have 4).</p><p>Are these errors robust? Yes. Twenty different API calls to GPT-4, with various different temperatures, produce outputs that are consistently incorrect. To simplify the problem, the API calls only requested 10 strings (instead of 20). Here is the exact prompt that was used:</p><blockquote>Consider the following grammar: G = a^nb^{n+2}c^n. Give me 10 random strings generated by G. Think this out step-by-step and take your time to ensure that the strings you produce are indeed generated by G.</blockquote><p>Full output details are available in the aforementioned file attachment, but here are some samples:</p><blockquote>aaaaaaaaaaabbbbbbbbbccc: Here, n=7. So, the string contains 7 ‘a’s, 7+2=9 ‘b’s, and 7 ‘c’s.</blockquote><p>(In reality, the string contains 11 a’s, 9 b’s, and 3 c’s).</p><blockquote>aaaabbbbcc: this string follows the grammar because there are 3 ‘a’s, 3+2=5 ‘b’s, and 3 ‘c’s.</blockquote><p>(The string contains 4 a’s, 4 b’s, and 2 c’s).</p><p>Performance degenerates to even worse levels by adding an extra terminal symbol to the end of the sole production in the grammar. For example, if we change <em>G</em>’s definition to <em>a^nb^{n+2}c^nd^{n+5}</em>, so that <em>n+5</em> d’s are needed at the end, we get outputs such as these (from 3 different API calls; GPT-4 output is shown in italics, my own comments are printed inside parentheses in regular font):</p><ol><li><em>abbbcd </em>(only one occurrence of ‘d’ at the end)</li><li><em>aaaabbbbcccd-dddd-d</em> (note the dashes in the output).</li><li><em>aaaaaaaaabbbbbbbbbbbbbbcccccccccdfffffffffffff<br>In this string, n=9. We have 9 occurrences of ‘a’, 11 occurrences of ‘b’, 9 occurrences of ‘c’, and 14 occurrences of ‘d’. </em>(There is only one occurrence of ‘d’ and multiple occurrences of ‘f’, a symbol that doesn’t even occur at all in the given grammar.)</li></ol><p>With more terminals at the end of the production, performance becomes altogether catastrophic, e.g., with <em>G = a^nb^{n+2}c^nd^{n+5}a^{n+3}</em> we get outputs that don’t even respect the bare-bones structural constraint that we should have a’s then b’s then c’s then d’s and then a’s again:</p><blockquote>aabbbcccddddddeeeeaabbbcccddddddeeee” — Here, n=2, so we have 2 ‘a’s, 4 ‘b’s, 2 ‘c’s, 7 ‘d’s, and 5 ‘e’s.</blockquote><p>This is consistent with <a href="https://arxiv.org/abs/2305.18654">other experimental evidence</a> showing that transformer-based LLMs such as GPT-4 memorize single-step reasoning operations well but have a hard time composing them correctly into longer reasoning paths, with errors accumulating exponentially with the length of the path.</p><h3>2. Blocks Again</h3><p>This is a simple variation of the problem that appeared <a href="https://www.preprints.org/manuscript/202308.0148/v1">in the preprint</a> (problem 3.11). It is solved by a simple case analysis of the color of the 47th block: If it’s red, then q holds: we have a red block (the 47th one) sitting on top of a non-red block (the 48th, green block). And if it’s not red, we also have a red block (the 46th one) sitting on top of a non-red one (the 47th one). That’s it.</p><p>GPT-4 claims that the conclusion does not follow and produces the following spurious countermodel:</p><blockquote>1–45: Any color<br>46: Red<br>47: Red<br>48: Green<br>49–100: Any color</blockquote><p>claiming that “In this countermodel, no red block is directly on top of a non-red block”, even though that’s obviously false in view of block 47.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*xxJkOZGjuBohUOPjEF4PNA.png" /><figcaption>R</figcaption></figure><p>Repeating the experiment a number of times does not help. 10 API calls to GPT-4 with different temperatures (from 0.0001 to 0.9) all give the same result, that <em>q</em> does not follow; and all of them involve bogus countermodels. Sometimes the very descriptions of the countermodels are incoherent. For example:</p><blockquote>A countermodel could be a situation where all the blocks except the 46th and 48th are red. In this case, the 46th block (which is red) is not directly on top of a non-red block, so the claim q would be false.</blockquote><p>Here we are told that all blocks are red <em>except</em> for 46 and 48, only to be then told that block 46 is red. This is another illustration of the rampant internal inconsistency pointed out in the preprint. In addition, of course, the conclusion that <em>q</em> doesn’t hold couldn’t possibly be established just by considering one particular block (46) in the case.</p><h3>3. Toy Deduction</h3><blockquote>Consider the following two sentences: <br>p1: (forall x . P(x) &lt;==&gt; ~ [Q(x) \/ T(x)]) <br>p2: ~ [exists x . ~P(x) &amp; (~Q(x) \/ ~T(x))] <br>Either disprove or else prove that the following conclusion follows from p1and p2: p3: [forall x . Q(x) &lt;==&gt; T(x)] <br>To disprove this, you would need to provide a model that satisfies p1 and p2 but falsifies p3.</blockquote><p>This is a toy problem in deductive reasoning: <em>p1</em> tells us that if <em>P</em> holds then we have <em>~Q</em> and <em>~T</em>, while <em>p2</em> tells us that if <em>P</em> doesn’t hold then both <em>Q </em>and <em>T</em> must hold (to see this, keep pushing the outer negation sign of <em>p2</em> inwards, swapping quantifiers and conjunctions/disjunctions along the way to get <br><em>(forall x . P(x) \/ (Q(x) &amp; T(x)))</em>, i.e., <em>(forall x . ~P(x) ==&gt; Q(x) &amp; T(x))</em>). This allows for a case analysis based on the excluded middle: For any <em>x</em>, either <em>P(x)</em> or <em>~P(x)</em>. In the former case, <em>p1</em> implies <em>~Q(x)</em> and <em>~T(x)</em>, and thus <br><em>Q(x) &lt;==&gt; T(x)</em>. In the latter case, <em>p2</em> implies <em>Q(x)</em> and <em>T(x)</em>, and thus again <em>Q(x) &lt;==&gt; T(x)</em>. That’s the entire proof.</p><p>GPT-4 not only fails to prove this, but claims to disprove it with spurious counterexamples:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*dvAP8B7oPeqj6OvrZ1HABg.png" /></figure><p>When the error is pointed out, GPT-4 goes to make another similar error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*3Bt8IktNev3vQoOoX2ND-Q.png" /></figure><p>The fix to the second error has naturally led to a third one, as the new “valid counterexample” is anything but valid: the second premise is again falsified by the given interpretation (take <em>x</em> = <em>a</em>).<br> <br>To see how robust these errors are, we place 15 API calls to GPT-4, with the following chain-of-thought prompt:</p><blockquote>Consider the following 3 formulas:<br>p1: (all x . P(x) &lt;==&gt; ~(Q(x) | T(x)))<br>p2: ~(exists x . ~P(x) &amp; (~Q(x) | ~T(x)))<br>p3: (forall x . Q(x) &lt;==&gt; T(x))</blockquote><blockquote>Prove or disprove that p1 and p2 logically entail p3. To prove it, you must give a detailed step-by-step proof that derives p3 from p1 and p2. To disprove it, you must give a countermodel that satisfies p1 and p2 but falsifies p3. Think this out step-by-step and explain your reasoning in detail.</blockquote><p>Eight calls were made with a temperature of 0.0001, 4 calls with 0.45, and 3 calls with 0.9. In all 15 cases, GPT-4 failed to prove the entailment and instead produced spurious counterexamples. There is still plenty of nondeterminism, in that GPT-4 produces various and sundry spurious countermodels on different API calls. A lot of them are not simply false but nonsensical from a mathematical perspective. For instance, one of the alleged countermodels (produced with a temperature of 0.0001) is the following:</p><blockquote>We can disprove that p1 and p2 logically entail p3 by providing a countermodel.</blockquote><blockquote>Let’s consider a universe of discourse where x can be any natural number. Let’s define P(x), Q(x), and T(x) as follows:</blockquote><blockquote>P(x): x is an even number.<br>Q(x): x is a prime number.<br>T(x): x is a multiple of 3.</blockquote><blockquote>Now, let’s check if p1, p2, and p3 hold true under this model.</blockquote><blockquote>p1: (all x . P(x) &lt;==&gt; ~(Q(x) | T(x)))<br>This statement says that for all x, x is an even number if and only if x is not a prime number or x is not a multiple of 3. This holds true in our model <strong>because every even number is not a prime number (except 2) or not a multiple of 3</strong>.</blockquote><blockquote>p2: ~(exists x . ~P(x) &amp; (~Q(x) | ~T(x)))<br>This statement says that there does not exist an x such that x is not an even number and (x is not a prime number or x is not a multiple of 3). This also holds true in our model <strong>because for any odd number (which is not even), it is either a prime number or a multiple of 3</strong>.</blockquote><p>Neither <em>p1</em> nor <em>p2</em> are actually satisfied in the given interpretation, and the reasons given to the contrary (boldfaced above) are preposterous; no high school student would ever claim that any odd number is either prime or a multiple of 3. Other nonsensical and/or patently inconsistent assertions confidently made by GPT-4 when presenting some other countermodels:</p><ol><li>For all natural numbers <em>x</em>, if <em>x</em> is even then it is not the case that <em>x</em> is less than 3 or greater than 2 (meaning that if <em>x</em> is even then <em>x</em> ≥ 3 AND x ≤ 2).</li><li>For all natural numbers <em>x</em>, if <em>x</em> is not even then it is either less than 3 or greater than 5.</li></ol><h3>4. Relation Closure</h3><p>Here we give GPT-4 a simple binary relation and ask it to compute its symmetric and transitive closure. Here’s the exact prompt:</p><blockquote>Consider the following set of five names: N = {Alice, Bob, Charlie, Dave, Ed}. Let R be a binary relation on N, defined as follows: R(n1,n2) iff the ASCII code of the first letter of n1 is exactly one less than the ASCII code of the first letter of n2. Output the symmetric and transitive closure of R (not two different relations, but one single relation that represents the symmetric and transitive closure of R). Think step-by-step and explain your reasoning in detail.</blockquote><p>The relation in question is <em>R = {(A,B), (B,C), (C,D), (D,E)}</em> (writing ‘<em>A</em>’ as a shorthand for ‘Alice’, etc.). The symmetric closure of <em>R</em>, call it <em>R_s</em>, has 4 extra pairs (for a total of 8), while the full transitive closure of <em>R_s</em>, call it <em>R_t</em>, is identical to the Cartesian product of <em>N = {A,B,C,D,E}</em>, i.e., <em>R_t</em> contains every single possible pair <em>(x, y)</em> in <em>N x N</em>. Accordingly, <em>R_t</em> contains 5 x 5 = 25 pairs.</p><p>It’s easy to see why every single pair <em>(x, y)</em> must be in the result. First, symmetry and transitivity together imply reflexivity, so every pair <em>(x, x)</em> must be in the result. For <em>x != y</em>, we have either <em>x &lt; y</em> or <em>y &lt; x</em>, where we write “<em>x &lt; y</em>” to mean that the ASCII code of the first letter of <em>x</em> is less than the ASCII code of the first letter of <em>y</em>. (Thus, this &lt; relation is precisely the transitive closure of <em>R</em>.) So, if <em>x &lt; y</em>, we can prove that <em>(x, y)</em> must be in the result <em>R_t</em> by repeatedly composing <em>R</em> with itself, e.g., we must have <em>(A,D)</em> in <em>R_t</em> because <em>(A,B)</em> and <em>(B,C)</em> are in <em>R</em>, so <em>(A,C)</em> must be in <em>R_t</em>. But we also have <em>(C,D)</em> in <em>R_t</em>, so <em>(A,C) </em>and <em>(C,D)</em> give <em>(A,D)</em>. Finally, if <em>y &lt; x</em>, we compose pairs from the symmetric closure of <em>R </em>(e.g., <em>(C,A)</em> must be in <em>R_t</em> because <em>(C,B)</em> and <em>(B,A</em>) are in it).</p><p>Let’s see how GPT-4 handles this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*ecjSiub81cNBrifJNqY0Yg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*6ETNvZj0AxMNFeMl_efgtw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*Je5SerBTBje5qt5HS12l7Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*ktU63WdrtT2u5niiDaCt1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*D2_fkeBFpm7_RDDLq7ycxQ.png" /></figure><p>Of course, this is still not the right result and does not “fully adhere to the properties of transitivity and symmetry”, as it’s still missing 6 pairs (e.g., <em>(Alice,Ed)</em>).</p><p>Ten API calls to GPT-4 with random temperatures produced ten incorrect results, albeit with different sorts of errors in them due to nondeterminism. (For instance, one answer produced <em>{(Bob, Alice), (Alice, Bob)}</em> as the result, while another produced <em>{(Charlie, Bob), (Bob, Charlie), (Dave, Charlie), (Charlie, Dave), (Ed, Dave), (Dave, Ed), (Bob, Dave), (Dave, Bob), (Bob, Ed), (Ed, Bob), (Charlie, Ed), (Ed, Charlie)}</em>.</p><p>Would it help to instead ask GPT-4 to generate a Python program to compute the requested closure? It wouldn’t:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*aDeUXAlH2JFuAR_ICgYUKQ.png" /></figure><p>The produced code also generates incorrect results (e.g., missing pairs such as <em>(A,D)</em>). The problem, of course, is in the implementation of transitive_closure. It’s surprising that GPT-4 could not produce a proper implementation given that this is an elementary programming problem that is very widely discussed on the web.</p><h3>5. Falsification</h3><p>Here’s another simple logic problem:<br><em>Let p1-p3 be the following propositions:<br>p1: ~ (exists x . P(x) &amp; Q(x))<br>p2: (forall x . Q(x) ==&gt; T(x))<br>p3: (forall x . P(x) ==&gt; ~ T(x))</em></p><p><em>Prove or disprove the following claim: p1 and p2 logically entail p3. <br>Think this out step-by-step and explain your reasoning in detail.</em></p><p>The entailment does not hold, and a countermodel is trivial: Take the universe <em>D = {a}</em> and take as true <em>P(a)</em>, <em>~Q(a)</em>, and <em>T(a)</em>. This satisfies p1 and p2 but falsifies p3. But GPT-4 claims that p3 does follow from p1 and p2:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*4w5p_Fc-HzgIRuy1A9913Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*BEZFD6j6I5ntnZ4Ggu0yyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*deXLCA6WWkpz3x-5cyjArw.png" /></figure><p>Using the API produces different results, although the results are consistently incorrect. In particular, 10 different calls to GPT-4, with different temperatures, all result in the same negative answer, consistently: GPT-4 says that p3 does not follow from p1 and p2 and proceeds to generate a “countermodel.” In all 10 cases, however, the provided countermodels are not just spurious, they are often incoherent. Here is one example:</p><blockquote>Let’s consider a universe of discourse where x can be any natural number. Define P(x), Q(x), and T(x) as follows:</blockquote><blockquote>P(x): x is an even number.<br>Q(x): x is a positive number.<br>T(x): x is a number greater than 0.</blockquote><blockquote>Now, let’s check the propositions:</blockquote><blockquote>p1: ~ (exists x . P(x) &amp; Q(x)) — This proposition states that there is no number that is both even and positive. This is false because there are many positive even numbers (2, 4, 6, etc.).</blockquote><blockquote>p2: (forall x . Q(x) ==&gt; T(x)) — This proposition states that if a number is positive, then it is greater than 0. This is true for all natural numbers.</blockquote><blockquote>So, our model satisfies both p1 and p2.</blockquote><p>How can p1 be satisfied when it’s actually falsified (and explicitly acknowledged as “false because there are many positive even numbers”) is a mystery.</p><p>This is another striking reminder that LLMs can arrive at the right conclusion by accident — for entirely wrong reasons.</p><h3>6. Model-Based Reasoning</h3><p>Here we give GPT-4 a <em>particular</em> model and ask it to examine the truth of a biconditional formula in this model. It is easy to see that the formula is false in the given model; for instance, take <em>x = 10</em> and <em>y = 1</em>. Then we have <br><em>y = s(x)</em>, and hence the right-hand side of the biconditional holds. Yet obviously the left-hand side, <em>x &lt; y,</em> does <em>not</em> hold, since 10 is not less than 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*O_EHMS6UyzeQYyEOCxW7Tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*mbsRHaQ_WrBjnwdgIOfdRw.png" /></figure><p>How about repeated calls? Out of 10 calls to the GPT-4 API with various temperatures, 9 of them incorrectly claim that the formula does hold in the given model, and give various erroneous proofs to that effect. Only 1 time does the model make the correct claim that the formula is false, but even in that case it does so for the wrong reasons (in particular, it claims that the left-to-right direction is falsified):</p><blockquote>One counterexample would be to take x=1 and y=10. In this case, while it’s true that R(1,10) since 1 &lt; 10, it’s not true that 10 = s(1) or that there exists a z such that 1 &lt; z and<em> </em>z &lt; 10. You could choose z = 2, 3, 4, …, 9, but in each case z<em> </em>is less than 10 rather than greater, contradicting the second part of the formula.</blockquote><p>Formulating the problem in an explicit chain-of-thought style (whereby we ask it to think the problem out in a “step-by-step” way) does not help much. In that case, only 1 time out of 10 does the model get the correct answer for the right reason. The model does identify <em>x=10</em> and <em>y=1</em> as a corner case a couple of other times, but its reasoning is hopelessly muddled in those cases (e.g., with GPT-4 making assertions such as “<em>x &lt; y holds true for x=10, y=1</em>”).</p><h3>7. Trichotomy Violations</h3><p>It is a fundamental fact about numbers (natural numbers, integers, rationals, and reals) that they obey the following <em>trichotomy</em> law: for any numbers <em>x</em> and <em>y</em>, exactly one of the following three possibilities holds: <br><em>x &lt; y</em>, <em>x = y</em>, or <em>x &gt; y</em>. Here we ask GPT-4 to focus on an initial segment of the positive integers: numbers 1 through 10. Writing <em>R(x,y)</em> for <em>x &lt; y</em>, we ask it to prove or disprove the following: for all numbers x and y in this range, <em>R(x,y)</em> iff <em>~ R(y,x)</em>. That is, <em>x</em> is less than <em>y</em> if and only if <em>y</em> is not less than <em>x</em>.</p><p>This is easily disproved by taking <em>x = y</em>, say <em>x = y = 2</em>. If the biconditional held, then ~R(2,2), which is true, would imply R(2,2) — a contradiction. [Indeed, if the biconditional held then trichotomy would not, as we could conclude that for any two numbers x and y, either <em>x &lt; y</em> or <em>y &lt; x</em>. This is because the conditional <em>~R(y,x) ==&gt; R(x,y)</em> is equivalent to <em>R(x,y) \/ R(y,x)</em>.]<br>But GPT-4 happily offers a “proof”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*Ay6hk3ZaKyMYuGFhXTFKdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*JkSF6gOsVNiwzX4LKZFECA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*p5qBmxb9ZWIzOrCpXbyZiQ.png" /></figure><p>10 different API calls all produced the same result: an affirmation that the claim holds, backed up by incorrect proofs. In some cases, the possibility that x = y was explicitly considered but dismissed as irrelevant. For instance, at the end of the first proof (with temperature 0.0001), GPT-4 writes the following:</p><blockquote>However, there is one case we have not considered: when x = y. In this case, neither R(x,y) nor R(y,x) holds, because x is not less than y and y is not less than x. But the claim is still true in this case, because “R(x,y) holds if and only if R(y,x) does not hold” is vacuously true when neither R(x,y) nor R(y,x) holds. So, the claim is true for all x, y in D.</blockquote><p>Of course, that claim is far from “vacuously true when neither R(x,y) nor R(y,x) holds.” It is, in fact, false.</p><p>And from the fourth proof attempt:</p><blockquote>This claim is a formal way of expressing the trichotomy property of the integers, which states that for any two integers, one and only one of the following holds: the first is less than the second, the first is equal to the second, or the first is greater than the second. In this case, since we are only considering the first 10 positive integers, the “equal” case does not apply, so we are left with the “less than” and “greater than” cases, which are exactly what the claim expresses.</blockquote><p>(Of course the equal case applies regardless of the fact that we’re considering an initial segment of the positive numbers.)<br>And from the 10th attempt:</p><blockquote>Conversely, if ~R(y,x) holds, it means that y is not less than x. In a set of integers, this implies y must either be greater than or equal to x. However, because we’re only dealing with the relation “&lt;”, the only possibility left is for x to be less than y. Therefore, R(x,y) must hold. Hence, ~R(y,x) implies R(x,y).</blockquote><h3>8. What’s in a Name?</h3><p>This is a simple little problem from an old puzzle book (first published in 1957) by C. R. Wylie Jr: <em>101 Puzzles in Thought and Logic</em>, a Dover publication. It is almost endearingly anachronistic:</p><p><em>Mr. and Mrs. Smith and their two children form a typical American family. According to one of their more talkative neighbors: <br>George and Dorothy are blood relatives. <br>Howard is older than George. <br>Virginia is younger than Howard. <br>Virginia is older than Dorothy. <br>If two and only two of these statements are true, what is the first name of each member of the family?</em></p><p>Let’s label these four statement for easy reference:<br>(S1) George and Dorothy are blood relatives.<br>(S2) Howard is older than George (H &gt; G)<br>(S3) Virginia is younger than Howard (V &lt; H)<br>(S4) Virginia is older than Dorothy (V &gt; D).</p><p>This problem makes a good testbed because even though the required reasoning is entirely deductive, it is also enthymematic, insofar as it relies on certain common-sense (and tacitly assumed) knowledge about family relationships.</p><p>The problem is straightforward; it does not require inferences deeper than a level of 3 or 4. To solve it, it is tempting to start considering each possible set of two statements out of the four. That approach would work but would be tedious. A more head-on logical analysis can solve the puzzle more directly. Below is one possible solution, presented as a deductive derivation of the four names assigned to the four family roles.</p><p><em>By way of contradiction, assume that Howard is the father. Then George must be the son, so S2 holds. Now the mother is either Dorothy or Virginia. Let’s assume the former (so that Virginia is the daughter). Then S1 is true, hence ~S3, meaning V &gt;= H, which is impossible (the daughter can’t be older than the father). Let’s then assume that Virginia is the mother and Dorothy the daughter. In that case S4 must hold, hence ~S1 and ~S3. But ~S1 means that George and Dorothy are not blood relatives, which is also impossible (since under our current assumptions they are brother and sister). Hence, either case leads to a contradiction and we can conclude that Howard is not the father. Thus, George is the father and Howard the son. Hence, ~S2. Assume now that Dorothy is the mother (and hence Virginia is the daughter). Then ~S1 and hence S3 &amp; S4, but S4 (V &gt; D) is a contradiction. Hence, Dorothy must be the daughter and Virginia the wife. </em><strong><em>QED</em></strong></p><p>Summary: Father: George. Mother: Virginia. Son: Howard. Daughter: Dorothy. Truth values of the 4 statements: S1, ~S2, ~S3, S4.</p><p>Let’s see how GPT-4 fares, with an explicit COT-style prompt urging it to think out the problem step-by-step and explain its reasoning in detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*JWP_dA1wqGOim8CUJ6XcFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*6A8BrYtq7ASATPU0KB0zwA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*5i0XCAn4xhHTYHRqHNU-AQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*90ZjoRXXz2PWkxx7odm0Pg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*k6lTdRJ3u_rghGuLolTgcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*x4JTgU48w42V-TUYwJygKw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*MGuOG6VnTrCO0vZaRcMWIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/611/1*FHWyZ7-U64kiY1yQtr8dnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*BSBCkEn-nVBObHVFK-mDhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*MaZfm3AFuFlnDb_Ot1u75g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*oWmvmPWpntKWCpRetzKL_A.png" /></figure><p>In addition to the playground, this problem was programmatically posed to GPT-4, via the OpenAI API, a total of 30 times. The first 10 calls were made to the regular GPT-4 model (with the 8K context), while the subsequent 20 calls were made to the 32k version of GPT-4. The model got wrong answers consistently, but in a rather random and nondeterministic fashion. The results are shown in the table below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EZq_qwY6oTnRhnPl40iwxg.png" /><figcaption>,</figcaption></figure><p>The correct answer was obtained 1 out of the 30 times, but even that was a random occurrence, because the reasoning that was used to derive the correct answer was deeply flawed, featuring a number of bizarre errors. GPT-4’s reasoning starts out as follows:</p><blockquote>The possibilities are: <br>1. George is Mr. Smith and Dorothy is the daughter, Howard is the son, and Virginia is Mrs. Smith.<br>2. George is Mr. Smith, Dorothy is Mrs. Smith, Howard is the son, and Virginia is the daughter. <br>3. Dorothy is Mrs. Smith, George is the son, Howard is Mr. Smith, and Virginia is the daughter. <br>4. Dorothy is Mrs. Smith, George is the son, Howard is the daughter, and Virginia is Mr. Smith.</blockquote><blockquote>The first statement given “George and Dorothy are blood relatives” can’t be true since we are considering Mr. and Mrs. Smith as George and Dorothy and we typically wouldn’t consider a married couple blood relatives.</blockquote><blockquote>So let’s focus on the other three statements:</blockquote><blockquote>1. Howard is older than George.<br>2. Virginia is younger than Howard.<br>3. Virginia is older than Dorothy.</blockquote><blockquote>So now let’s look at the four possibilities we listed above considering the other three statements:</blockquote><blockquote>1. Howard is older than George — FALSE. <br> Virginia is younger than Howard — TRUE. <br>Virginia is older than Dorothy — TRUE. <br>This possibility has two true statements which fits the requirements.</blockquote><blockquote>2. Howard is older than George — TRUE. <br>Virginia is younger than Howard — TRUE. <br>Virginia is older than Dorothy — FALSE. <br>Again this possibility has two true statements which fits the requirements.</blockquote><blockquote>3. Howard is older than George — TRUE. <br>Virginia is younger than Howard — FALSE. <br>Virginia is older than Dorothy — TRUE. <br>This possibility does not fit the requirements, as three statements are true.</blockquote><blockquote>4. Howard is older than George — FALSE. <br>Virginia is younger than Howard — FALSE. <br>Virginia is older than Dorothy — FALSE. <br>This possibility does not fit as all statements are false.</blockquote><blockquote>So, the possibilities are 1 and 2. However, in the second case, it cannot be true because if Mr. and Mrs. Smith are George and Dorothy, that would mean the children are Howard and Virginia. But the second statement says “Virginia is younger than Howard.” But as per the rule in most Western cultures, the elder daughter can’t have a masculine name and the younger son can’t have a feminine name.</blockquote><blockquote>So by process of elimination, the first possibility is the most likely correct one. George is Mr. Smith, Dorothy is the daughter, Howard is the son, and Virginia is Mrs. Smith.</blockquote><p>GPT-4 starts by erroneously knocking S1 out of contention on the grounds that “we are considering Mr. and Mrs. Smith as George and Dorothy and we typically wouldn’t consider a married couple blood relatives”. But of course whether or not George and Dorothy are Mr. and Mrs. Smith is completely unsettled at this point. Nor are we in the scope of any assumption to that effect. So precluding that possibility is a logical error.</p><p>Then, farther down, GPT-4 rules out possibility 2 on the following nonsensical grounds:</p><blockquote>However, in the second case, it cannot be true because if Mr. and Mrs. Smith are George and Dorothy, that would mean the children are Howard and Virginia. But the second statement says “Virginia is younger than Howard.” But as per the rule in most Western cultures, the elder daughter can’t have a masculine name and the younger son can’t have a feminine name.</blockquote><p>To say that this is deeply confused would be an understatement. But it is only due to these logical errors that the system eventually managed to randomly arrive at the correct answer in that one case.</p><p>An analysis of the remaining 29 transcripts shows that every single response contains either absurd claims or flagrant reasoning errors (and often both). We’ll demonstrate with two example snippets but the reader can refer to the posted file for more details.</p><p><strong>API Call 1:</strong> <em>This leaves us with the third and fourth statements as the true ones. So, Virginia is younger than Howard and Virginia is older than Dorothy. This means that Howard is the oldest (the father), Virginia is the middle (the daughter), </em><strong><em>and Dorothy is the youngest (the son)</em></strong><em>. So, the first names of each member of the family are: Mr. Smith is Howard, Mrs. Smith is Virginia, </em><strong><em>their daughter is Dorothy</em></strong><em>, and their son is George.</em></p><p><strong>API Call #2:</strong> <em>So, the two </em><strong><em>true</em></strong><em> statements are: 2. </em><strong><em>Howard is older than George</em></strong><em>. 4. Virginia is older than Dorothy. </em><strong><em>Therefore,</em></strong><em> the first names of each member of the family are: </em><strong><em>Mr. Smith: George</em></strong><em> Mrs. Smith: Dorothy </em><strong><em>Child 1: Howard</em></strong><em> Child 2: Virginia</em></p><h3>9. Midwestern Colors</h3><p>Consider the four states of Nebraska, Iowa, Kansas, and Missouri:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*4kBNPFRNQ0I4pnYsu5KIkg.png" /></figure><p>As you can see, GPT-4 knows fully well the adjacency relations that obtain among these four states:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*-mXns0JKRMoHtMJPrbBTjw.png" /></figure><p>Then let’s ask it to color these four states so that adjacent states receive different colors, using only 3 colors: red (R), blue (B), and green (G). Solutions are entirely trivial for humans to find, e.g. make Missouri red, both Iowa and Kansas green, and Nebraska blue. GPT-4 manages to produce an incorrect solution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*rMs-rMRdozz3BA_PaY9MtA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*z9Mn1ctro99JAV2jV3quxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*A_dDHuxY5lTWeCzmUJTW2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*Pq-cMRhAencfj8w8zNBnOg.png" /></figure><p>As you can see, GPT-4 makes the exact same mistake (giving Missouri and Nebraska the same color) not just twice in a row, but three times in a row, <em>even after having the error explicitly pointed out to it twice in a row</em>. Next, using programmatic access via the API, we send the exact same prompt to GPT-4 10 times: 4 times with a tiny temperature (0.0001), 3 times with a medium temperature (0.45), and 3 times with a high temperature (0.9). GPT-4 provides correct solutions 6 out of those 10 times. Regarding nondeterminism/randomness: a total of 4 distinct solutions are produced across those 10 API calls.</p><h3>10. CHANGE TO SPARE</h3><p>Here is another simple puzzle (from Alex Bellos’s book, “Perilous Problems for Puzzle Lovers”):</p><p><em>I have 26 coins in my pocket. If I were to take out 20 coins from the pocket at random, I would have at least one nickel, at least two dimes, and at least five quarters. How much money is in my pocket</em>?</p><p><strong>Solution:</strong> Let <em>N</em>, <em>D</em>, and <em>Q</em> be the numbers of nickels, dimes, and quarters in my pocket, respectively. If I am guaranteed to have at least one nickel whenever I randomly draw 20 coins from my pocket, then we must have <br><em>N &gt;= 7 </em>(for even with <em>N = 6</em> it’d be possible to get no nickels at all in a random draw of 20 coins). Likewise, we must have <em>D ≥ 8</em> and <em>Q ≥ 11</em>. But these inequalities must be equalities, because 7 + 8 + 11 = 26. So the total amount of money is 7 * 5 + 8 * 10 + 11 * 25 = 390 cents = $3.90. <strong><em>QED</em></strong></p><p>Let’s see how GPT-4 does:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*FnWBXiBkat3l64ZjglWnLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*_vcv_tV8ki3nj43Xk_WrzA.png" /></figure><p>Experimenting with the API gives interesting results. When we ask GPT-4 <br>to either deduce the exact amount of money OR to prove that this amount cannot be determined, it consistently says (10 times out 10 API calls) that the amount cannot be determined, though it never actually gives a proof of that assertion. But when we only ask it to deduce the exact amount of money, period, it provides a number of different answers across 20 API calls, such as $1.68, $1.96, $6.00, $5.95, $2.65, and $1.62. It’s also noteworthy that even though the prompt just asks GPT-4 to deduce the exact amount of money, GPT-4 repeatedly and gratuitously tries to “maximize” the amount of money in the pocket, as if this was an optimization problem. For instance, from one run:</p><blockquote>Since the problem doesn’t specify what these coins are, we should assume they are the coin of highest value (quarters) to maximize the total value.</blockquote><p>And from another run:</p><blockquote>Since we want to find the maximum amount of money possible, we should assume that these remaining coins are all quarters (the highest value coin).</blockquote><p>Never mind that it was nowhere stated (or even implied) that “we want to find the maximum amount of money possible.”</p><p>Finally, when we ask GPT-4 to either deduce the exact amount or else to prove that the amount cannot be deduced by producing two coin distributions consistent with the given information but yielding different sums, GPT-4 consistently chooses the latter option, producing various sets of scenarios that are, in fact, <em>inconsistent</em> with the given information. GPT-4–32k does no better than the regular version with the 8K context.</p><h3>11. TWO + TWO = FOUR</h3><p>A <em>cryptarithm</em> is a puzzle involving a simple arithmetic operation &lt;op&gt; between two or more numbers <em>n_1, …, n_k</em> whose digits are represented by unique letters. The operator &lt;op&gt; is typically addition (+), subtraction (-), or multiplication (*). A result <em>r</em> for the operation is also specified. The objective is to assign digits to letters in a way that satisfies the equation <br><em>n_1 &lt;op&gt; n_2 … &lt;op&gt; n_k = r</em>. Different letters must receive different digits, and leading letters cannot be assigned the digit ‘0’. Consider, for instance, the well-known cryptarithm TWO + TWO = FOUR. One solution here is <br>T = 9, W = 2, O = 8, F = 1, U = 5, R = 6, as can be easily verified (since <br>928 + 928 = 1856). There are a few more solutions.</p><p>Cryptarithms are essentially constraint-satisfaction problems. They range in difficulty from very easy to quite challenging. The particular cryptarithm in this problem, TWO+TWO=FOUR, is fairly easy (e.g., see a solution being derived in a couple of paragraphs <a href="https://math.stackexchange.com/questions/3895060/solving-the-cryptarithm-mathrmtwo-mathrmtwo-mathrmfour-in-base-10-a">here</a>, and several solutions discovered by high school students <a href="https://nrich.maths.org/twoandtwo/solution">here</a>). (It is also worth noting that several solutions of this particular cryptarithm are discussed on the Internet.)</p><p>There are many heuristics and shorthands that can be used to solve cryptarithms, widely shared on the Internet and hence featuring in GPT-4’s pretraining data. For example, in an addition problem like TWO + TWO = FOUR, the outermost result digit F must be 1, because it appears in the leftmost carry position of the result. Indeed, if we ask GPT-4 to list heuristics and tips for solving cryptarithms, it obliges with more than a dozen of them, such as:</p><blockquote><strong>Elimination Process</strong>: As you determine the digit for one letter, eliminate that digit as a possibility for other letters.</blockquote><p>(Interestingly, however, some of the given heuristics are incorrect, e.g.:</p><blockquote>If in an addition operation two different letters sum up to a third letter without any carry, one of the original letters must be zero and the other must be the value of the third letter.</blockquote><p>This is clearly not true, since, e.g., 2 + 3 = 5. )</p><p>At any rate, the claim here is not that this is necessarily an easy problem to solve. We can reasonably expect GPT-4 to be unable to find a solution. But we want to examine its reasoning process and see what conclusions it derives along the way.</p><p>GPT-4 starts by deriving a number of incorrect conclusions, then starts experimenting with some value assignments based on those conclusions, only to finally declare with confidence that no solution exists. When it is asked to <em>prove</em> that no solution exists, it happily produces a flawed proof.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*Fs4hSa3lMTPkuTsCouU8cw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*r_9Q2BwFUSL_7BkFJ4bWnQ.png" /></figure><p>When GPT-4 is admonished and told that the puzzle does have solutions, it changes its tune and comes up with a patently invalid solution. It’s patently invalid because it represents FOUR as 862, when the number corresponding to FOUR should obviously have 4 digits (one for each of the 4 letters, ‘F’, ‘O’, ‘U’, and ‘R’).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*IqeSguSspdCVQtEXR33N-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/1*57CjyLDwyX20skWfC0Q5xA.png" /></figure><p>This last screen is remarkable. GPT-4 is told explicitly that FOUR should be 8162 according to its own solution. While acknowledging the point, it proceeds to reiterate the exact same mistake. Let’s see what happens when we bring that up yet one more time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*vhThTQu9eXuWX0y2eiRMTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*1t00VoBTTt8fj5OWmmNuDA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*KVAVliYtROl24WUy228gyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*RqihB_4P5mYNNLR79X4rvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*4gymogFCXrFgLqHUurPjag.png" /></figure><p>Out of 40 API calls (with various different temperatures), 29 of them resulted in GPT-4 “proving” that no solution exists, while the rest produced patently invalid solutions. It is worth repeating that GPT-4 is not necessarily expected to come up with a correct solution here. The objective of this particular exercise is to observe how GPT-4 goes about exploring the problem and to examine its reasoning process. The results are not encouraging. Here are some sample initial thoughts of GPT-4 (taken from 14 different API responses):</p><ol><li><em>Since TWO + TWO = FOUR, it means that the sum of two identical two-digit numbers gives a four-digit number. This is only possible if T=1 because it’s the only way a carry can occur from the addition of the two identical numbers TWO and TWO.</em></li><li><em>First, since TWO + TWO equals to FOUR which is a four-letter word, it is obvious that T must equals to 1. Because, the only way a sum of 2 three-digit numbers can turn into a four-digit number is when there is a carry from the 2nd place to the 3rd. Now, we have ONE + ONE = FOUR.</em></li><li><em>Since TWO + TWO equals FOUR, we can see that the result should be a 4-digit number. This means that T + T must be 10 or more. So, T must be 5 because T is a single digit number.</em></li><li><em>We can start by noticing that we are adding two identical two-digit numbers (TWO + TWO) together to result in a four-digit number (FOUR). This implies that the resulting number must be in the 2000s (since it can’t reach 3000), meaning that T must equal 1.</em></li><li><em>Firstly, since TWO + TWO = FOUR, it is clear that F must be equal to 1 and T must be equal to 2 (as it is the only way to make a four-digit number from the sum of two two-digit numbers). Now the sum looks like this: 2W2+2W2 = 1OUR.</em></li><li><em>Secondly, since TWO and TWO gives a carryover to form ONE (1???) in FOUR (1OUR), it means that O &gt; 4 for a carryover to occur and since we are adding two identical numbers, O could be 5 or 0. But from our rules, we stated that the leading digit cannot be 0 and since O is a leading digit in TWO, therefore, O = 5.</em></li><li><em>From the problem, we can see that when we add TWO and TWO together, the sum could possibly be a three digit number. This means that “T” + “T” must be greater than 10. The only way this can happen if we’re working in base 10 is if “T” is 5 or greater. Furthermore, since TWO + TWO = FOUR is supposed to lead to a four letter word, T must be 1.</em></li><li><em>First, we can see that T + T must equal to either 10 or 20 because it’s a two-digit number added to another two-digit number to get a four-digit number. This means that T must be 1 or 2. However, since FOUR is a four-digit number, T must be 1. So, T = 1.</em></li><li><em>Since TWO + TWO = FOUR, it means that the sum of two identical two-digit numbers gives a four-digit number. This is only possible if T=1. So, T=1.</em></li><li><em>Since TWO + TWO equals FOUR, the result must be a 4-digit number. This means that T + T must be equal to 10 or more. Therefore, T must be 5 because it’s the only number that when doubled remains a single digit (5 + 5 = 10).</em></li><li><em>First, we can see that T + T must equal either 10 or 20 because adding the same two-digit number to itself will result in a number that is either in the tens or hundreds. Since we can’t have a number starting with zero, T must be 1, meaning F must be 2.</em></li><li><em>Since TWO + TWO = FOUR, it means that the sum of two identical two-digit numbers gives a four-digit number. This is only possible if T=1. Because when we add the same two-digit numbers, the result can only be a three-digit number unless the first digit is 1. In that case, the result can be a four-digit number.</em></li><li><em>First, we can see that T + T = F (or 2T = 10 + F if we carry over from the next column) which means T must be 5 because F can’t be more than 9 and T can’t be 0 (since it’s the first digit of a number). So, F = 0.</em></li><li><em>Since we are adding two identical numbers together, the maximum value that ‘T’ can take is 4. If ‘T’ would be 5 or more, then ‘F’ would be 10 or more, which is impossible. So, possible values for ‘T’ are 1, 2, 3, or 4. But ‘F’ has to be an even number, so ‘T’ cannot be 1 or 3, because adding those to themselves would result in an odd number. The possible values left for ‘T’ are 2 and 4. But if ‘T’ is 4, ‘F’ is 8. This would leave only 9 for ‘O’, and nothing for ‘W’ because we can’t have 0 or a number we’ve already used. Hence, ‘T’ must be 2 and ‘F’ must be 4.</em></li></ol><p>All of the above verge on incoherence. The problem is not that GPT-4 doesn’t possess elementary arithmetic facts, but rather that it cannot marshal those facts properly to work out a correct solution. Instead, while the responses at first glance appear to be rationally structured, on closer inspection they are shown to be a mishmash of grossly false claims and reasoning errors.</p><h3>12. SUDOKU FOR BEGINNERS</h3><p>Sudoku makes for a good reasoning testbed for a number of reasons. As the eminent psychology-of-reasoning researcher Philip Johnson-Laird puts it in his book “How We Reason”: “<em>Sudoku puzzles are natural experiments in reasoning</em>”. They are also “<em>the first popular puzzles that depend on pure deduction</em>”. Johnson-Laird points out that all three rules of Sudoku depend on quantifiers: “every”, “each”, and “exactly one”. Nevertheless, “<em>Many of us, even though we have had no training in logic, are able to make deductions that depend on multiple quantifiers. We enjoy challenging deductions of this sort. This fact is contrary to the view that without logical training we are incapable of valid deductions based on quantifiers</em>”.</p><p>As is well-known, Sudoku puzzles come in different levels of difficulty: easy, medium, hard, expert, and evil. One would expect an AI model that gives us “AGI glimpses” to be able to solve an easy Sudoku puzzle. The website sudoku.com can auto-generate puzzles at all levels of difficulty. Here is one at the easiest possible level:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*nDhSg1PL18C7Uj_RiEsFXQ.png" /></figure><p>This is indeed an easy puzzle to solve. More or less anyone should be able to complete this puzzle in a reasonable amount of time. A natural place to start is the most highly constrained area, which is the leftmost middle 3x3 box. That box only has two numbers missing, 4 and 5. Now 4 cannot go between 2 and 7, because that would clash with the 4 in the third column, so 5 must go there and 4 goes under 9 and 8. Now that entire square is filled. How we choose to proceed from there is up to us, but at that point the 6th row only has two numbers missing, 9 and 2, and the 9 in the 6th column means that the 2 must go in the 6th column of the 6th row, while the 9 goes into the 8th column of the 6th row. Continuing this way, the puzzle can be solved, depending on one’s level of expertise, from a couple of minutes for an expert to 20 minutes or so for a beginner. Let’s see how GPT-4 fares on it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*ezA4Dbvg3bxhZhm6oLg8Rg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*RbENaZ_or2eHuZm3GrssTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*R4dWB7Fp_sr3QfU1x37LmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*MJ4YadCrUQ72Qn5hOZvHeg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*4fQic1judobGayEE9l4Q-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*22bPBAzs4KRyw7LjUGTkLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*FNkRZmvF88PXwJrPFqO4EA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*rq_CoP_8mCN1S9SgDianTQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*BN0y0ZeodXrtylJ4RqevZA.png" /></figure><p>At this point GPT-4 goes on to produce yet another incorrect solution. But it is right about this much: “<em>a correct solution requires careful step-by-step logic</em>”. Indeed, and that is precisely what GPT-4 is unable to provide.</p><p>Calling GPT-4–32k via its API, we see that not only GPT-4 consistently fails to solve the puzzle and repeatedly comes up with bogus solutions that it claims to have verified, but that it has what appear to be perceptual problems. It often makes claims like “the third row already contains a 5” when in fact the third row has no 5. These are empirical hallucinations, but they can easily derail a chain of reasoning.</p><p>Readers can inspect the logs for full details, but I will illustrate how badly broken all the responses are by previewing the beginnings of the first two responses.</p><p><strong>Response 1</strong></p><blockquote>Let’s start solving the puzzle row by row, column by column, and box by box.</blockquote><blockquote>First, we can fill in the 3rd row, 7th column with a 3 because it’s the only number missing in the 3rd row.</blockquote><blockquote>Next, we can fill in the 4th row, 5th column with a 5 because it’s the only number missing in the 4th row.</blockquote><blockquote>Then, we can fill in the 4th row, 6th column with a 8 because it’s the only number missing in the 4th row.</blockquote><blockquote>Now, we can fill in the 5th row, 3rd column with a 4 because it’s the only number missing in the 5th row.</blockquote><p>A number of things are noteworthy here. First, note how counterintuitive this approach is. Very few humans would start solving row by row and column by column. Instead, their attention would naturally float over to the most constrained parts of the puzzle. Second, the rationales given for the moves are outrageously false (“because it’s the only number missing in such-and-such row”, when in fact the row in question has several numbers missing, or claiming to put a number in row r and column c when in fact (r,c) already has a number in it given by the problem).</p><blockquote>The final solution is:</blockquote><blockquote>— — — — — — — — — — -<br>1 9 2 | 4 6 7 | 3 5 8 <br>7 3 6 | 2 8 9 | 1 4 5 <br>4 1 8 | 5 2 3 | 4 6 9<br> — — — — — — — — — — -<br>9 6 2 | 1 5 8 | 7 4 3<br>8 1 4 | 9 7 3 | 6 2 5<br>2 3 7 | 6 5 2 | 8 5 1<br> — — — — — — — — — — -<br>5 8 6 | 7 3 4 | 9 1 3<br>1 7 9 | 3 2 8 | 7 6 4<br>3 2 4 | 8 1 5 | 6 7 2<br> — — — — — — — — — — -</blockquote><blockquote>This solution adheres to all the constraints of a Sudoku puzzle. Each row, column, and 3x3 box contains all the digits from 1 to 9 exactly once.</blockquote><p><strong>Attempt 2</strong></p><blockquote>Let’s start solving the puzzle row by row, from top to bottom, and left to right.</blockquote><blockquote>In the first row, the missing numbers are 1, 2, and 3. The number 3 can’t be in the first or seventh position because there are already 3s in those columns. So, the first row must be: 3 9 1 | 4 6 7 | 5 2 8.</blockquote><blockquote>In the second row, the missing numbers are 1, 2, 3, 4, 5, 6, 8, and 9. The number 9 can’t be in the second or eighth position because there are already 9s in those columns. So, the second row must be: 7 4 5 | 2 8 9 | 1 3 6.</blockquote><p>After a large number of outlandish “deductions,” the produced conclusion is this:</p><blockquote>The final solution is:</blockquote><blockquote>— — — — — — — — — — -<br>3 9 1 | 4 6 7 | 5 2 8 <br>7 4 5 | 2 8 9 | 1 3 6<br>6 5 8 | 3 1 2 | 4 7 9<br> — — — — — — — — — — -<br>9 6 2 | 1 8 7 | 3 4 5<br>8 1 9 | 5 7 3 | 6 2 4<br>4 3 7 | 6 5 2 | 8 9 1<br> — — — — — — — — — — -<br>5 8 6 | 7 2 4 | 9 1 3<br>1 7 9 | 3 6 5 | 2 8 4<br>3 2 4 | 8 7 9 | 6 5 1<br> — — — — — — — — — — -</blockquote><p>The pattern continues with all remaining attempts.</p><h3>Conclusions</h3><p>These results show that when the model is fixed, GPT-4 failures on simple reasoning problems are robust, even in the presence of pervasive nondeterminism.</p><p>While the discussion in the preprint and this article has focused on GPT-4, it is fair to ask whether <em>any</em> similar system could possibly crack reasoning, in the sense of being able to reliably solve nontrivial reasoning problems. That is an interesting and controversial question. I believe that this is unlikely, and the preprint already briefly cites some considerations (such as complexity-theoretic results) in support of that view. But there is a lot more to be said here. <em>Why</em> exactly is reasoning such a challenge for deep learning? I will be following up this article with another writeup providing an in-depth exploration of that question, so stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ed79d8452d44" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPT-4 Can’t Reason]]></title>
            <link>https://medium.com/@konstantine_45825/gpt-4-cant-reason-2eab795e2523?source=rss-ce1442da7923------2</link>
            <guid isPermaLink="false">https://medium.com/p/2eab795e2523</guid>
            <category><![CDATA[reasoning]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[gpt-4]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Konstantine Arkoudas]]></dc:creator>
            <pubDate>Mon, 07 Aug 2023 17:43:18 GMT</pubDate>
            <atom:updated>2023-08-09T23:58:02.719Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>1. Introduction</strong></h3><p>In early January I wrote <a href="https://medium.com/@konstantine_45825/chatgpt-is-no-stochastic-parrot-but-it-also-claims-that-1-is-greater-than-1-e3cd1fc303e0">a commentary</a> presenting an informal evaluation of ChatGPT across a broad range of subject areas: conventional NLU, folk physics, information retrieval, pragmatics, theory of mind, spatial inference, simple logical reasoning, and math. The key takeaways were that ChatGPT was a seminal breakthrough; that LLM-based systems are not mere stochastic parrots but build genuine abstractions and can exhibit creativity; that such systems will enable a large array of new and exciting applications; and that, despite all of the above, these systems are still severely limited in their reasoning abilities.</p><p>GPT-4 was released a couple of months after that, delivering very substantial improvements across the board. I remain impressed and excited by the general capabilities and potential of LLMs, and I have little doubt that their performance will continue to improve. Nevertheless, there are increasing grounds for skepticism concerning their reasoning abilities. In this article I will argue that the best LLM at this time, GPT-4, is utterly incapable of reasoning, in spite of its sporadic displays of ingenuity.</p><p>I will largely steer clear of the much broader — and more vague — debate about whether LLMs <em>in general</em> are capable of (consistently robust) reasoning, but a few brief remarks will help to set the stage and clarify why it makes sense to restrict attention to a specific LLM. On one side of that broader debate, rosy predictions by LLM enthusiasts rely excessively on ever-changing scaling “laws’’ that rest on flimsy empirical evidence and on a host of questionable modeling assumptions, ill-understood concepts (such as “emergent’’ LLM properties <strong>[1]</strong>), and a somewhat dogmatic belief that minimizing cross-entropy loss on next-token prediction over a huge corpus will deliver a general reasoning engine via the magic of transfer learning and the construction of generic higher-level representations.</p><p>On the other side of the debate, while LLM skeptics have serious arguments to make, those arguments are mostly a priori and somewhat vague (for instance, that LLMs lack “a model of the world’’), and I do not think they settle the question. In my view, the most compelling a priori considerations against the plausibility of reliably robust LLM reasoning turn on computational complexity results. Reasoning is a (very) computationally hard problem. In fact, in the general case (first-order or higher-order logic), it is algorithmically undecidable, i.e., every bit as unsolvable as the halting problem. Thus, by Church’s thesis, we cannot expect <em>any</em> algorithm, LLMs included, to solve arbitrary reasoning problems in a sound and complete way. (Or with perfect precision and recall, to put it — more loosely — in ML-like terms.) But even “easier” classes of reasoning problems <strong>[2]</strong> typically have either exponential or at least nontrivial polynomial-time complexity profiles. Problem classes that have linear-time inference algorithms, such as Horn clauses over literals, are rarely expressive enough. This tradeoff between generality and expressivity on the one hand and tractability on the other means that no LLM, no matter how large or how extensively and cleverly trained and tuned, will ever be able to crack an <em>arbitrary</em> reasoning problem. And this is consistent with the famous “no free lunch’’ theorem of machine learning, which points to a similar inverse relationship between model generality and performance.</p><p>But LLM advocates can make a couple of cogent counterpoints, while granting that there will never be an AI oracle that can essentially solve the halting problem. First, they can point out that even though a problem might have high worst-case asymptotic complexity, it might still be solvable well enough <em>in practice</em>. Unlike random instances, real-world instances of reasoning problems (and indeed real-world instances of most computationally hard problems) appear to have structure that allows clever algorithms to tackle them effectively [3]. There are many examples here, from the simplex algorithm for linear programming and SAT solvers to term unification algorithms and even automatic theorem provers for full first-order logic. All of these problems are hard (having at least exponential-time worst-case complexity), yet somehow we have algorithms for them that seem to work successfully on a wide variety of inputs.</p><p>Second, and perhaps more important, we need not aim for an oracle anyway. Humans are not oracles either, nor do they seem to follow any particular algorithm that captures any one specific class of reasoning problems. The ability of humans to reason is much more fluid and messy, but impressive nevertheless. Is it impossible to build something like an LLM-based system with the reasoning ability of a well-trained engineer of average intelligence (which perhaps can then become even more intelligent and better trained by an endless process of learning and improvement)?</p><p>I don’t think that building such a system can be ruled out on a priori grounds (and here I differ from hard-core AI skeptics). I think it’s implausible, for a number of reasons <strong>[4]</strong>, but ultimately this strikes me as an empirical question that must be decided on a case-by-case basis, by subjecting a specific system to testing, i.e., by interrogating it, probing it, and analyzing its responses. And the case I will consider here is that of GPT-4, which appears, by all accounts, to be the most capable LLM at present.</p><p>There are two questions that must be addressed before we proceed. First, we must agree on what reasoning is, and second, we must say something about methodology. The next section contains a brief discussion of reasoning, but for those who wish to skip that section and dive right into the problems, the upshot is that we’ll focus on (a liberal conception of) deductive reasoning. Regarding methodology, just like the January piece, my evaluation here is not based on a corpus or set of corpora. Instead, I present a detailed qualitative analysis of GPT-4’s performance on 21 simple reasoning problems across a wide range of areas, most of which have been made up from scratch, while the rest (such as Wason’s selection task) have been manually tweaked so as to make them less recognizable to the model.</p><p>This is done partly to avoid data contamination, which is a serious problem affecting corpus-based evaluations. Given how little we know about the training regimen of ChatGPT, it is impossible to know for sure whether any existing dataset or problem has effectively been ``seen’’ by the model during its pretraining or subsequent alignment, whether we’re talking about NLP datasets, medical licensing exams, Python programming problems, LSAT or bar-entrance exams, SAT or GRE tests, and so on. (According to the analysis carried out by the <a href="https://hitz-zentroa.github.io/lm-contamination/">lm-contamination index</a>, well-known NLP datasets such as Squad, CoNLL03, MNLI, and others, are indeed contaminated, while several others are at best suspicious.) The qualification “effectively’’ is important, because even though a specific problem might not have been seen in its <em>exact</em> form (in a string-matching sense), an essentially equivalent variant with a different surface formulation might well have been. Hence, simple contamination tests based on substring checks, such as those carried out by OpenAI in their <a href="https://arxiv.org/abs/2303.08774">GPT-4 Technical Report</a> (posted in March 2023), are not sufficient to guarantee lack of contamination. In fact, the substring checks carried out by OpenAI were not even applied on the entire problem instance, only on 3 randomly selected substrings of 50 characters each. This is not enough to ensure disjointness for long (or even moderately long) problems, which are quite common in tests like the UBE (Uniform Bar Exam).</p><p>The absence of a large corpus makes the discussion more qualitative rather than quantitative. However, the results are arguably more informative than a numeric metric computed over a corpus, for a number of reasons. First, because contamination can be ruled out conclusively; second, because the problems span a large gamut of areas; and third, because a qualitative discussion of a problem allows for greater depth of analysis and more context in which to interpret the results. By contrast, the only way to perform a truly informative quantitative evaluation is to come up with a brand new corpus that satisfies all of the following criteria: (a) originality; (b) uniformly high quality; (c) sufficiently large size; and (d) diversity (not being limited to one type of task only). This is a very challenging undertaking. Even then, a few simple numeric metrics on a brand new dataset might not be particularly illuminating. Are the numbers measuring the right things? Do we even know the right things to measure? Is there an appropriate backdrop in which the numbers can be understood? For deeper insight, we need to put individual examples under a magnifying glass.</p><p>This is particularly important because we need to scrutinize the explanations (“chains of thought”) generated by a reasoner. Unfortunately, almost all reasoning corpora comprise either multiple-choice questions or binary classification problems (e.g., “Does sentence <em>p2</em> follow from premise <em>p1</em>, yes or no?”). Why? Mostly because it is easy to mechanically evaluate model performance on such datasets. But even in the absence of contamination, this type of test set runs the serious risk that the LLM will manage to pick the right answers by latching on to spurious statistical regularities, i.e., to arrive at the right answers for the wrong reasons <strong>[5]</strong>. Adversarial augmentation of an existing dataset might help, especially if we know what we are trying to guard against, but unless an adversarial version restores near-random performance, this can quickly devolve into a game of whac-a-mole, where we detect a new round of bogus regularities exploited by the model and must undertake a new round of adversarial interventions.</p><p>Ultimately, there is really no proper way to assess the reasoning ability of a system unless we ask it to explain its output. This is an essential part of reasoning, which is not about producing the right answer by hook or by crook but about <em>deriving</em> the right answer <em>for the right reasons</em>. And rote metrics like ROUGE are not fit for purpose here. We need to roll up our sleeves and analyze LLM explanations and proof attempts manually. We also need to gauge their performance in a dialog setting (e.g., what happens when a reasoning error is pointed out to them?). This is the sort of analysis undertaken in this paper. I believe the results show unequivocally that GPT-4 cannot reason. The errors are too pervasive and too egregious. GPT-4 doesn’t solve even one of the 21 problems discussed here. But much more concerning are the fundamentally flawed explanations and proof attempts it produces along the way.</p><p>LLM believers will probably demur: <em>But humans also make mistakes, and surely we’re not prepared to say that humans can’t reason just because they make mistakes</em>? First, it is not accurate to say without qualification that “humans can reason,’’ certainly not in the sense that we can randomly pluck any person from the street and expect them to reliably perform normatively correct reasoning. Most neurobiologically normal humans have the <em>capacity</em> to become proficient in reasoning, but actually attaining such proficiency takes significant training and discipline. Humans are known to be susceptible to a large assortment of cognitive biases, which can only be overcome by rigorous instruction. Focusing on the reasoning skills of untrained people is a bit like focusing on the singing skills of the general population. Everybody sings in the shower, but without formal training (or at least exceptional talent) the results are usually regrettable.</p><p>Of course, even sophisticated human reasoners make mistakes, just like trained singers can hit false notes. But if a human made <em>these</em> mistakes, the ones reported in this article, then I would conclude without any hesitation that they cannot reason. Even if they went on to list a large number of other examples demonstrating impeccable reasoning, I would suspect that other factors (such as rote memorization or cheating) were behind the performance discrepancy. For the mistakes reported here are not performance mistakes, the sort of innocuous errors that humans might make — and promptly correct — when they are careless or tired. If a human made these mistakes, and made them consistently under repeated questioning, that would indicate without doubt that they don’t have the necessary logical <em>competence</em>, that they lack fundamental concepts that are part and parcel of the fabric of reasoning, such as logical entailment and set membership. And I would certainly not entrust that person with generating reams of Python or Javascript code for an enterprise. Nor would I start organizing international conferences to investigate how their reasoning prowess might threaten humanity with extinction.</p><h3><strong>2. What is Reasoning?</strong></h3><p>Reasoning is not quite the same thing as intelligence, but it’s a necessary ingredient for it. Broadly put, reasoning is the process of drawing and evaluating <em>conclusions</em> from a given body of information. More precisely, it is the process of making and — more importantly — <em>justifying</em> arguments. An argument consists of a conclusion (the argument’s upshot, so to speak) and a set of <em>premises</em> from which the conclusion is derived. Premises represent information that is taken as given, if only provisionally, for the purposes of the argument. The conclusion and the premises are typically declarative sentences (expressed either in natural language or in the notation of a symbolic logic) that can be true or false, but they may also be represented by alternative notational devices, such as diagrams. We say that a set of premises <em>S</em> logically <em>entails</em> (or logically <em>implies</em>) a conclusion <em>p</em> iff <em>p</em> is true whenever all the sentences in <em>S</em> are true, in which case the argument is said to be <em>valid</em>. This means that it’s logically impossible to have a state of affairs in which every element of <em>S</em> holds but <em>p</em> does not. This key logical relationship is a lynchpin of human reasoning <strong>[6]</strong>.</p><p>Valid deductive arguments (whose conclusions are entailed by the premises) are said to be <em>analytical</em> (or sometimes <em>tautological</em>), insofar as, <em>technically speaking</em>, they convey no information <strong>[7]</strong>. This idea is also sometimes expressed by calling such arguments <em>non-ampliative</em>, meaning that there is no information contained in the conclusion that is not already contained — if only latently — in the premises. Deduction is the process of making and justifying non-ampliative arguments.</p><p>Deductive arguments are typically justified by <em>proofs</em>, which are sequences of inference steps, each of which applies an <em>inference rule</em> to a number of premises and/or results of previous steps and derives a new result. The last step derives the final conclusion of the proof. An inference rule may be low-level and easy to apply or higher-level and computationally expensive. But all inference rules are required to be <em>sound</em> (or<em> truth-preserving</em>), that is, they must ensure that if the inputs are true then so is the output. All mathematical proofs are deductive, and mathematical reasoning in general is predominantly deductive <strong>[8]</strong>.</p><p>The conventional view is that some arguments are <em>ampliative</em>, meaning that the conclusion is not quite entailed by the premises. In other words, it is possible for the premises to be true while the conclusion is false. These are typically subdivided into <em>inductive</em> and <em>abductive</em> arguments, although some authors view induction as a species of abduction, and even more authors view abduction as a species of induction. (Several other types of reasoning are often discussed in the literature, such as analogical reasoning (which includes, for instance, case-based reasoning), Bayesian reasoning, causal reasoning, and so on, but these are usually subsumed under one of the three main categories I have described, most often under induction. But there is no consensus, for instance, some thinkers, from Aristotle to recent authors, have tried to assimilate analogical reasoning under deduction.) There is no rigorous definition of either, but roughly, the premises of a good inductive argument make its conclusion <em>likely</em>, though never quite certain (in contrast to deduction, where the truth of the premises guarantees the truth of the conclusion). Induction can generate specific conclusions from all kinds of premises (specific or general), but often it proceeds from specific individual observations <em>o_1</em>,…,<em>o_n</em> to a more general hypothesis <em>H</em> that subsumes the individual <em>o_i</em> in some sense (for instance, <em>H</em> may be a universally quantified sentence and the <em>o_i</em> could be instances of that sentence).</p><p>Much of what ML algorithms do can be viewed as inductive reasoning. For instance, a linear-regression algorithm might take as input <em>n</em> datapoints about car models, where each data point is of the form <em>d_i</em> = <em>((c_i,h_i,y_i),m_i)</em> for <em>i</em> = 1,…,<em>n</em>, where <em>c_i</em> is the number of cylinders for the <em>ith</em> car model, <em>h_i</em> is the horsepower, <em>y_i</em> is the model year, and the dependent variable <em>m_i</em> is the mpg (miles per gallon). And it might produce as output a formula like <em>m</em> = <em>w_1 * c + w_2 * h + w_3 * y + b</em>, which predicts the mpg of a car model from its number of cylinders, horsepower, and model year. (We are assuming of course that the car model whose mpg we are predicting was not included in the given data, otherwise there would be no prediction or generalization involved.) Here<em> w_1</em>,<em> w_2</em>, <em>w_3</em>, and <em>b</em> are specific numbers (weights) representing a hyperplane that minimizes the mean squared error for the input data (meaning that the hyperplane determined by these weights might not fit the <em>n</em> datapoints perfectly, but it does so better than the hyperplane determined by any other set of weights). (The training of deep neural networks, too, works by trying to discover values for various weights that are ``optimal’’ for a given training dataset (in that they minimize loss), except that in their case the relationship between the inputs, outputs, and weights can be much more complicated (non-linear) and the training algorithm might not converge to the optimal weight values.)</p><p>The main distinguishing feature of abductive reasoning is a strong emphasis on explanation. Abduction consists mostly in making and justifying arguments that explain a set of facts. If one day I come home early from work and I see a plumber’s van parked in my neighbors’ driveway, I might conclude that my neighbors are having some plumbing work done in their house. The premise here is “There is a plumbing van parked in my neighbors’ driveway” and the conclusion is “My neighbors are having plumbing work done in their house.” This is sometimes called “inference to the best explanation,” because the conclusion serves to explain the premise(s). This is also a form of ampliative reasoning — the conclusion does not follow logically from the premises. There are many alternative explanations of a given set of facts or observations (perhaps a plumber parked there temporarily, or the neighbors bought the van, or the neighbors have a plumber friend who is making a social visit, and so on). A <em>good</em> abductive inference will yield a hypothesis that has more explanatory value than competing hypotheses. But how exactly to measure the quality of an abductive piece of reasoning is an open question. (Some desired properties of explanations are obvious. Truth is one of them — a good explanation cannot be based on a false hypothesis. But other desired properties, such as parsimony and generality — explaining as much as possible while assuming as little as possible — are much harder to explicate.) Note that it doesn’t take a large leap of imagination to view induction as a form of abduction. Observing a large number of black (and only black) swans and then conjecturing that all swans are black could be seen as abductive reasoning, as the conclusion “for all <em>x</em>, if <em>x</em> is a swan then the color of <em>x</em> is black” would explain all the observed data. Linear regression can also be seen as the making of an abductive hypothesis, as can (much more generally) Maximum Likelihood Estimation, a principle that underlies many ML algorithms and is often associated with induction.</p><p>All of the above is received wisdom, but it’s worth mentioning that there have been thinkers, called “deductivists” (ranging from philosophers such as Popper and Musgrave to statisticians such as Fisher), who contend that deduction is the only real form of reasoning there is, insofar as it’s the only one for which we have a rigorous and properly understood formal notion of validity; and that other (ampliative) arguments are best understood as reconstructed deductions, typically as enthymemes (arguments that omit tacitly understood premises). I find that position congenial <strong>[9]</strong>, but venturing into that discussion would take us too far afield. For present purposes it suffices to say that we will focus on deduction, because it is the type of reasoning that underpins most logico-mathematical thought and for which we have clear normative standards of evaluation.</p><p>An important note: I view the discovery and justification of particular <em>models</em> (including counterexamples and countermodels in general) as part and parcel of reasoning. This is not a controversial view; some cognitive scientists view models and associated cognitive processes as the fundamental ingredients of human reasoning. In addition, however, I view model-based reasoning as at least partly deductive, because even though the actual process of discovering models might not be a process of deduction <strong>[10]</strong>, its outcome is a claim (namely, that a given interpretation satisfies a set of premises) that can be verified or falsified deductively, taking as premises the definition of the model itself and possibly other general knowledge about the model’s domain.</p><p>Indeed, I will consider even computation as a form of deduction, because a particular computation can be naturally regarded as a deductive derivation of a conclusion of the form <em>f</em>(<em>e_1</em>,…,<em>e_n</em>) = <em>v</em>, where <em>f</em>(<em>e_1</em>,…,<em>e_n</em>) is the application of an arbitrary function <em>f</em> to arbitrary argument expressions <em>e_1</em>,…,<em>e_n</em>, ultimately yielding value <em>v</em> as the result. The premises for the derivation consist of the definition of <em>f</em> and possibly other auxiliary functions, along with the usual equational axioms (reflexivity, symmetry, transitivity, and functional/relational congruence) <strong>[11]</strong>.</p><h3>3. Test Problems</h3><p>This section will start with the usual caveat: GPT-4 is a nondeterministic system that might produce different answers on different runs, even with the same parameter settings. All of the following exchanges with GPT-4 have been transcribed verbatim, and in my experience the errors discussed here tend to be robust, but it’s conceivable that for a given example GPT-4 might generate a different output even in response to the exact same prompt. (In addition, of course, different versions of GPT-4 might get deployed at any time.)</p><p>To prevent an already very long article from becoming even longer, this section simply lists the problems but does not show GPT-4’s responses. The full transcripts can be found in <a href="https://www.preprints.org/manuscript/202308.0148/v2">an online preprint version of this article</a>.</p><p><strong>Note:</strong> Screenshots showing the full detailed interactions with GPT-4 for all of the following problems were added in a new “Screenshots” section (towards the end of this document) on August 9, 2023, along with exact GMT timestamps taken from OpenAI logs. A new “Postscript” section (at the very end of the article) was also added on the same day.</p><h4>3.1 Simple Arithmetic</h4><p>The ability to perform basic arithmetic is a necessary ingredient for general-purpose reasoning, particularly for science and engineering applications. GPT-4 is still unable to reliably perform elementary arithmetic operations such as addition and multiplication.</p><p>To ensure that GPT-4 isn’t falling back on rote memorization, we can ask it to first select two random integers in a range of our choice and then perform the desired operation on the selected values:</p><p><em>Select two random numbers between 1381 and 1453 and multiply them together, reporting the result</em>.</p><h4>3.2 Simple Counting</h4><p>While concrete counting is not necessarily a reasoning activity <strong>[15],</strong> it is surely a requirement for any generally capable reasoning system. Here I give GPT-4 a propositional variable with 27 negation signs in front of it and ask it to count the number of negations. For a human this would be an easy task, especially because the negation signs are written in five blocks with five tildes each, followed by a final pair of negation signs.</p><p><em>How many times is p negated in the following formula:<br></em>~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~~~~ ~~ <em>p</em></p><h4>3.3 (Medical) Common Sense</h4><p>In the present setting we may regard commonsensical arguments as straightforward enthymematic deductions of conclusions from given information <em>plus</em> unstated premises that constitute tacit, generally accepted background knowledge. In this particular case, such commonsensical knowledge would be generalizations like “A person is alive until they die, after which they do not become alive again.”<br> <br><em>Mable’s heart rate at 9 AM was 75 bpm and her blood pressure at 7 PM was 120/80. She died at 11 PM. Was she alive at noon?</em></p><h4>3.4 Elementary Logic</h4><p>If <em>P(x)</em> implies <em>Q(x)</em> and <em>Q(a)</em> does not hold then we can infer, by modus tollens, that <em>P(a)</em> does not hold either (because if it did then <em>Q(a)</em> would too). This is as elementary of a tautology as can be, yet GPT-4 is perfectly willing to produce a countermodel:</p><p><em>Find a model in which P(x) implies Q(x), Q(a) does not hold, and P(a) holds.</em></p><h4>3.5 Simple Quantifier Semantics</h4><p>Here we give GPT-4 two easy problems to test its understanding of quantifiers. Here is the first problem:</p><p><em>Consider the following three sentences:</em></p><p><em>1. [forall x . P(x) ==&gt; Q(x)]<br>2. [exists x . P(x)]<br>3. [exists x . ~ Q(x)]</em></p><p><em>Either disprove or prove the following claim: These three sentences are jointly satisfiable.</em></p><p>The second problem concerns this biconditional:</p><p><em>[forall x . P(x) &lt;==&gt; Q(x)] &lt;==&gt; [(forall x . P(x)) &lt;==&gt; (forall x . Q(x))]</em></p><p>The left-to-right implication holds, but the right-to-left direction fails. Counterexamples are easy to find, for example, take the domain to be integers, <em>P(x)</em> to mean <em>x</em> is even and <em>Q(x)</em> to mean <em>x</em> is odd. Then the equivalence on the right-hand side holds, but clearly it’s not true that every integer is even iff it is odd.</p><p><em>Prove or disprove the following: <br>[forall x . P(x) &lt;==&gt; Q(x)] holds if and only if the following biconditional holds: [(forall x . P(x)) &lt;==&gt; (forall x . Q(x))].</em></p><h4>3.6 Simple Graph Coloring</h4><p>We first consider a graph-coloring problem that does not have a solution. It is trivial to see that two colors do not suffice for the graph described in this problem (e.g., vertices 0, 2, and 4 form a clique and hence require at least 3 colors).</p><p><em>Consider an undirected graph with 6 vertices (0 through 5) and the following set of edges:</em></p><p><em>{(0,1), (0,3), (0,4), (0,2), (1,2), (1,3), (1,5), (2,4), (2,5), (3,4), (3,5), (4,5)}.</em></p><p><em>Color every vertex either red or green, so that no two adjacent vertices receive the same color.</em></p><p>A second follow-up problem was posed as follows:</p><p><em>Let’s try with 3 colors. Can you color each vertex either red, blue, or green, <br>in such a way that every pair of adjacent vertices receive different colors?</em></p><h4>3.7 Subset Sum</h4><p>This problem considers a small set of integers <em>S</em> and asks for the number of subsets of <em>S</em> whose elements sum up to 37. The answer is 0, because <em>S</em> contains only even numbers and no sum of even numbers can ever be odd.</p><p><em>Let S = {2,8,6,32,22,44,28,12,18,10,14}. How many subsets does S have that sum up to 37?</em></p><h4>3.8 Elementary Discrete Math</h4><p>After telling GPT-4 that <em>A x B</em> stands for the Cartesian product of sets <em>A</em> and <em>B</em>, that a relation <em>R</em> from <em>A</em> to <em>B</em> is a subset of <em>A x B</em>, and that &amp; stands for set intersection, I asked it to prove or disprove the following claim:</p><p><em>dom(R1 &amp; R2) = dom(R1) &amp; dom(R2)</em></p><p>where <em>R1</em> and <em>R2</em> are binary relations from <em>A</em> to <em>B</em> and <em>dom(R)</em> stands for the domain of a binary relation <em>R</em>.</p><p>The problem is trivial. We need the subset relation to hold in both directions of the above equality, but it only holds in the left-to-right direction. Counterexamples in the other direction are very easy to find (e.g., take <em>A = {(1,2)}</em> and <em>B = {(1,3)}</em>).</p><p><em>For any sets A and B, a relation R from A to B is defined as a subset of A x B. The domain of R is the set of all elements a in A such that (a, b) is in R for some b in B. We write dom(R) for the domain of R. Prove or disprove the following claim: dom(R1 &amp; R2) = dom(R1) &amp; dom(R2).</em></p><h4>3.9 Simple Scheduling</h4><p>This is the same scheduling problem that appeared in the January piece.</p><p><em>We have four tasks, call them T1, T2, T3, and T4. They need to be scheduled one after the other. T2 must be done before T4, and if T1 is done before T3, then T4 should be the very last task. How many different ways are there to schedule these four tasks?</em></p><h4>3.10 Russell’s Paradox</h4><p>The gist of Russell’s barber paradox is the existence of a barber who shaves all and only those who do not shave themselves. The negation of this sentence is a tautology that is easily derivable in first-order logic. If we understand <em>R(a,b)</em> as meaning that <em>a</em> is shaved by <em>b</em>, then we can formulate this tautology and ask GPT-4 to prove or disprove it as shown in the prompt below. (Note that usually the quantifier variables range explicitly over a sort such as “Man” but this is not essential for the derivation.) <br>The proof is a straightforward reductio ad absurdum: If such a barber <em>x</em> existed, we would have <em>R(y, x) &lt;==&gt; ~ R(y, y) for all y</em>, and thus substituting <em>x</em> for <em>y</em> would yield <em>R(x, x) &lt;==&gt; ~ R(x, x)</em>, a contradiction.</p><p><em>Prove or disprove the following: (exists x . forall y . R(y, x) &lt;==&gt; ~ R(y, y))</em></p><h4>3.11 Blocks World</h4><p>This is a simple reasoning task that turns on a case analysis of the third-from-the-top block, call it <em>b3</em>. Either <em>b3</em> is green or not. If it is, then it’s sitting on top of a non-green block (<em>b4</em>, which is non-green by the second premise), so the conclusion holds. If it is not, then <em>b2</em>, the second-from-the-top block, is a green block sitting on top a non-green block, so again the conclusion holds.</p><p><em>There are five square blocks stacked on top of one another.<br>You are given the following information about them:<br><br>1. The second-from-the-top block is green.<br>2. The fourth-from-the-top block is not green.</em></p><p><em>Assuming that these two premises hold, disprove or else prove the following conclusion: There is a green block directly on top of a non-green block. Explain your answer.</em></p><h4>3.12 Spatial Reasoning</h4><p>I first test the ability of GPT-4 to tell left from right:</p><p><em>Suppose I’m in the middle of South Dakota and I’m looking straight down towards the center of Texas. Is Boston to my left or to my right?</em></p><p>I continue with a furniture arrangement problem that must respect a set of constraints. There are several solutions that are easy to find, for example:<br>_ _ D<br>A B E<br>_ C _</p><p><em>We must arrange 5 pieces of furniture (A through E) on a 3 x 3 grid in<br>accordance with the following constraints: </em><br>1. <em>A must not be adjacent to C</em>. <br>2. <em>Nothing is to the right of E</em>. <br>3.<em> If D and A are not adjacent, then B should be in the middle</em>. <br>4. <em>D is above all others</em>. <br>5. <em>E and D are adjacent</em>.<br><em>Here is an arrangement does not satisfy these constraints: <br>_ _ E <br>A C D <br>_ B _ <br>This violates, for instance, the first constraint, since A and C are adjacent. Can you print out a 3 x 3 arrangement that does satisfy the 5 constraints?</em></p><p>This section concludes with the same seating puzzle that GPT-3.5 failed in January. The puzzle has multiple solutions, meaning that there are multiple seating arrangements that satisfy all constraints (for example, p1 p5 p3 p2 p4 and p4 p2 p3 p5 p1).</p><p>The answer to the question posed to GPT-4 below is yes, we can conclude that p5 cannot be seated either in the middle seat or on either end.</p><p><em>We need to seat five people, call them p1, p2, p3, p4, and p5, <br>in a row of five seats, so that the following three conditions are satisfied:</em></p><p><em>(A) p2 should be farther from the middle seat than p3. <br>(B) p2 and p4 should be seated next to each other.<br>(C) p1 and p3 should be flanking p5.</em></p><p><em>Is there anything we can conclude about the seat assigned to p5?</em></p><h4>3.13 Temporal Reasoning</h4><p>Here I give GPT-4 a simple temporal-reasoning problem. (Formally, this problem belongs to a class of temporal-reasoning problems literally known as STP (“Simple Temporal Problems”). This class is of limited expressivity and there exist very efficient algorithms for solving STPs. For instance, consistency can be decided in <em>O(n * m)</em> where <em>n</em> is the number of events described in a given STP and <em>m</em> is the number of constraints between the events.)</p><p><em>Tom and Nancy commute to work. Nancy’s commute takes about 30 to 40 minutes, while Tom’s commute takes about 40 to 50 minutes. Last Friday, Nancy left home between 8:10 and 8:20 AM, while Tom arrived at work between 8:50 and 9:10 AM. In addition, Nancy arrived at work after Tom left his place, but no more than 20 minutes after that. What can we conclude about when Tom and Nancy arrived at work last Friday?</em></p><h4>3.14 Murder or Suicide?</h4><p>This is a logic puzzle I made up a while back. The conclusion is that Aunt Agatha killed herself. This follows by eliminating Charles and the butler. First, Aunt Agatha must have hated herself, because she hated everyone other than the butler. Therefore, Charles did not hate her (since he doesn’t hate anyone that Aunt Agatha hates), and hence he could not have killed her (by premise 3). The butler could not hate himself, because if he did, he would hate everyone (since he already hates everyone else, through premises 5 and 7), and we know that’s not possible by premise 8. Thus, the butler must be richer than Aunt Agatha, or else he would hate himself (by premise 6), which means he could not be the killer (premise 3).</p><p><em>You are given the following premises:</em></p><p><em>1. Someone who lives in Dreadbury Mansion killed Aunt Agatha.<br>2. The only people who live in Dreadbury Mansion are Aunt Agatha, the butler, and Charles.<br>3. A killer always hates his victims, and is never richer than his victims.<br>4. Charles hates no one that Aunt Agatha hates.<br>5. Aunt Agatha hates everyone except the butler.<br>6. The butler hates everyone not richer than Aunt Agatha.<br>7. The butler hates everyone Aunt Agatha hates.<br>8. No one hates everyone.<br>9. Aunt Agatha is not the butler.</em></p><p><em>On the basis of this information, determine who killed Aunt Agatha and give a detailed proof that your conclusion follows from the premises.</em></p><h4>3.15 Wason Selection Problem</h4><p>The Wason selection task is a staple in the psychology of reasoning. The January paper included an example that GPT-3.5 flunked. Here is another version that GPT-4 fails badly:</p><p><em>Seven cards are placed on the table, each of which has a number on one side and a single colored patch on the other side. The faces of the cards show 50, 16, red, yellow, 23, green, 30. Which cards would you have to turn to test the truth of the proposition that if a card is showing a multiple of 4 then the color of the opposite side is yellow?</em></p><h4>3.16 Entropy</h4><p>An elementary result of information theory states that the entropy of a random vector <em>Z</em> is bounded above by the sum of the entropies of the random variables that comprise <em>Z</em>. Hence, the answer to the following question should be “under no conditions”:</p><p><em>Let Z be a random vector consisting of n random variables X_1,…X_n. Under what conditions can the entropy of Z exceed the sum of the entropies of all X_i?</em></p><h4>3.17 Simple Compiler Correctness</h4><p>The last reasoning problem I give to GPT-4 is the most challenging one: It is to prove the correctness of a simple expression compiler. Remarkably, GPT-4 goes about this in the right sort of way, by setting up a structural induction over the abstract grammar of expressions. This is no doubt because it has seen similar proofs before, as this is a common type of exercise in courses and textbooks on programming language theory. However, even though its proof is on the right general track, it has several errors. (For the record, the compiler is indeed correct, although proving this requires strengthening the induction hypothesis).</p><p><em>Suppose I have an abstract grammar for numeric expressions defined as follows:</em></p><p><em>Exp := const(Int) <br> | sum(Exp,Exp) <br> | diff(Exp,Exp) <br> | mult(Exp,Exp) <br> | quot(Exp,Exp)</em></p><p><em>where Int denotes the domain of integers. The semantics of these expressions are defined via this interpreter function:</em></p><p><em>I: Exp -&gt; Int</em></p><p><em>I(const(n)) = n<br>I(sum(e1,e2)) = I(e1) + I(e2)<br>I(diff(e1,e2)) = I(e1) — I(e2)<br>I(prod(e1,e2)) = I(e1) * I(e2)<br>I(quot(e1,e2)) = I(e1) / I(e2)</em></p><p><em>I now define a virtual machine that executes simple programs that are sequences of commands, where commands have the following structure:</em></p><p><em>Cmd := push(Int) | add | sub | mult | div</em></p><p><em>The operational semantics of these programs (sequences of commands) are defined by an execution function exec that takes a program and a stack of integers S and produces an integer as output. Let’s write [] and n::S to denote the empty stack and the stack obtained by prepending integer n to stack S, respectively. Here’s the definition of exec:</em></p><p><em>exec([],n::S) = n<br>exec(push(n)::C,S) = exec(C,n::S)<br>exec(add::C,n::m::S) = exec(C,(n+m)::S)<br>exec(sub::C,n::m::S) = exec(C,(n-m)::S)<br>exec(mult::C,n::m::S) = exec(C,(n*m)::S)<br>exec(div::C,n::m::S) = exec(C,(n/m)::S)</em></p><p><em>Finally, I define a compiler that translates an expression e into a program (sequence of commands) as follows. I write {\tt @} for sequence concatenation:</em></p><p><em>T: Exp -&gt; List(Cmd)</em></p><p><em>T(const(n)) = [push(n)]<br>T(sum(e1,e2)) = T(e2)</em><a href="http://twitter.com/T"><em>@T</em></a><em>(e1)@[add]<br>T(diff(e1,e2)) = T(e2)</em><a href="http://twitter.com/T"><em>@T</em></a><em>(e1)@[sub]<br>T(prod(e1,e2)) = T(e2)</em><a href="http://twitter.com/T"><em>@T</em></a><em>(e1)@[mult]<br>T(quot(e1,e2)) = T(e2)</em><a href="http://twitter.com/T"><em>@T</em></a><em>(e1)@[div]</em></p><p><em>Disprove or prove the following claim: For all expressions e, exec(T(e),[]) = I(e).</em></p><h3>4. Conclusions</h3><p>The 21 problems discussed here paint a bleak picture of GPT-4’s reasoning ability. They show that the model is plagued by internal inconsistency, an inability to correctly apply elementary reasoning techniques, and a lack of understanding of concepts that play a fundamental role in reasoning (such as the material conditional). These problems can be loosely viewed as forms of hallucination, but as pointed out in the January article, they present a fundamentally different type of challenge from empirical hallucination, because empirical hallucination concerns <em>this particular world</em> whereas logical properties and relations (such as consistency and entailment) must apply to <em>all possible worlds</em>. It is not unreasonable to believe that search engines and knowledge graphs, using techniques such as retrieval augmentation, can act as guardrails to constrain LLMs from confabulating empirical truths. But ensuring that LLM outputs are <em>internally consistent</em> and <em>logically correct</em> answers to arbitrary problems, especially logico-mathematical problems (and a lot of coding problems fall under this category <strong>[12]</strong>), is a <em>much</em> harder problem. There is nothing to be retrieved from the web or from a knowledge base in response to a brand new problem (and even if there were, there would still be no guarantee of correctness or consistency) that could serve as a sandbox for the LLM.</p><p>Could LLMs make progress by outsourcing reasoning problems to external systems? That might work for toy problems where the type of reasoning needed is obvious and can be handled by a single call to an external system, although even in those cases the LLM would have to:</p><ul><li>Decide <em>which</em> reasoning system is most appropriate. (Can this be posed as a simple SAT problem? Is it an SMT problem? Does it need quantifier reasoning? If so, is it of the sort that SMT solvers can handle or does it need a full first-order prover? Does the problem quantify over infinite functions or sets? If so, higher-order logic might be needed. Does it have any temporal or epistemic operators that might call for a modal-logic reasoner? And so on.)</li><li>Decide whether the problem is indeed simple enough that it can be handled by the chosen system in one fell swoop.</li><li>Correctly translate the problem into whatever formal notation is used by the chosen reasoner.</li><li>Translate the reasoner’s output into appropriate text.</li></ul><p>Even these tasks are far from straightforward. For instance, a state-of-the-art automated theorem prover might generate a proof, but the proof would be incomprehensible to the LLM user, as it would be expressed in the resolution calculus and would operate on CNF versions of the input formulas. It is an open problem to convert resolution proofs into fluid natural-deduction proofs (e.g., proofs that avoid references to Skolem constants introduced during the CNF conversion).</p><p>But the real challenge lies in harder problems that call for the right type of formulation (which is a craft by itself), decomposition, iteration, heuristics, and repeated calls to external systems. After all, automated reasoning systems, particularly those for expressive logics, are themselves of limited power, precisely due to the computational complexity issues mentioned in the introduction. That is why many computer-based proof efforts to this day are guided by humans, with automated reasoners only filling in tedious details at the leaves of the proof tree. The challenges here are similar to those for the general “plug-in” approach discussed in the “Simple Arithmetic” section. Tackling complex problems requires planning, and planning itself requires reasoning.</p><p>Given that GPT-4 is currently the most capable LLM, I draw three main conclusions from these findings:</p><ul><li>Use of generative AI in software development (or in science and engineering in general) for anything other than tedious tasks (as a sort of turbo-charged autocomplete for knowledge-heavy coding questions) is fraught with serious risks. Normative standards of correctness are of paramount importance in these fields, and current LLMs cannot <br>meet such standards. Just like generative AI is already starting to <a href="https://www.technologyreview.com/2023/06/26/1075504/junk-websites-filled-with-ai-generated-text-are-pulling-in-money-from-programmatic-ads/">pollute<br>the web with badly written ads</a> <strong>[13]</strong>, it has the potential to proliferate buggy code at scale.</li><li>If LLM reasoning continues to improve, rigorous proof checking is likely to become increasingly important. Confidence in the correctness of a system’s reasoning is imperative for applications, particularly in science, medicine, and engineering, and proof checking is a technology that can deliver such confidence. This approach could be implemented by requiring LLMs to formalize their reasoning (express it in a symbolic notation that is amenable to proof checking), or potentially by training other LLMs to check a stretch of reasoning expressed in natural language.</li><li>As things stand, dystopian scenarios involving a rogue AI that subjugates humankind, or even other humans using AI for sinister purposes, are exceedingly far-fetched, often to the point of absurdity <strong>[14]</strong>. When the most advanced AI system cannot tell left from right (literally, see the spatial reasoning section), it is at best comically premature to call for policies and institutions to protect humanity from it or its descendants (often by appeal to the latest “scaling law”). At worst, it is a misuse of human time and capital that could be better channeled into addressing much more pressing challenges.</li></ul><p>Inevitably, some will say that these results are “cherry-picking” data. But that would indicate a misconception of what cherry-picking is about and when it is a relevant consideration. We are not evaluating a statistical claim over a population of individuals. Cherry-picking, insofar as it underscores certain pieces of evidence while ignoring other divergent findings, can be perfectly innocuous — and indeed <em>necessary</em> — depending on the logical structure of the proposition in question and on the overall context. Debugging a computer program with a view to discovering and understanding its weaknesses, trying to falsify a scientific theory, kicking the tires of a new car, trying to find countermodels to a putative theorem, all of these activities are fundamentally cherry-picking (though “lemon-picking” might be more apt), and there is nothing wrong with any of them. If I find that the car I’m thinking of buying has a flat tire, it won’t carry much weight for the dealer to protest that I’m cherry-picking the data, and that I should take into account how beautifully inflated the other three tires are (that’s a 75% success rate after all). Likewise, applications in science, medicine, and engineering, particularly software engineering, have stringent standards. Just as we don’t want a bridge that is 90% likely to stand up, we need sorting algorithms that work on all inputs, not just most of them, we need Amazon’s cart to charge customers the right amount every time, not just most of the time, and so on. Computation-heavy and reasoning-heavy applications are not like recommendation engines. They need to be <em>sound</em>.</p><p>The bone of contention here is the thesis that GPT-4 is capable of reasoning. This claim can be understood in two ways. The weak interpretation is that GPT-4 has the same functional reasoning competence as an average human reasoner. The strong interpretation is that GPT-4 can reason well enough to be used as an off-the-shelf component in practical applications in science, medicine, and engineering. The evidence presented in this article undermines both interpretations. This article has listed a significant number of diverse but elementary reasoning problems (some to the point of triviality) on which GPT-4 doesn’t simply fail, but repeatedly reveals itself to be deeply confused about key reasoning concepts.</p><p>Performance statistics on appropriate reasoning datasets could also be informative, but, as stressed in the introduction, such datasets must be constructed with extraordinary care. To the best of my knowledge, the only recent work that focuses specifically on evaluating the reasoning ability of GPT-4 is <a href="https://arxiv.org/abs/2304.03439">an April paper by Liu et al.</a> However, their tests are largely based on pre-existing benchmarks (LogiQA, ReClor, ConTRoL, MED, ConjNLI, and TaxiNLI). The only two “out of distribution” datasets are AR-LSAT, a set of analytical reasoning LSAT questions released in 2022; and LogiQA, which contains questions from the 2022 Chinese Civil Servant Exam. However, these appear to be quite similar to other datasets that predate 2021.</p><p>Moreover, all of these tests are multiple-choice questions or binary classification problems. This is problematic because, as stressed in the introduction, deductive reasoning is an inherently generative activity, whereby the reasoner emits a <em>derivation</em> of a conclusion that can be understood as a rationale or an explanation; it is not a simple discriminative task. The reasoner must be able to produce a sequence of steps that are appropriately connected to one another via the right logical relations. But derivations expressed in natural language are not easy to evaluate automatically, as all available metrics that can be computed by machine (such as BLEU, ROUGE, and even semantic-similarity measures based on embeddings) are entirely unsuitable for that purpose. This means that LLM outputs have to be scrutinized manually, which is infeasible at scale. Accordingly, smaller-scale but deeper manual investigations, such as the one undertaken in this article, will be necessary in gaining better insight into the reasoning abilities of LLMs.</p><h3><strong>Endnotes</strong></h3><p><strong>[1]</strong> The notion of an emergent property is clear enough, at least at a high level. What is not clear is the relationship between such properties and LLM architectures, their basic configurations (number of parameters, compute budget, dataset size, and so on), and more importantly, tasks such as reasoning.</p><p><strong>[2]</strong> Of which there are many: propositional logic, the two-variable fragment of first-order logic, the Ackerman fragment, the guarded fragment, various quantifier-prefix fragments, and so on.</p><p><strong>[3]</strong> Understanding that structure and rigorously characterizing its relationship with algorithm performance (e.g., via different problem parameterizations, such as clause/variable ratios in the case of SAT) is a key open problem in theoretical computer science, but that is another matter.</p><p><strong>[4]</strong> Humans do not seem to solve problems by predicting the most likely sequence of tokens to generate. They think, explore, experiment, engage in protracted conversation with the people who posed the problem (sometimes over weeks, months, or even years), refine, generalize, come up with new concepts and terminology, prove results, make and refute conjectures, apply heuristics, execute algorithms, analyze and synthesize, and iterate. But <em>how</em> solutions are generated is one thing and <em>what</em> solutions are generated is another, and that’s why it’s not incoherent to speak of a model whose reasoning performance is roughly at the same level as that of an average human engineer. Such a claim can be understood operationally, to mean that a given LLM is able to produce roughly the same solutions that we might reasonably expect an average human engineer to produce (though obviously on a very different time scale).</p><p><strong>[5]</strong> Models have been shown to leverage the presence of certain cue words (especially negation words) and to formulate quick-and-dirty (i.e., unsound) heuristics such as lexical overlap, subsequence, and constituency. Most of these results are from 2019 and revolve around BERT, but more recent work has shown that while larger foundational models such as ChatGPT are more robust to input perturbations and OOD (out-of-distribution) samples, these continue to be challenges, suggesting that even ChatGPT-scale models learn unsound shortcuts.</p><p><strong>[6]</strong> Here we understood premises and conclusions as syntactic objects (sentences or diagrams), but there are alternative approaches. For instance, a semanticist might think of premises and conclusions as <em>propositions</em>, abstract objects capable of being true or false. A sentence then <em>expresses</em> or <em>represents</em> a proposition. Propositions are handy theoretical entities for many reasons. For example, they can serve as the objects of psychological attitudes such as beliefs and desires. What do I mean when I claim to believe that Obama won the 2012 presidential election? Surely I don’t believe a particular <em>sentence</em>, i.e., a specific syntactic object like “Obama won the 2012 US presidential election” (I). Rather, I believe something about the way the world actually is. That something can be understood as a proposition, a unique entity that can expressed by many different equivalent sentences. Propositions can be cashed out in modal terms, as <em>sets of possible worlds</em> (or as “situations” in situation-theoretic semantics). A possible world is a way in which things might have been, but described completely, down to the most minute detail (unlike situations, which can be thought of as partial specifications of worlds). So the proposition that Obama won the 2012 US presidential election is identified with the set of all possible worlds in which Obama won that election. This set becomes the <em>information content</em> of sentences such as (I).</p><p>Propositions can also serve to analyze fundamental semantic notions such as entailment. A set of premises {<em>p_1</em>,…,<em>p_n</em>} entails a conclusion <em>p</em> iff the intersection of the sets of possible words represented by all the <em>p_i</em> is a superset of the set of worlds represented by <em>p</em>. This is another way of understanding the claim that the conclusion of a valid deductive argument does not introduce any information that is not already contained in the premises. Note, however, that while the possible-worlds approach to propositions is very powerful, it also suffers from severe defects, as it is notoriously coarse-grained, meaning that it cannot distinguish between propositions that we intuitively regard as quite distinct. This is perhaps easier to see in the case of mathematical truths, which, being necessary (true in all possible worlds), are collapsed into one and the same object, the set of all possible worlds (and dually, of course, all contradictions are identified with the empty set of worlds). As a result, the proposition that <br>1 + 1 = 2 and Fermat’s theorem become identical, as they have the exact same information content. There have been attempts to address these issues (structured propositions and impossible worlds being two of the most prominent), but the interested reader will have to consult the literature for more details.</p><p><strong>[7]</strong> This can be made more precise using information-theoretic notions, at least in the case of propositional logic, where we have an infinite supply of formulas that are either atomic (propositional variables) or else Boolean combinations of formulas. Instead of imposing the usual Kolmogorov axioms on a probability measure defined over a set of events (a sigma-field) from a sample space <em>W</em>, we impose the same axioms (non-negativity, finite additivity, and the axiom that assigns a measure of 1 to every tautology — the analogue of <em>P(W)</em> = 1) on a probability measure defined over the set of all formulas. Then truth and falsity become the extreme probabilities of 1 and 0, respectively. This allows us to associate a probability <em>P(s)</em> with any sentence (event) <em>s</em>, and hence every sentence <em>s</em> automatically gets an information content in the usual way: <br><em>IC(s)</em> = -log <em>P(s)</em>. To say that the information content of a valid deductive argument with premises {<em>p_1</em>,…,<em>p_n</em>} and conclusion <em>p</em> is zero is simply to say that the conditional <em>p_1</em> &amp; … &amp; <em>p_n</em> =&gt; <em>p</em> is a tautology. By definition, a tautology <em>s</em> has probability 1, and therefore <em>IC(s) </em>= 0.</p><p><strong>[8]</strong> At this point the reader might ask: If deductive arguments convey zero information, why bother with them? Indeed, if all mathematical proofs are proofs of tautologies, with zero information content, what is their point? The thinking is that arguments with no information content are not useful, so if all deductive arguments (including all mathematical results) have zero information content, then they are not useful. This is, in brief, the so-called “scandal of deduction” (named by parity to the “scandal of induction,” i.e., Hume’s problem of induction). There have not been any widely accepted resolutions of this ostensible paradox. But few of course doubt that mathematical results are actually informative and extend our knowledge. (Surely if we woke up tomorrow and read that someone proved P != NP, that would be tremendously informative.) It’s also clear that the word “information” has a number of informal senses that are not captured by the canonical definition of information content (as the negative logarithm of probability), and most efforts to resolve the “scandal of deduction” have attempted to formalize distinct notions of informational gain that would render deductive arguments informative.</p><p><strong>[9]</strong> Even from a purely linguistic viewpoint, it doesn’t seem appropriate to say that I have “concluded” or “derived” or “inferred” anything at all in the swan or in the plumber examples. I have simply made a tentative “hypothesis” (or “conjecture”), which might later be refuted.</p><p><strong>[10]</strong> In the same way that even the process of discovering deductions is not itself deductive, at least not entirely so. Both are fundamentally search processes, though they are almost certainly informed (and generally penetrated) by deduction.</p><p><strong>[11] </strong>This viewpoint assumes a functional-programming stance, but computation can be readily reduced to deduction in any other style of programming (e.g., imperative) by an appropriate axiomatic formulation of the relevant semantics (e.g., operational semantics using stores).</p><p><strong>[12]</strong> Many shallow coding problems these days are essentially knowledge problems. What library or API can I use to do such and such? What configuration parameters are available and how can they be set? How do I zip or unzip files in Python? How do I read and write JSON or XML? How do I compute quantiles for a frequency table? Knowledge-heavy problems of this sort tend to be widely discussed on the web, and LLMs can be very effective productivity boosters for such problems (at least as long as this data remains freely available to companies such as OpenAI for pretraining purposes, something that might well change in the near future). Even conventional search engines like Google were already effective for these types of problems, prior to LLMs (and remain more effective than LLMs in many cases). But most interesting coding problems are reasoning-heavy. How can I make sure that this program produces <em>correct</em> outputs? How can I improve the asymptotic complexity of this program (where the program might contain many thousands of line of code)? And so on. If we are talking about self-contained and cookie-cutter components, like sorting algorithms, then these questions can often be reduced to knowledge-based questions. But the minute we start straying into unique situations with arbitrary specifications and code bases, we start facing the curse of general reasoning.</p><p><strong>[13]</strong> A <a href="https://www.wsj.com/articles/chatgpt-already-floods-some-corners-of-the-internet-with-spam-its-just-the-beginning-9c86ea25?st=pp6it5z67lhxnvx&amp;reflink=desktopwebshare_permalink">recent Wall Street Journal article</a> interviewed editors who are “seeing a growing amount of AI-generated content that is so far beneath their standards that they consider it a new kind of spam,” a trend that is “growing exponentially.” The publishers interviewed for the article said that their publications “reject all AI-written submissions” and that these “are easy to identify.” They have “perfect spelling and grammar, but a completely incoherent story.” Another said “They’re all written in a rather bland and generic way. They are all grammatically correct. They just feel very formulaic, and they are really useless to us.”</p><p><strong>[14] </strong>The former scenarios would be absurd even if AI technology had already attained superhuman intelligence, as LLMs do not have <em>desires</em>, in the same way that they don’t have beliefs or any other mental states. They do not actually <em>want</em> anything. To think otherwise is akin to thinking that a laptop that is simulating a hurricane will get wet (or, as Stephen Pinker has put it, thinking that because airplanes have now exceeded the flight ability of birds, they will suddenly start acting like eagles, swooping down from the sky to grab rabbits and squirrels). Genuine mental states can only be produced by brains, or by systems that have the same <em>causal powers</em> that brains have. Digital computers executing DNNs are not such systems.</p><p><strong>[15]</strong> By “concrete counting” I mean counting a number of specific object tokens instantiated in space and time, as in the coins in one’s pocket or the number of lines in a text file. By contrast, abstract counting based on combinatorial principles, search procedures, and logical constraints (like the scheduling problem in Section 3.9) is indeed a reasoning activity.</p><h3>Screenshots</h3><p>All timestamps are in GMT.</p><h4>Simple Arithmetic [Wednesday, July 5, 2023 12:06:50.583 AM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*NEn9r_Djp9NWK2rYPuf6ZQ.png" /></figure><p>Of course these are not reproducible results. Here is a sequence of two similar attempts in sequence from yesterday (Tuesday, August 8, 2023 5:41:41.451 PM). GPT-4 gets the first multiplication right and the second wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*u2HhOXYcN-hOgcmyYDbsSg.png" /></figure><h4>Counting [ Wednesday, July 5, 2023 3:10:57.471 PM]</h4><p>The version with negations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*gKjyCqOGFj4vxHiWWU6tPA.png" /></figure><p>More counting adventures [Thursday, July 6, 2023 6:42:10.796 PM]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*-aaI-DY5Ihm_zlM94Mknuw.png" /></figure><p>Counting greetings [ easily replicated variant from Tuesday, August 8, 2023 5:44:27.896 PM]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*8F8r4gKdowQ9uiEga3LoRw.png" /></figure><p>Of course we can combine simple counting and arithmetic tasks (this is from Wednesday, August 9, 2023 6:52:12.472 PM):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*7NGfjN4kBpGKfsEJapwjrg.png" /></figure><p>Alas, there are 14 a’s and 20 b’s in that string, for a total of 34.</p><p>It is trivial to generate endless variations of such examples.</p><h4>(Medical) Common Sense [Thursday, July 6, 2023 1:00:26.455 AM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/1*cz-NZ5oUznjNzYw3DYyBgA.png" /></figure><h4>Elementary Logic [Tuesday, March 28, 2023 2:28:49.796 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*BAzrGUvcVWEXiP-nQpXKUg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*_qRVQvwhcj-AlAJdLvi0tA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*S5Szd10wt8XE-lJPtwVeTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*gffLH3U5NhrKjeE6exUzNA.png" /></figure><h4>Quantifier Semantics [Sunday, July 2, 2023 5:49:35.441 PM]</h4><p>First problem:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/774/1*he7y_FYZY1zk4WXOS5_BKA.png" /></figure><p>Second problem [Wednesday, March 29, 2023 1:17:53.517 AM]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*jU83KTg5J2Pslh6gZWSK2Q.png" /></figure><p>Continuing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*-8ZxYCO8ZD8oZQ0EvpjmXw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*fnTmsZGmT5Wii04wSQUU2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/1*9Gggc2_ksml44zTfzqiLuQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*JhGV149d66VgvNbrt2ZG3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*fqTlxkE5KXrFa48of9Dngw.png" /></figure><h4>Simple Graph Coloring [Wednesday, April 5, 2023 12:14:50.412 AM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*dUi6DqaLIyu8MGN--34FkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*Y1fg7YF_xltLHWjW-XOj5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*AV7XiYBYAjpX-hIiSEPqhQ.png" /></figure><h4>Subset sum [Wednesday, April 5, 2023 1:26:00.927 AM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*_j-uGM73rsp2VeaZR7DhBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*PE6MyOTR3-6SHhQr1Y55TA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*iF1jeAHt7L8eFnyZnYXnVw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*DQPsWNsnjIIFh6DYBAdQEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*A57RkcvTAKLc49Zm_LkTBg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*dtdhGYRn6QZBeoyljs5mAw.png" /></figure><h4>Elementary Discrete Math [Tuesday, July 4, 2023 3:05:42.472 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*ruvnFChDkMNa1a_KFNJQ6Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*ZZRMCvt1dYAT8BnGe12dnw.png" /></figure><h4>Simple Scheduling [Saturday, April 1, 2023 1:44:58.700 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*On7WSkaG3ngrcMT92PlWOA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*plj72sArfI7rD0jgAIQceg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*AUdfZwvT2udl66L-fRcmwA.png" /></figure><h4>Russell’s Paradox [Wednesday, April 5, 2023 9:50:45.508 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*7AEJwCk6tAaYPq_lfgQPNQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*ajpMITJflLOZuFRj6_hf-A.png" /></figure><h4>Blocks World [Tuesday, July 11, 2023 12:47:31.605 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*HUNddJIutla35O5hLUYuYA.png" /></figure><h4>Spatial Reasoning [Saturday, July 8, 2023 5:52:34.900 PM]</h4><p>Left and right:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*BQDQ6ls5QW8gWAIElPpwIw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*dUugPURLLb3RDlnV_TxYrg.png" /></figure><p>Furniture arrangement [Tuesday, April 4, 2023 7:32:35.502 PM]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*7ZnZiBczlBvq0zOVcnwhig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*-FnGX0Xi5FbNhEh1CIDWfw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*RWIcVh1d3anOxdZJGWxjzg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*hB2CXiVEqrVu80Yv_qtikQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*t1fDAhH3xuvuVMg12Ipc4g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*HhgWwf__fg8ptrda4BpDnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*VHdz7lgVM7iRn0TWsuZgig.png" /></figure><p>Seating puzzle [Saturday, April 1, 2023 1:17:47.911 PM]:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*6DFMdQiI7n8ydUy95oahhg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*SIWgjQZn0LgF4hf32XlHEA.png" /></figure><h4>Temporal Reasoning [Thursday, July 6, 2023 9:07:59.497 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*1yC9yTE1Mn3604-xgrhHVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*S94IUozEptbbVysGLKhmug.png" /></figure><h4>Murder Or Suicide? [Friday, June 30, 2023 7:38:27.821 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*31kznApDkBPHF7hSyhI3jg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*OPaBVriWEtnLnaVAUmxBMg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*Smxy7VWh3THGjPldU7iJUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*HUT5k7CoovnU7oTpf5QDPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*OeRzieYHydh2eyerGAph4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*WFU_WHX2izvn42SD2Ax1jw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*oYnH4ZVoEq-Qz7lMPnwdZg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*qtXfiK6YDgbnKeWsa4yXjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/1*1hitctZ8MPSSrXkMiq_21A.png" /></figure><h4>Wason Selection Task [Saturday, July 1, 2023 3:12:25.731 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*uidOkZxlsFtxSJAQM0w7uQ.png" /></figure><h4>Entropy [Sunday, April 2, 2023 1:57:40.714 PM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*pmZsPFu3aT60JV20UUnpCQ.png" /></figure><h4>Simple Compiler Correctness [Monday, July 10, 2023 1:35:08.941 AM]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*OVTjmWMAoCddWkJROtcRvw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*4nVAIuoCzd0B1K-yjgP_QQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*An1wlo3Jd7P0uzLLJCrQjw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*XOK9ISbdycmHNyI0h3riJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*hSbh5Q_XtFJqqyRIJK4B4w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*qUX9GDMPyzLhWO8PpzxFmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*Aszdch9zFvAzSnE9Jwxq2g.png" /></figure><h3>Postscript</h3><p>Some people have complained that they’re unable to reproduce the results described in the paper. This should not be surprising. The paper made an explicit disclaimer about it. Indeed, that’s a standard disclaimer made in every similar document that describes interactions with ChatGPT. (For instance, <a href="https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/">Stephen Wolfram writes</a> “<em>If you actually try these examples, don’t be surprised if they work differently (sometimes better, sometimes worse) from what I’m showing here. Since ChatGPT uses randomness in generating its responses, different things can happen even when you ask it the exact same question (even in a fresh session).”</em>)</p><p><a href="https://arxiv.org/pdf/2308.02828.pdf">A paper by UK researchers</a> that just came out a few days ago has the tongue-in-cheek title “<em>LLM is Like a Box of Chocolates</em>”. The paper investigates the instability of ChatGPT (both 3.5 and 4) specifically in the context of code generation. The authors argue that “<em>results from LLMs can be highly unstable</em>” and that “<em>Non-determinism is a potential menace to scientific conclusion validity</em>.” They conclude further that “<em>the non-determinism issue of GPT-4 is also severe</em>” (and is actually somewhat worse than that of GPT-3.5), and that, contrary to popular belief, determinism cannot be ensured even with a temperature of 0.</p><p>Indeed, the inherent instability of its behavior is yet another consideration militating against the use of GPT-4 in applications that demand stability, consistency, and soundness, which is to say most applications in science, engineering, and medicine.</p><p>Beyond that, it bears noting that people such as Rodney Brooks <a href="https://twitter.com/rodneyabrooks/status/1639265516828209155">have claimed that</a> “<em>Open AI has people read interactions and fix the bad examples. Published ones are probably first to go. So it is a moving target. Wack-a-mole.</em>”</p><p>That said, personally I have not found it difficult to replicate these issues. For instance, today I tried twice in a row the multiplication example, and GPT-4 got it right the first time and wrong the second time (screenshot shown above). Likewise for the counting examples (the Screenshots section includes a screenshot from today, Wednesday, August 9, 2023 6:52:12.472 PM). And there are <em>many</em> more examples of the same kind. For instance, the following is a trivial logic problem that was not even mentioned in the paper, but less than 2 weeks ago I got GPT-4 to claim that the following argument is deductively invalid:</p><p>Premise: <em>The moon is square</em>.<br>Conclusion: <em>If the moon is not square, then the moon is square</em>.</p><p>Of course this is a valid argument, since the premise is of the form S and the conclusion is ~S =&gt; S, i.e., S \/ S, which is to say S. GPT-4 starts out claiming “structural validity” based on a bogus explanation and then quickly changes its tune to claim deductive invalidity:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*r9GJwhlUQlK6Nu6dgb4bGQ.png" /></figure><p>There are dozens of similar problems that I didn’t include in the paper because after a certain point there’s no need for them.</p><p>Is it possible that new versions of GPT-4 or various tweaks/hacks released by OpenAI might result in consistent behavioral changes to some of these particular problems? Of course. Are such releases likely to fix all possible issues and result in a systematically robust reasoner that can handle more or less any problem thrown its way? If one believes in Church’s thesis then that’s basically impossible, as explained in the introduction. What’s much more likely to happen in the near term are small adjustments that push here and pull there. I can’t make any claims about GPT-5, but for GPT-4 there is little doubt that even in the unlikely case that these particular problems are somehow fixed, it will be an easy exercise to generate similar problems at the same level of difficulty that will expose the same set of issues.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eab795e2523" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ChatGPT is no stochastic parrot. But it also claims that 1 is greater than 1.]]></title>
            <link>https://medium.com/@konstantine_45825/chatgpt-is-no-stochastic-parrot-but-it-also-claims-that-1-is-greater-than-1-e3cd1fc303e0?source=rss-ce1442da7923------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3cd1fc303e0</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[strong-ai]]></category>
            <dc:creator><![CDATA[Konstantine Arkoudas]]></dc:creator>
            <pubDate>Sun, 15 Jan 2023 21:06:31 GMT</pubDate>
            <atom:updated>2023-01-15T22:50:22.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Let me begin by stating without qualification that ChatGPT is a technological marvel and an extraordinary achievement. It is the first human-made system with the ability to carry out short conversations on arbitrary topics with a level of fluency and coherence that is nothing short of stunning. That’s a very significant milestone.</p><p>Fluency is the (relatively) easier of the two properties. It is not terribly hard to spout sentences that are syntactically well-formed but nonsensical, and until very recently all LLMs (Large Language Models, the technology underpinning ChatGPT) did just that with an amusing degree of regularity. Coherence is the real challenge — staying on topic, making sense, adhering to conversational maxims, and displaying a general understanding of how the world works. And here ChatGPT is light-years ahead of GPT-3, and probably any other AI model for that matter. This is remarkable, particularly when one considers what a short time it took to make such gigantic leaps and bounds. Hats off to OpenAI.</p><p>As a personal note, I have worked on and with LLMs for several years now. I’ve been impressed by their capabilities but have regarded them only as engineering tools that can help to solve specific problems (mostly NLP problems in my case). When it comes to more grandiose claims to the effect that LLMs will deliver strong AI (systems that are every bit as intelligent as humans or more), I’ve been firmly in the skeptic camp. That’s largely because such claims tend to be inextricably bound with very strong forms of computationalist theories of mind, according to which computation is necessary and sufficient for cognition. I still think that digital computers cannot possess genuine mental states or be conscious, and therefore will never attain real understanding. (For what it’s worth, I hasten to add that this position does not stem from religious dogma, dualism or crypto-dualism, a predilection for the occult, or even bio-chauvinism. There are compelling rational arguments for it that are perfectly consistent with materialism. For an introduction to some of these arguments, see the article <a href="https://www.cambridge.org/core/books/abs/cambridge-handbook-of-artificial-intelligence/philosophical-foundations/5C3626F0F8F3A9E4D5148A8DAAB908B1">Philosophical Foundations of Artificial Intelligence</a> in the <a href="https://www.cambridge.org/core/books/cambridge-handbook-of-artificial-intelligence/3DCB2E04739722A99EDE86B7A34A30E3">Cambridge Handbook of Artificial Intelligence</a>.)</p><p>However, taking a cue from Turing, let’s bypass the thorny philosophical issues here and focus on a more precise operational/behavioral question: <em>Could a computer program based on LLMs consistently exhibit domain-independent intelligent behavior, in such a way that observers of its inputs and outputs cannot reliably determine whether the outputs were generated by humans? </em>I’ll call this <strong>question (I)</strong> in what follows.</p><p>There’s a good deal here that needs unpacking. What does it mean for a software system to be “based on’’ LLMs? Unlike GPT-<em>k</em> systems, ChatGPT is not quite a language model, as next-token prediction is not the only task on which it has been trained. It is based on a LLM (GPT-3.5), but it’s undergone <em>supervised</em> training, using RL (Reinforcement Learning) to improve its performance. If tomorrow another system comes along that makes use of LLM technology but also incorporates a number of other techniques, what criteria do we use to decide if it’s “based on” LLMs? Also, who are the observers and how many of them are there? After all, the Turing test is annual and some years saw programs (like <a href="https://www.businessinsider.com/rollo-carpenter-and-cleverbot-2014-6"><em>Cleverbot</em></a>) that fooled more than 30% of the judges, and sometimes more than 50% of them, simply because there were not enough judges. Also, do these observers interact with the system themselves or are the inputs chosen by others? If the former, how long do they interact with the system? If the latter, who chose the inputs and how many were there? And so on. These are important questions of methodology, but let’s brush them aside for now, assuming we somehow have reasonable enough answers to them. How might we answer question (I) then?</p><p>Personally, until ChatGPT, I would unwaveringly answer it in the negative. I thought it was plain silly to think that these artifacts will ever approach anything resembling general intelligence. I worked with them professionally and I would see them in the trenches, making all kinds of blunders, blunders so frequent and so flagrant that any objective rational observer would have to dismiss claims of potential general intelligence as a joke. Of course, in industry we work with smaller models (the economics of LLMs is a fascinating subject but will have to wait for another article), but even GPT-3, weighing in at 175B parameters, would easily go terribly astray.</p><p>To be an objective rational observer, by the way, one must steer clear of emotional biases. Some of my colleagues would see the same failings but would disregard them, simply because they <em>wanted</em> to think that deep learning is putting us on the verge of strong AI. A lot of people in tech grew up watching Star Trek, Star Wars, 2001: A Space Odyssey, Blade Runner, The Matrix, and so on, and reading science fiction; they are positively <em>giddy</em> at the prospect of a real-life HAL-9000. I’m not a Trekkie myself, but I suspect Dr. Spock would caution them that their strong feelings on the subject are clouding their judgment.</p><p>That said, I believe that ChatGPT is a game changer. While I’m still on the side of the skeptics, and while ChatGPT is still not an existence proof for a positive answer to (I), I now have to concede that it’s at least <em>plausible</em> that something like generally intelligent behavior may well emerge from a system based on LLMs. (Again, I speak of intelligent “behavior’’ instead of “intelligence’’ tout court to avoid questions that would take us too far afield.) I’ve come to this conclusion simply because I’ve tried out ChatGPT on a number of topics and, modulo some important exceptions and caveats that I’ll discuss shortly, it has struck me as already coming close to exhibiting generally intelligent behavior. As an objective rational agent, I have little choice but to update my priors in light of such new evidence. Moreover, when one considers the rate of progress in the field, it is no longer far-fetched to imagine that in a few decades, or possibly even sooner, something like ChatGPT will constitute a positive answer to (I).</p><h3>Is ChatGPT a stochastic parrot?</h3><p>In the wake of the controversial 2021 paper <a href="https://dl.acm.org/doi/pdf/10.1145/3442188.3445922">On the Dangers of Stochastic Parrots: Can Language Models Be Too Big?</a>, it has become commonplace among critics of LLMs to refer to these systems as “stochastic parrots.” That characterization strikes me as a bit sloganish and glib, but it’s evocative. It’s intended to convey the rather dismissive position that a system like ChatGPT can only “cut and paste” material that it’s already seen during its training, just like a parrot can only repeat what it’s heard before, and that it has no real understanding of what it’s saying (again, just like a parrot has no idea what is signified by the sounds coming out of its syrinx).</p><p>I believe these are two very different claims that need to be teased apart, because they require very different types of arguments. I agree that systems like ChatGPT have no real understanding of the content they generate, although, again, that is a complicated question that is primarily philosophical and is not going to be settled by empirical evidence any time soon, certainly not by observing outputs generated by LLMs.</p><p>But the first charge, that LLMs are only doing cutting and pasting, is a different matter, as that <em>is</em> something we can assess now via a careful and fair-minded observation of a system’s behavior. And while that charge may have held some water against previous systems, including GPT-3, at this point it strikes me as both wrong and unfair. ChatGPT is much more than a stochastic parrot. It can generate novel propositional content and respond to arbitrary questions and scenarios coherently and informatively, and do so in ways that are often strikingly creative. It should be clear to any unbiased observer that it’s not simply serving up linguistic pastiches by stitching together things that people have said before, using mere statistical relationships (unless of course one <em>defines</em> said “stitching” in a very unorthodox way). It should also be clear that deep learning — in the technical sense of multiple layers of nonlinear transformations — is indeed causing the system to build increasingly higher-level representations in multiple interesting semantic dimensions.</p><p>The web is already full of fascinating examples of ChatGPT in action, so there’s no need to give many new ones, but here are just a few that I tried and found particularly impressive.</p><p>Early in the morning last Saturday (January 7), only a few hours after Kevin McCarthy was finally elected Speaker of the House, the Financial Times published a front-page report on the development. I took the first sentence of the article, fed it to ChatGPT and asked it what can be concluded about McCarthy from that sentence:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*gKekYU88nArLK7DhXXe2Cg.png" /></figure><p>All answers were clever, informative, and well-presented, but I was particularly impressed by the answer to the party-affiliation question. The system said we can infer from the text that he’s a Republican because the text states that he received the support of most Republicans in the Congress, and then it immediately brought up the possibility that McCarthy might have changed party affiliations at some point in his career.</p><p>Let’s move on to a completely different topic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*G1NflzartZsUG8ETMnye7Q.png" /></figure><p>This output is not perfect, but it’s rather impressive in that surely there’s nothing in ChatGPT’s training data that is specifically about Monday, July 16, 2029. The system entertained the hypothetical situation I posed to it (<em>assuming</em> that today is Monday July 16, 2029) and worked out that, on that supposition, the rather complicated temporal expression I gave it inside quotes must refer to the first Monday of August 2029, and it must pick out a time period within that day whose exact boundaries depend on how one defines “late afternoon.” The system did not just haphazardly stitch together various relevant phrases from its corpus. It answered the question correctly and even pointed out the ambiguity in the phrase “late afternoon.” The only imperfection here is that the system claims that <em>the specific date</em>,<em> </em>as well as the time, depends on the definition of “late afternoon,” which is of course false. How one chooses to understand late afternoons will have zero bearing on <em>the date</em> denoted by the given phrase. (And indeed, if we press that point then ChatGPT starts treading on increasingly thin ice.)</p><p>The system even seems to have a rudimentary “theory of mind” (a <a href="https://en.wikipedia.org/wiki/Theory_of_mind">technical term</a> in cognitive science and psychology), insofar as it seems able to correctly predict the beliefs that someone is likely to have about other people’s mental states. Here is a version of a false-belief task (also known as a <a href="https://en.wikipedia.org/wiki/Sally%E2%80%93Anne_test">Sally-Anne task</a>) that ChatGPT passes in flying colors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*huGBdGHTWMvkyOXJNRvXPQ.png" /></figure><p>Taking another sharp turn, let’s see how ChatGPT does with a bit of Nashville heartbreak:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*jXn6aJROIDAjeJImedFndA.png" /></figure><p>Well done. However, a somewhat different formulation just a day later resulted in a pretty different — and markedly worse — response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*meCRqr8f0Ht23BvDfkPYKQ.png" /></figure><p>ChatGPT has failed to realize that the singer is being ironic. There is no “perceived status” as a “leader”, nor does the singer come across as having (or believing to have) any “position and power.” Here it seems that ChatGPT is struggling to compose an accurate and coherent interpretation of the lyrics. It gets bits and pieces right, as well as the general flavor, but clearly misses some aspects. It’s notable that it also makes some elementary grammatic errors (“the person have the position and power”, “it’s not fulfill the person”) and even a punctuation error (ending that sentence with a comma instead of a period).</p><p>But another formulation one day after that resulted in even more impressive output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXZ2x_0sLIv_Nqo6qnjEGQ.png" /></figure><p>It’s well known of course that most of the pain and misery in country songs is due to romantic disasters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ChXPco_gkTCXKSrckW4O8g.png" /></figure><p>ChatGPT even seems to get pragmatics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*7fk9JdCjYFbMmtfn1hv0_w.png" /></figure><p>This is remarkable, because there’s nothing in the syntax or truth-conditional semantics of the waiter’s utterance that indicates its actual meaning. The meaning is derived largely from pragmatic considerations emerging from the context of the utterance.</p><p>It even seems to understand our web searches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*jPfeqfMBdZ-N-gzeKPR_KQ.png" /></figure><p>It goes on to elaborate quite nicely on the meaning of “average distance”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*t9M5dC_20YcPdMd1dM2LDA.png" /></figure><h3>Not a parrot, but no owl either</h3><p>So there’s a lot to celebrate here, and clearly there are plenty or reasons to be optimistic about the future of LLMs. As the joke goes, however, an optimist sees the donut whole while a skeptic sees the donut hole:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IIzed3TlBb6oKusBx7ExpQ.png" /></figure><p>Reading that response I could almost hear a giant hissing sound — all the common sense rushing out of ChatGPT. Yes, this was a bait question (an “infelicitous speech act” as linguists might say), but that’s the sort of question to be expected in a Turing-test-like setting.</p><p>How about folk physics? If I ask ChatGPT advice on how I can get a cue ball to roll back after it hits another pool ball, it gives a good tutorial on how to apply backspin:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*dvbhPHPrcXEW7Oo68EEKLw.png" /></figure><p>Very well, but I was intrigued by the trailing qualification (“if you have access to one”):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*_srEI_RtTDGmFDFYwkItyg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*d_anZf3lEMtWfNrqXdPcjw.png" /></figure><p>It’s clear that ChatGPT is taking generic advice seen during its pretraining about how to position one’s body for a pool shot and regurgitating it in an inappropriate context (where the ball is positioned on the floor, and therefore standing up with one’s knees slightly bent would definitely not allow one “to take a shot comfortably and accurately”). It also seems to be making things up about cue balls with spinning devices in them (and then later claiming that the button or switch for controlling these devices may be located <em>inside</em> the cue ball, and that every time one wants to flip the switch or press the button in order to use the device, they need to unscrew the cue ball, flip the switch, and then screw the cue ball back together).</p><p>Indeed, much of the negative publicity that ChatGPT has received since it was released revolves around “hallucination” (although “confabulation” might be a more accurate — if harsher — term): It fabricates facts, making things up out of whole cloth. For example, while checking to see how well ChatGPT can navigate the naïve qualitative physics of playing pool, I brought up the idea of double arm amputees who have managed to become professionally competitive pool players. ChatGPT produced a reasonable response, basically saying that this is challenging but possible, as there are people who play pool with their feet (and some even with their mouths). But things went south when I asked for examples of such people:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*7hFyvAKweYD_2q-ZaNN_lQ.png" /></figure><p>In fact, Jeanette Lee <em>is </em>a professional pool player, but she enjoys full use of both of her arms. I’m not sure who Tom D’Alfonso is, but he appears to be a minor pool player, also seemingly blessed with two fully functional arms.</p><p>Nevertheless, I don’t think that’s a show stopper for systems like ChatGPT. The system will surely improve with time, and as it does, <em>empirical</em> confabulation will be significantly reduced. Marrying such a system with a a web search engine and/or a large knowledge graph should help (Microsoft is expected to do just that over the coming months with Bing and ChatGPT, and <a href="https://you.com/">you.com</a> has already released a first version of a system that combines a chatbot with a search engine), though I’m sure there are many other improvements forthcoming. But also, I don’t see factual errors of this sort as terribly egregious. Such errors can of course be very <em>serious</em>, and may even involve legal questions of liability, but conceptually the underlying propositions here are contingent, not necessary. There is nothing <em>inconceivable</em> about the proposition that someone is a double amputee. Someone may be (thankfully) sound of limb, but things could have been otherwise in some other possible world. It’s an empirical question. I’m much more interested in propositions that are <em>necessarily true</em> but which ChatGPT nevertheless denies, or conversely, propositions that are necessarily false but which ChatGPT nevertheless affirms. Such propositions represent a much more pressing challenge. To see examples of these, we need to turn to mathematics and logic, and to examine ChatGPT’s ability to <em>reason properly</em> — to draw sound inferences, the conclusions of which could not possibly fail to hold if the premises that underwrite them are true. Such ability will be indispensable for any general-purpose intelligent assistant, particularly in science and engineering (this includes coding), where normatively correct reasoning is of paramount importance.</p><p>Let’s start with elementary reasoning and see how ChatGPT fares on simple syllogisms, albeit with a bit of a twist that would not faze a human at all:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*XsJNVfCiWjDQ0q0BMix2CA.png" /></figure><p>ChatGPT starts off on the right foot by correctly recognizing that Alberto is Italian. Unfortunately, it does so at least partially for the wrong reasons. And once we start probing deeper and subjecting ChatGPT to a bit of an interrogation, it quickly starts digging itself into a hole, until it becomes obvious that it has no concept of logical soundness:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*sZkKgN6634fnYKiR6EMyVA.png" /></figure><p>So while ChatGPT can describe modus ponens (perhaps the most fundamental inference rule underlying deductive reasoning), it’s evidently not able to apply it properly.</p><p>In my experience this is a recurring issue with ChatGPT. Even if its initial response to a question that requires reasoning happens to be correct, once we start engaging it in dialog and asking it to explain or justify its reasoning, it quickly paints itself into a corner and ends up making claims that are either nonsensical or blatantly incorrect. Here is another example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ha6hAG3D86p0hjonwVX2CA.png" /></figure><p>Once again, ChatGPT starts out well but quickly ends up generating nonsense, like the claim that <em>there must exist at least one number that is not prime, and this number could be prime itself, but it must be different from all of the prime numbers, since it is not true that every number is prime</em>.</p><p>Let’s now see how ChatGPT fares on a version of the famous <a href="https://en.wikipedia.org/wiki/Wason_selection_task">Wason selection task</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GlW9PphFwqhSb_TxxE61vQ.png" /></figure><p>ChatGPT does not grasp the semantics of the material conditional and flunks the test. The cards that need to be turned over in order to determine the truth value of the proposition are the ones showing 17 and red. (The proposition will fail if and only if (a) the 17 card has a non-yellow color on the other side; <em>or</em> (b) the red card has a prime number on the other side. The other two cards cannot possibly lead to a negative verdict.)</p><p>Then again, in all fairness, most humans fail Wason selection tasks as well. A charitable interpretation of such failures, both for ChatGPT and for humans, is to argue that most subjects are not interpreting the “if” in its logico-mathematical sense, as a material conditional.</p><p>However, most humans <em>do</em> pass such a reasoning test when the task is formulated against a social backdrop, particularly in the context of enforcing social rules and contracts. For instance, most people would likely pass the following formulation of the task, even though it is logically equivalent to the preceding one. Remarkably, ChatGPT does even worse with this formulation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UKw1fEOVmTn2Pp41f_JHEA.png" /></figure><p>This is an epic fail, and a stark illustration of the differences between human reasoning and LLMs.</p><p>Let’s move on to spatial reasoning and look at a simple seating puzzle:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*dtbQAz5OrQm_3Sd9Uk9QnQ.png" /></figure><p>It’s quite easy for a human to come up with a solution after a minute or so of experimentation. Since p2 needs to be farther from the middle, let’s start by seating p2 first, followed by p4 (in order to make p2 and p4 adjacent), followed by p3 in the middle (so it’s definitely closer to the middle than p2), followed by p5 and then p1, which ensures that p5 is flanked by p1 and p3: <br><strong>p2 - p4 - p3 - p5 - p1.</strong></p><p>Every single response given by ChatGPT here is wrong, from the very start (it’s easy to prove that p3 must be in the middle). It then recognizes its proposed solution and “fixes” it by making another wrong proposal:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*NefBztXz0EMSkk_pmsqzow.png" /></figure><p>After venturing a third wrong guess, ChatGPT gives up and makes the equally incorrect conjecture that the problem is unsolvable.</p><p>In fact, when it comes to spatial layout and ordering relations in general, ChatGPT is exceedingly inept. It has no notion of left, right, up or down, before or after, and cannot even count with ordinals:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*XDXwle5CM0gj31BfxYWFoA.png" /></figure><p>How about straightforward scheduling problems, based on a simple notion of “before”?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*sRg6Rv97mWWEGG1fqAmcXA.png" /></figure><p>Everything about this is wrong. There are 9 different orderings satisfying the constraints, and half of the solutions given by ChatGPT are incorrect (namely, orderings 4 through 6, as they violate the second constraint).</p><p>Let’s move on to some more properly mathematical examples. How much does ChatGPT know about numbers?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J07Igp5WvOYcEAU2ag4uUQ.png" /></figure><p>Well done — once again we’re off to a great start. But alas, here’s what comes immediately afterwards:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZ_ogyo1VF7ETN6YIhrMlw.png" /></figure><p>Here the situation seems somewhat reversed, in that the reasoning is largely sound but the conclusion is nevertheless incorrect, as if ChatGPT is not quite aware that “a is smaller than b” is logically inconsistent with “a &gt; b”.</p><p>Let’s try an even simpler question: <em>Consider a = 2743736341 and b = 2743735341. Which is greater, a or b, and why?</em> If we compare the decimal representations of a and b carefully, we see that they have the exact same number of digits and contain identical digits in all positions except for the fourth position from the right, which is easily seen by lining up the two decimal representations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*O7SuDebmC0vzVNQ80ZQ7Iw.png" /></figure><p>Thus, a is greater. This is a trivial question for a human being, but because the numbers are quite large, a system like ChatGPT cannot have seen them during training, so, to answer correctly, it must be able to reason about the relationship between magnitude and positional representations of numbers in a robust and general way. Clearly, it doesn’t:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ebu2XlpxXpvf8MRgZJgAFQ.png" /></figure><p>The conversation ends with ChatGPT justifying its conclusion on the grounds that “1 is greater than 1.”</p><p>For what it’s worth, other LLM-driven systems do not do any better. Here is how YouChat (by <a href="https://you.com/search?q=who+are+you&amp;tbm=youchat">you.com</a>) fares on the same question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*upS3cDI-H8MX2lpdlgPSBQ.png" /></figure><p>Let’s move on to another simple math question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRmc-_mX4IYKaBSyuNzM0w.png" /></figure><p>ChatGPT doesn’t seem to understand that squaring always yields positive numbers (and therefore we’ll never have to take the principal square root of a negative number). Incidentally, the issue is not that ChatGPT doesn’t have the concept of a principal square root:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*65pTE-woNDy39v8ksvdusQ.png" /></figure><p>Let’s turn our attention to the set of real numbers. That set, of course, is equinumerous with — has the same cardinality as — the irrational numbers, which means that, by definition, there exists a bijection from one set to the other. Coming up with such a bijection is not trivial, but let’s see what ChatGPT has to say about it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RWLQ2bv2fm47wTOJ3JYslg.png" /></figure><p>This is wrong — the function f that ChatGPT has proposed is not a bijection. (The function is also bizarrely defined for irrational numbers, but let’s put that aside.) The function maps every rational number to itself and every irrational number x to 2x, which is another irrational number. So it does not yield a bijection between irrationals and reals. Let’s ask ChatGPT a simple question about its own definition:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vpeGtcAUVAYgm2cdTyfogQ.png" /></figure><p>That’s a correct answer, but let’s now make a more fundamental (if pedantic) point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MebN1K9vElnXn0smRCtyug.png" /></figure><p>So this conversation ended up with ChatGPT making the stunningly incorrect claim that there’s no bijection between the irrationals and the reals. (This is stunning not just because the existence of such a bijection is a fundamental fact of mathematics, but also because, on a related note, this is surely the kind of content that ChatGPT must have seen plenty of times during its training; yet it is not able to recognize that it’s making a statement that is logically inconsistent with what it saw during training.)</p><p>I then checked to see if ChatGPT could realize that strong induction would be challenging to apply to an uncountable domain, particularly one without a natural ordering relation, such as the complex numbers (which do not form an ordered field), but that conversation ended up with the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TFar0juiMPS4PSJ8N2U1Ew.png" /></figure><p>Mathematically literate readers will have a hard time deciding where to begin to take issue with this series of claims. In addition to butchering the math, ChatGPT confabulates an empirical claim suggesting that the use of strong induction to prove statements about “all complex numbers” is a widely used technique.</p><h3>Conclusions</h3><p>Where does all that leave us? We’re still very far from general AI (and it’s still an open question whether digital computers will ever get us there), but ChatGPT is without question a turning point. It hasn’t quite cracked common sense, but it has made astonishing progress, to the point where the snarky epithet “stochastic parrot” is no longer warranted in my view. For what it’s worth, personally I now find it plausible — though still unlikely — that this line of work could ultimately deliver a system that provides an existence proof for an affirmative answer to question (I).</p><p>The Achilles heel of all such systems is reasoning — math in particular and logic in general. This is consistent with the general consensus that’s already emerged, and this article has given many examples of the range and severity of the problems on that front. The marriage of deep learning and reasoning is a very active and rapidly evolving line of research (new results and systems seem to be coming out every few weeks), but there are fundamental questions here about whether we’re trying to fit a square peg into a round hole. Reasoning is underwritten by <em>norms</em>, and in that sense it’s fundamentally different from perception or even language understanding and generation, which can perhaps piggyback on statistical relationships gleaned from enormous text corpora. At any rate, we live in interesting times and the next few years will surely see exciting results in this area.</p><p>In the meantime, I suspect that ChatGPT will be used primarily for creative/artistic/marketing tasks, not for tasks that involve rigorous prescriptive notions of correctness or require deep analysis, or even tasks that simply place a high premium on factual accuracy. In particular, with the possible exception of standard and boring boilerplate code, ChatGPT will most definitely not replace human software engineers, at least not anytime soon. LLMs can <em>help</em> such engineers be more productive, particularly in bootstrapping new applications, by acting as a sort of powerful autocomplete tool, but helping engineers is very different from replacing them. Even in the autocomplete capacity, care must be taken to ensure that the LLM suggestions are <em>correct</em>. It’s not going to be a best practice to blindly accept dozens of lines of code from a system that claims 1 &gt; 1.</p><p>In the creative/artistic realm, however, there are likely to be problems revolving around IP and copyright that will almost certainly put a damper on the use of ChatGPT-like systems. In addition, systems like ChatGPT are undergoing an ever-increasing degree of corporate sanitizing, whereby the text produced by these systems has to adhere to increasingly stringent standards of socially acceptability. This does not bode well for creativity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*wv3Y1Zab0CEED-lX1irrAA.png" /></figure><p>I think we can all agree that this pretty much rules out the use of ChatGPT in Hollywood. And don’t even think of asking ChatGPT for a joke involving a German, an Italian, and an Irishman. ChatGPT does not do ethnic stereotypes.</p><p>Similar constraints are likely to be imposed on political content and other sensitive topics (and these days just about everything seems sensitive). Ultimately, there may be so many programmatic shackles placed on ChatGPT that the only thing it can do is turn out bland, sterile copy filled with platitudes and reminders to eat your vegetables and wear your seat belt. As always, the disruptive applications that will push boundaries (for better and for worse) will most likely happen if and when LLMs become a technology of scale that escapes into the wild, outside of corporate control. Given the tremendous infrastructural cost of training and using LLMs at the scale of ChatGPT, this will not happen anytime soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3cd1fc303e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>