mlsanityData to 7 Oct 2026

What Makes In-context Learning Effective for Mathematical Reasoning: A Theoretical Analysis

arXiv 2412.12157 ↗First posted 11 Dec 2024cs.CL cs.AIcited by 7

On the map: LLM reasoning → Reasoning benchmarks and evaluation

Abstract (arXiv)

Owing to the capability of in-context learning, large language models (LLMs) have shown impressive performance across diverse mathematical reasoning benchmarks. However, we find that few-shot demonstrations can sometimes bring negative performance and their effectiveness on LLMs' reasoning abilities remains unreliable. To this end, in this paper, we aim to theoretically analyze the impact of in-context demonstrations on LLMs' reasoning performance. We prove that the reasoning efficacy (measured by empirical prediction loss) can be bounded by a LLM-oriented semantic similarity and an inference stability of demonstrations, which is general for both one-shot and few-shot scenarios. Based on this finding, we propose a straightforward, generalizable, and low-complexity demonstration selection method named LMS3. It can adaptively facilitate to select the most pertinent samples for different LLMs and includes a novel demonstration rejection mechanism to automatically filter out samples that are unsuitable for few-shot learning. Through experiments on three representative benchmarks, two LLM backbones, and multiple few-shot settings, we verify that our LMS3 has superiority and achieves consistent improvements on all datasets, which existing methods have been unable to accomplish.

Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Placed in Reasoning benchmarks and evaluation, one of 17 directions in LLM reasoning. Builds on 14 of its 51 references that are in the map. First posted on arXiv 11 Dec 2024.

Builds on

14 of 51 references.

References · 14

  1. 2023GPT-4 Technical Reportcited by 18,132
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  4. 2024M3-Embedding: Multi-Linguality, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillationcited by 1,050
  5. 2022A Survey on In-context Learningcited by 717
  6. 2023WizardMath: Empowering Mathematical Reasoning for Large Language Models via Reinforced Evol-Instructcited by 618
  7. 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 358
  8. 2023In-Context Learning with Iterative Demonstration Selectioncited by 74
  9. 2023Dr.ICL: Demonstration-Retrieved In-context Learningcited by 71
  10. 2023A Multi-Task Embedder For Retrieval Augmented LLMscited by 63
  11. 2023In-context Example Selection with Influencescited by 60
  12. 2024Revisiting Demonstration Selection Strategies in In-Context Learningcited by 57
2 more
  1. 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 23
  2. 2024In-Context Learning Demonstration Selection via Influence Analysiscited by 11

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 5; 2026: 2.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Benchmarking Large Language Models for Math Reasoning Tasks
  2. 2026Process In-Context Learning: Enhancing Mathematical Reasoning via Dynamic Demonstration Insertion
  3. 2022Can In-context Learners Learn a Reasoning Concept from Demonstrations?
  4. 2024Multi-Step Reasoning with Large Language Models, a Survey
  5. 2025Exploring LLM Reasoning Through Controlled Prompt Variations
  6. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  7. 2026Many-Shot CoT-ICL: Making In-Context Learning Truly Learn
  8. 2025Iterative In-Context Learning to Enhance LLMs Abstract Reasoning: The Case-Study of Algebraic Tasks