Inference Time Optimization with Confidence Dynamics
Abstract
Inference time optimization techniques, such as repeated sampling, have significantly advanced the reasoning capabilities of Large Language Models (LLMs). However, the critical role of model uncertainty remains largely underexplored in these optimization strategies. In this paper, we investigate the dynamics of confidence along reasoning trajectories and for first time reveal a surprising and unique pattern: correct answer traces tend to exhibit confidence improvement over time (positive confidence gain), while incorrect traces show attenuated or declining confidence as reasoning proceeds. Based on this observation, we propose Confidence Dynamic Gain (CDG) based voting, which incorporates how the confidence trajectory of the response evolves along the reasoning chain. Experiments across four open-source architectures (DeepSeek-R1, gpt-oss, Gemma-3, Qwen-QwQ) on the AIME24/25, HMMT25, and BRUMO25 benchmarks demonstrate that CDG yields a significant performance boost over baselines. These results demonstrate that our method provides a robust discriminative signal for improving answer selection in LLM reasoning. We also provide theoretical insights for this phenomenon. Code will be released at https://github.com/Accenture/CDG.git.
Lay Summary
AI language models often need many attempts to solve a hard problem — and picking the right one from the bunch is its own challenge. In our ICML paper, we look at how a model's confidence shifts as it works through a problem and find a pattern that mirrors human reasoning. When the model is on the right track, its confidence rises steadily as the answer comes into focus. When it is heading toward a wrong answer, the opposite happens: like a person spinning a story they don't believe, each fabrication forces another, and confidence flattens or fades by the end. We turn this into a simple rule, Confidence Dynamic Gain (CDG): among many attempts, prefer the ones whose confidence rises most from start to finish. CDG requires no retraining and works with any AI model that reports how sure it is at each step. On four competition-level math benchmarks and four open-source AI models, CDG consistently picks better answers than today's state-of-the-art methods, and we explain why this pattern emerges from how modern reasoning models are trained.