Process In-Context Learning: Enhancing Mathematical Reasoning via Dynamic Demonstration Insertion

Ang Gao, Changshuo Zhang, Xiao Zhang, Deyang Li, Minjun Zhao +2 more
1/17/2026
cs.AIcs.LG

No confident code implementation found for this paper.

Abstract

In-context learning (ICL) has proven highly effective across diverse large language model (LLM) tasks. However, its potential for enhancing tasks that demand step-by-step logical deduction, such as mathematical reasoning, remains underexplored. A core limitation of existing ICL approaches is their static use of demonstrations: examples are pre-selected before inference and remain fixed, failing to adapt to the dynamic confusion points that often arise during multi-step reasoning such as ambiguous calculations or logical gaps. These unresolved confusion points can lead to cascading errors that degrade final accuracy. To tackle this issue, we propose Process In-Context Learning (PICL), a dynamic demonstration integration framework designed to boost mathematical reasoning by responding to real-time inference needs. PICL operates in two stages: 1)~it identifies potential confusion points by analyzing semantics and entropy in the reasoning process and summarizes their core characteristics; 2)~upon encountering these points, it retrieves relevant demonstrations from the demonstration pool that match the confusion context and inserts them directly into the ongoing reasoning process to guide subsequent steps. Experiments show that PICL outperforms baseline methods by mitigating mid-inference confusion, highlighting the value of adaptive demonstration insertion in complex mathematical reasoning.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gao2026process,
  title  = {Process In-Context Learning: Enhancing Mathematical Reasoning via Dynamic Demonstration Insertion},
  author = {Ang Gao and Changshuo Zhang and Xiao Zhang and Deyang Li and Minjun Zhao and Fangchao Liu and Xinyu Zhang},
  year   = {2026},
  eprint = {2601.11979},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.11979v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.11979.svg)](https://codeofpaper.com/paper/2601.11979)

Discussion