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

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Gao, Ang, Zhang, Changshuo, Zhang, Xiao, Li, Deyang, Zhao, Minjun, Liu, Fangchao, Zhang, Xinyu
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908773021384704
author Gao, Ang
Zhang, Changshuo
Zhang, Xiao
Li, Deyang
Zhao, Minjun
Liu, Fangchao
Zhang, Xinyu
author_facet Gao, Ang
Zhang, Changshuo
Zhang, Xiao
Li, Deyang
Zhao, Minjun
Liu, Fangchao
Zhang, Xinyu
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2601_11979
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Process In-Context Learning: Enhancing Mathematical Reasoning via Dynamic Demonstration Insertion
Gao, Ang
Zhang, Changshuo
Zhang, Xiao
Li, Deyang
Zhao, Minjun
Liu, Fangchao
Zhang, Xinyu
Artificial Intelligence
Machine Learning
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.
title Process In-Context Learning: Enhancing Mathematical Reasoning via Dynamic Demonstration Insertion
topic Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2601.11979