HackerPapers

arXiv:2211.09066cs.LG

Teaching Algorithmic Reasoning via In-context Learning

Hattie Zhou, Azade Nova, Hugo Larochelle, Aaron Courville, Behnam Neyshabur, Hanie Sedghi

Abstract

Large language models (LLMs) have shown increasing in-context learning capabilities through scaling up model and data size. Despite this progress, LLMs are still unable to solve algorithmic reasoning problems. While providing a rationale with the final answer has led to further improvements in multi-step reasoning problems, Anil et al. 2022 showed that even simple algorithmic reasoning tasks such as parity are far from solved. In this work, we identify and study four key stages for successfully teaching algorithmic reasoning to LLMs: (1) formulating algorithms as skills, (2) teaching multiple skills simultaneously (skill accumulation), (3) teaching how to combine skills (skill composition) and (4) teaching how to use skills as tools. We show that it is possible to teach algorithmic reasoning to LLMs via in-context learning, which we refer to as algorithmic prompting. We evaluate our approach on a variety of arithmetic and quantitative reasoning tasks, and demonstrate significant boosts in performance over existing prompting techniques. In particular, for long parity, addition, multiplication and subtraction, we achieve an error reduction of approximately 10x, 9x, 5x and 2x respectively compared to the best available baselines.

arXiv comments
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.AIArtificial Intelligence cs.CLComputation and Language

On Hacker News

Linked by 6 identifiable commenters in 25 comments across 22 threads, from Dec 2022 to Dec 2023. Found in 1 HN submission from Dec 2022 to Dec 2022. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments22 threads

  1. Weak-to-Strong Generalization 1 comment
    • >Every human is not even capable of reading, or speaking, or thinking at all. But those humans who can't are not the benchmark of general human intelligence. It's simple. If you're going to disqualify a potential general intelligence because of a particular task solving ability…

      famouswafflesView on HNParent context

    • > Numbers (LLMs still can't do math and the ones that "can" are very brute forced and don't generalize) These seem to generalize. https://arxiv.org/abs/2211.09066 https://arxiv.org/abs/2308.00304 > Commutative properties (The (idk why anyone was surprised) "reversal curse"…

      famouswafflesView on HNParent context

    • LLMs are a different beast in the ML world. Finetuned Palm for Medicine and Finetuned Minerva for Math all perform a good deal worse than GPT-4. A fine-tuned smaller model is by no means guaranteed to beat a larger more general one (though of course you may get acceptable…

      famouswafflesView on HNParent context

    • >No, but I believe this is a different question. arithmetic but in a different base is one of the counterfactual examples in the paper. That's why i mentioned that. and yes it can answer them with worse performance. You can juice arithmetic performance as is with algorithmic…

      famouswafflesView on HNParent context

  2. Introducing Superalignment 1 comment
    • It's alright with algorithmic prompts - https://arxiv.org/abs/2211.09066 also it knows when to use a calculator if it has access to one so it's not a big deal

      famouswafflesView on HNParent context

  3. Why are LLMs general learners? 1 comment
    • Post moving. "Reasonable" is just an arbitrary line. Especially since most if not all would make some mistake somewhere along the line. You can greatly increase GPT's arithmetic capabilities tackling it like a problem to solve "on paper" in context. And this was done on 3.5 not…

      famouswafflesView on HNParent context

    • They are GNNs with attention as the message passing function and additional concatenated positional embeddings. As for reasoning, these are not quite 'problems well-trained for', in the sense that they're not in the training data. But they are likely problems that have some…

      chaxorView on HNParent context

  4. Governance of Superintelligence 2 comments
    • >It's not better at reasoning. It's barely even capable of it You are wrong. and there's many papers to show otherwise. Algorithmic, Casual, Inference, Analogical LLMs reason just fine https://arxiv.org/abs/2212.09196 https://arxiv.org/abs/2305.00050…

      famouswafflesView on HNParent context

    • I don't think you took more than a passing glance, if any at those papers. What you describe is impossible with these 3. https://arxiv.org/abs/2212.09196 - new evaluation set introduced with the paper. modelled after tests that previously only had visual equivalents.…

      famouswafflesView on HNParent context

  5. Rodney Brooks on GPT-4 1 comment
    • No world model ? A world model is so obvious papers like these are more confirmation than surprise https://arxiv.org/abs/2305.11169 https://arxiv.org/abs/2210.13382 There a certain sentiment that AGI however you wish to define it won't infact be a "We'll know it when we see it"…

      famouswafflesView on HNParent context

    • LLMs are not very bad at reasoning. People say this but struggle to demonstrate how. There are many types of reasoning. For some like abstract analogical reasoning, LLMs are top % performers. https://arxiv.org/abs/2212.09196 There's many papers at this point demonstrating pretty…

      famouswafflesView on HNParent context

    • > But it fails at simple arithmetic. Does it though? When allowing LLMs to use their outputs as a form of state they can very much succeed up to 14 digits with > 99.9% accuracy, and it goes up to 18 without deteriorating significantly [1]. That really isn't a good argument…

      PartiallyTypedView on HNParent context

  6. The New XOR Problem 1 comment
    • Yeah the issue tends to be as the length increases the performance drops off. Your approach reminds me of Hattie's work: https://arxiv.org/pdf/2211.09066.pdf I do wonder if the observable drop-off in performance on these formal languages / arithmetic tasks is something more…

      shawntanView on HNParent context

    • Not too shocking for me after this paper. https://arxiv.org/abs/2211.09066 You can teach GPT-3 arithmetic - https://imgur.com/a/w3DAYOi Basically 100% accuracy up to about 13 digit addition and >90 after that. What else can you teach GPT without changing weights ?

      famouswafflesView on HNParent context

    • We are already there. 100% accuracy on up to 13 digit addition can be taught to 3.5 as is. https://arxiv.org/abs/2211.09066 And 4 has little need for such out the box

      famouswafflesView on HNParent context

    • In context learning is hands down the biggest breakthrough of LLMs. The flexibility the model displays without updating weights is genuinely mind blowing, bordering on absurd especially if you've trained other kinds of models before. See here - https://imgur.com/a/w3DAYOi from…

      famouswafflesView on HNParent context

    • The idea that updating weights is particularly necessary is questionable. Memory augmented llms are computationally universal. https://arxiv.org/abs/2301.04589 and make no mistake, in context learning can be used in a meaningful way to resolve deficiencies. gpt-3 getting 98.5%…

      famouswafflesView on HNParent context

    • I didn't say it's not there. or that you couldn't communicate the ideas of math/arithmetic with language. You can get GPT-3 (yes 3) to have 98.5% accuracy on addition arithmetic (even very large numbers) by..simply describing the algorithm of addition to performed on 2 numbers.…

      famouswafflesView on HNParent context

    • Oh boy, if you want to fling papers/research, i can do that just fine. https://arxiv.org/abs/2212.09196v1 https://arxiv.org/abs/2211.09066 https://thegradient.pub/othello/ Moreover, "have trouble reasoning" and "can't reason at all" are two very different statements. Not that i…

      famouswafflesView on HNParent context

  7. And yet It Understands 2 comments
    • You can increase the accuracy of arithmetic by simply describing arithmetic (addition, subtraction etc) as an algorithm to be performed on the numbers. 98.5% accuracy on addition arithmetic this way with GPT-3 https://arxiv.org/abs/2211.09066

      famouswafflesView on HNParent context

    • The point I'm making is that chatGPT doesn't know that because the model it has of arithmetic is faulty. It's really as simple as that. The primes thing was just an illustrative example. You want it to do large scale arithmetic with high accuracy? Describe arithmetic as an…

      famouswafflesView on HNParent context

    • GPT-3 is horrible at arithmetic. Yet if you define the algorithmic steps to perform addition on 2 numbers, accuracy on addition arithmetic shoots up to 98% even on very large numbers. https://arxiv.org/abs/2211.09066 Think about what that means. "Mutating the system" is not a…

      famouswafflesView on HNParent context

    • > Yet if you define the algorithmic steps to perform addition on 2 numbers, accuracy on addition arithmetic shoots up to 98% even on very large numbers. https://arxiv.org/abs/2211.09066 Think about what that means. That means that even with the giant model, you need to stuff…

      dragonwriterView on HNParent context

  8. Bing AI can play chess 1 comment
    • If you simply describe addition as an algorithm and ask language models to perform said algorithm on 2 numbers, addition arithmetic accuracy even on very large numbers shoots up to 98.5% https://arxiv.org/abs/2211.09066 LLMs don't struggle with arithmetic because "they can't…

      famouswafflesView on HNParent context

  9. What ChatGPT can't do 1 comment
    • > “LLMs can’t even do addition” > We show that they CAN add! To teach algos to LLMs, the trick is to describe the algo in enough detail so that there is no room for misinterpretation Algorithmic prompting paper https://arxiv.org/pdf/2211.09066.pdf

      visargaView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.