Skip to content
←Back to Papers

PAPER DEEP DIVE

Large Language ModelsReinforcement LearningChain of Thought

Post-Training Large Language Models via Reinforcement Learning from Self-Feedback

Large Language Models (LLMs) often produce plausible but poorly-calibrated answers, limiting their reliability on reasoning-intensive tasks. Recent research suggests that Chain-of-Thought (CoT) reasoning paths are inherent in pre-trained LLMs and can be elicited by simply altering the decoding process, where the presence of a CoT path correlates with higher answer confidence. Building on these insights, we present Reinforcement Learning from Self-Feedback (RLSF), a post-training stage that utilises the model's intrinsic confidence as a self-generated reward. By generating multiple CoT decoding beams from a frozen LLM, we compute the confidence of each final answer span and rank the resulting traces accordingly to create synthetic preferences. These preferences are subsequently utilised to fine-tune the policy through standard preference optimisation, requiring no human labels, gold answers, or externally curated rewards. RLSF simultaneously (i) refines the model's probability estimates–restoring well-behaved calibration–and (ii) strengthens step-by-step reasoning, yielding improved performance on arithmetic reasoning and multiple-choice question answering. By converting a model's own uncertainty into structured self-feedback, RLSF affirms reinforcement learning on intrinsic model behaviour as a principled and data-efficient component of the LLM post-training pipeline. Our results demonstrate that leveraging these inherent reasoning capabilities provides a robust path for enhancing model reliability without manual prompt engineering or external supervision.

Authors: Carel van Niekerk, Renato Vukovic, Benjamin Ruppik, Hsien-chin Lin, Shutong Feng, and Milica Gašić. Paper: https://arxiv.org/abs/2507.21931. Official implementation: https://github.com/carelvniekerk/ConfidentLLM, released under Apache 2.0. This analysis follows the second arXiv version revised on 15 September 2026.

Executive summary

The paper turns a model's own answer-token confidence into training preferences. A frozen language model generates several chain-of-thought traces, the final answer span of each trace is scored by the gap between the top and second-best token probabilities, and the resulting ranking is used for PPO or DPO post-training. The method reduces the need for human preference labels and removes multi-path search from deployment. Its strongest evidence concerns calibration and inference cost, not uniform gains in exact accuracy.

Why calibration needs its own training objective

A language model can write a polished arithmetic solution and still return the wrong number. Accuracy records whether the final answer is correct; calibration asks whether the probability attached to that answer means what it appears to mean. A model claiming ninety percent confidence should be correct in roughly ninety percent of comparable cases. Human-feedback alignment may make the wording more agreeable while leaving this probability poorly matched to correctness.

The paper argues that ordinary alignment optimizes what people prefer to read. It does not necessarily teach the model how uncertainty should behave when a reasoning chain becomes unreliable. This creates a practical deployment problem: downstream systems can observe a confident sequence of tokens, but they cannot infer whether the model has solved the problem or merely found a familiar-looking wrong answer.

Chain-of-thought decoding offers one partial answer. Instead of producing a single response, the model branches over several first tokens and continues each candidate greedily. Earlier work observed that traces containing coherent intermediate steps tend to put more probability on their final answers. That correlation suggests that internal confidence can act as a signal of reasoning quality, not only as a stylistic feature.

Inference-time search, however, is expensive. A ten-way search can require approximately ten generations for one question. The authors therefore ask whether those useful confident traces can be absorbed into the model during training. If so, deployment could return to a single greedy pass while retaining part of the benefit previously obtained through repeated decoding.

Language generation as a decision process

The method treats a causal language model as a policy. The initial state is the question, an action is the next token, and the state grows as generated text is appended. If the current state is $s_t$ and the chosen token is $a_t$, the transition is written as:

$$s_{t+1}=s_t\odot a_t$$

Here $\odot$ denotes sequence concatenation in the paper's notation. The formulation matches ordinary autoregressive generation and makes standard reinforcement-learning objects such as trajectories, rewards, values, and advantages applicable to text.

The paper distinguishes chain-of-thought thinking from chain-of-thought decoding. Prompting asks the model to explain its steps in one response. Decoding changes the search process: it keeps multiple first-token candidates and continues each one separately. The distinction matters because RLSF does not require a handcrafted instruction to reason step by step. It uses the model's existing decoding alternatives to expose multiple possible reasoning paths.

Confidence is calculated at answer-span level. For every token in the final answer, the implementation subtracts the probability of the second-most-likely vocabulary item from the probability of the generated item. These differences are averaged. A generated token at 0.90 with a runner-up at 0.05 is treated as much more decisive than one at 0.40 with a runner-up at 0.35.

How RLSF constructs its own supervision

Generate diverse starts, then continue deterministically

For a prompt $q$, the frozen model keeps the $K$ most probable first tokens. Each token seeds a separate response:

$$w^k\in\operatorname{TopK}_{w}\pi_{\theta}(w\mid q),\qquad k=1,\ldots,K$$

Each path is then completed with greedy decoding. The experiments use $K=10$, citing prior evidence that performance tends to plateau at this number. No policy gradient is applied during this generation step. The frozen model is being used as a sampler of its own latent reasoning tendencies.

RLSF pipeline overview

Figure 1: The RLSF pipeline from the paper. Multiple reasoning traces are generated, ranked by final-answer confidence, and converted into preference data.

This generation design is neither fully deterministic nor fully random. The first-token branch introduces variety, while greedy continuation reduces variance after that branch point. It is an efficient way to collect plausible responses, but the candidate set is still constrained by the frozen model and by the top ten first tokens. The procedure cannot discover a useful reasoning route whose opening token lies outside that set.

Identify the answer span before scoring it

A trace may end with a sentence, a number, or a mixture of explanation and answer. To isolate the relevant tokens, the authors append the phrase "So the answer is" and ask the model to generate a short answer. A string-matching step then locates this generated answer inside the original response.

The implementation removes special and stop tokens, searches for the largest overlap between the generated answer and the response, and assigns confidence zero when no overlap exists. This defensive choice avoids treating an extraction failure as strong evidence. It also makes answer extraction an explicit source of engineering risk: a valid reasoning trace with an unusual answer format can be discarded before the training signal is formed.

Measure confidence disparity over the answer tokens

For an answer span of length $M$ beginning at position $m$, the score is:

$$ c=\frac{1}{M}\sum_{i=0}^{M-1}\left[ \max_w\pi_\theta(w\mid s_{m+i}) - \max_{w\neq\arg\max\pi_\theta}\pi_\theta(w\mid s_{m+i}) \right] $$

$s_{m+i}$ contains the prompt and the prefix generated before the token being scored. The first term is the probability of the most likely token, while the second is the probability of the next-best alternative. Unlike raw maximum probability, this difference captures how isolated the leading token is from its strongest competitor.

The code mirrors the equation. ProbabilityDisparity in confidentllm/confidence_metrics/probability.py:58-81 extracts the probability assigned to the generated token, obtains the second-largest probability with torch.topk, and subtracts the latter.

next_token_probs = super().__call__(next_token_ids, scores)
second_highest_probs = torch.topk(scores, k=2, dim=-1)
disparity = next_token_probs - second_highest_probs.values[:, :, 1]

The expression is simple, but its meaning is important. RLSF is not training against a calibrated probability of correctness. It is using the model's local token ranking as a proxy for the coherence of the path that produced the answer. The paper's empirical claim is that this proxy is useful enough to create preferences; it is not a theorem that the proxy is always correct.

Turn confidence rankings into preferred and rejected pairs

Once ten candidates have scores, higher-confidence responses become preferred and lower-confidence responses become rejected. The dataset builder creates pairs from each question. It also stores an exponential confidence margin. The relevant logic appears in confidentllm/data/datasets/cot_preference_data.py:163-204.

if response_1["confidence"] <= response_2["confidence"]:
    continue
ranked_data["preferred_response"].append(preferred_response)
ranked_data["rejected_response"].append(rejected_response)
ranked_data["margin"].append(exp(confidence_1 - confidence_2))

No gold answer enters this ranking step. That is the source of the method's scalability and also its central weakness. If the base model consistently gives its highest confidence to a mistaken pattern, RLSF will construct a clean preference dataset around that mistake. The procedure optimizes internal agreement, not correspondence with an external world.

PPO route: learn a Bradley-Terry reward model

RLSF with PPO first trains a scalar reward model on the synthetic pairs. When a generated response reaches its final token, the reward model supplies the terminal reward:

$$r_T=R_\phi(s_{T-1}\odot a_{T-1})$$

The reward model is trained under the Bradley-Terry assumption. For prompt $q$, preferred trace $h^1$, and rejected trace $h^2$, its loss is:

$$ \mathcal{L}(h^1,h^2;\phi)= -\mathbb{E}\log\sigma\left( R_\phi(q\odot h^1)-R_\phi(q\odot h^2) \right) $$

$\sigma$ is the logistic sigmoid and $\phi$ represents reward-model parameters. The loss raises the margin between the preferred and rejected complete sequences. Only the final state is scored, which matches the idea that confidence is attached to the complete answer.

The policy objective is the expected discounted return:

$$ J(\theta)=\mathbb{E}_{\pi_\theta}\sum_{t=1}^{T}\gamma^t r_t $$

Its policy gradient uses advantage values:

$$ \nabla_\theta J(\theta)= \mathbb{E}_{\pi_\theta}\sum_{t=0}^{T-1} \nabla_\theta\log\pi_\theta(a_t\mid s_t) A_{\pi_\theta}(s_t,a_t) $$

The advantage estimates whether a token action produced a better outcome than expected from that state. The paper uses generalized advantage estimation:

$$ \hat A_t=\sum_{l=0}^{T-t-1}(\gamma\lambda)^l\delta_{t+l}, \qquad \delta_t=r_t+\gamma V_\pi(s_{t+1})-V_\pi(s_t) $$

PPO then clips the policy ratio around one and adds a KL penalty to limit movement from the reference policy. The implementation loads a policy, a frozen reference, a reward model, and a value model. They must share a tokenizer, and the reward and reference components are set to evaluation mode with gradients disabled. These details appear in confidentllm/scripts/run_reinforcement_learning.py:72-103.

This architecture shows why removing human labels does not make RLSF lightweight. It removes annotation, but the PPO route still carries the memory cost of several language models and the instability of online policy optimization.

DPO route: optimize preferences without a separate reward model

The same preference pairs can update the policy directly with DPO:

$$ \mathcal{L}(h^1,h^2;\theta)= -\mathbb{E}\left[ \log\sigma\left( \beta\log\frac{\pi_\theta(h^1\mid q)}{\pi_{\mathrm{ref}}(h^1\mid q)} - \beta\log\frac{\pi_\theta(h^2\mid q)}{\pi_{\mathrm{ref}}(h^2\mid q)} \right) \right] $$

$\beta$ controls how far the trained policy may move from the reference. DPO removes the separate reward model and online sampling loop. It is operationally simpler, but the paper's experiments do not make it the default winner. On several comparisons, DPO either improves calibration at a painful accuracy cost or worsens both relative to PPO.

Return to one-pass inference

flowchart TD
    A["Prompt q"] --> B["Frozen model: top K first tokens"]
    B --> C["K greedy continuations"]
    C --> D["Append So the answer is"]
    D --> E["Extract answer spans"]
    E --> F["Average top1 minus top2 confidence"]
    F --> G["Rank traces by confidence"]
    G --> H["Synthetic preferred and rejected pairs"]
    H --> I["Bradley-Terry reward model"]
    I --> J["PPO update"]
    H --> K["DPO update"]
    J --> L["Greedy inference at 1x cost"]
    K --> L

The diagram captures the central economic argument. Ten-way candidate generation appears only during training-data construction. After PPO or DPO, the model uses ordinary greedy decoding. RLSF therefore trades one-time training computation for lower recurring inference latency, while accepting the risk that the confidence source is internal and potentially wrong.

Results: calibration gains are real, but not uniform

The experiments cover MultiArith and GSM8K for arithmetic, CommonsenseQA and ARC Easy for multiple choice, and the mathematical subset of RewardBench for reward-model evaluation. Baselines include greedy decoding, chain-of-thought prompting, ten-way chain-of-thought decoding, URM-based RLHF, RLSF-DPO, and RLSF-PPO. Exact-match accuracy and expected calibration error are reported separately.

Qwen 2.5 7B is the clearest poorly calibrated case. Its GSM8K greedy accuracy is 53.67 with an ECE of 42.86. RLSF-PPO reaches 58.62 accuracy and lowers ECE to 41.92. On MultiArith, accuracy moves from 79.44 to 78.06 while ECE improves from 20.75 to 18.35. This pattern supports the paper's calibration thesis, but it directly contradicts any blanket claim that accuracy is preserved in every setting.

Qwen 2.5 7B settingMultiArith accuracyMultiArith ECEGSM8K accuracyGSM8K ECE
Base greedy79.4420.7553.6742.86
CoT decoding K=1077.7722.2258.5241.46
RLSF-DPO71.6225.1250.7338.15
RLSF-PPO78.0618.3558.6241.92

DPO is especially revealing. Its GSM8K ECE of 38.15 is lower than PPO's 41.92, but its accuracy falls to 50.73. Calibration and correctness cannot be collapsed into a single ranking. A model can become less overconfident while also losing useful correct answers. The appropriate choice therefore depends on whether a deployment values abstention-like uncertainty or maximum exact accuracy.

Gemma 2B begins from a much stronger operating point. Ten-way CoT decoding reaches 99.01 on MultiArith and 89.18 on GSM8K. RLSF-PPO reaches 98.83 and 88.14. It also improves ECE over greedy decoding, but does not match the best inference-time search. The real advantage is that RLSF obtains a close operating point with one greedy pass instead of keeping ten candidates alive.

Gemma 2B settingMultiArith accuracyMultiArith ECEGSM8K accuracyGSM8K ECE
Base greedy98.127.4385.5712.24
CoT decoding K=1099.014.1289.1810.94
RLSF-DPO96.1310.5284.7417.43
RLSF-PPO98.837.8188.1412.54

Multiple-choice experiments follow the same conditional pattern. Phi-2 is poorly calibrated on CommonsenseQA and improves substantially under RLSF-PPO, moving from 54.46 to 61.13 accuracy and from 25.12 to 19.64 ECE. Gemma 2 on ARC Easy is already strong; RLSF-PPO moves accuracy from 96.96 to 97.04 and ECE from 16.12 to 5.12. It does not beat the 3.03 ECE of ten-way decoding, but it avoids the tenfold deployment cost.

Model and taskTraining and decodingAccuracyECE
Phi-2 / CommonsenseQABase greedy54.4625.12
Phi-2 / CommonsenseQARLSF-PPO then greedy61.1319.64
Gemma 2 / ARC EasyBase greedy96.9616.12
Gemma 2 / ARC EasyCoT decoding K=1096.283.03
Gemma 2 / ARC EasyRLSF-PPO then greedy97.045.12

The authors also test whether self-generated preferences produce useful reward models. On the RewardBench math subset, RLSF reaches 76.13 with Qwen and 81.43 with Gemma. URM and QRM reach about 97, but they use human preferences. AfD ranges from 73.12 to 89.29 while using demonstration answers. RLSF sees prompts only in this comparison, so a sixteen-to-twenty-one point deficit is a meaningful limitation rather than a footnote.

Reward modelPromptAnswerPreferenceAccuracy
URM LLaMA 3.1 8BYesNoYes97.00
QRM LLaMA 3.1 8BYesNoYes96.80
Qwen 2.5 7B AfDYesYesNo89.29
Gemma 2 2B AfDYesYesNo73.12
Qwen 2.5 7B RLSFYesNoNo76.13
Gemma 2 2B RLSFYesNoNo81.43

What the figures reveal

Figure 2 visualizes token-level rewards from the learned model. Correct numerical expressions often receive high reward, but the model can also reward a plausible intermediate step that later supports a wrong answer. The color map is therefore evidence of learned preference structure, not a formal proof checker. A high-reward token sequence may still contain invalid arithmetic or post-hoc rationalization.

Token-level reward visualization

Figure 2: Token-level rewards from the paper. Color indicates reward-model preference, not verified logical correctness.

Figure 3 is a more focused calibration example. Both the before and after models choose option A when the correct answer is E. Before RLSF, the model assigns A a probability of 0.993 and E only 0.004. After RLSF, A falls to 0.712 and E rises to 0.138. The prediction remains wrong, but the probability distribution becomes less dangerously certain and gives the correct answer a larger share.

Calibration example before and after RLSF

Figure 3: A render of the paper's inline vector figure. The answer remains incorrect, but RLSF lowers confidence in the wrong choice and raises probability for the correct choice.

Limitations and independent assessment

The authors state that RLSF handles single-step reasoning better than long-horizon interaction. This is a serious boundary for embodied systems. A robot may make an apparently reasonable decision, receive delayed evidence of failure, and need to revise a plan over many actions. Final-answer confidence does not identify which intermediate observation or action caused the failure.

The method also assumes that useful latent reasoning paths already exist. For a severely undertrained model, the top ten branches may all be incoherent, and the confidence gap may mostly measure familiarity with vocabulary rather than quality. The experiments stop around nine-billion-parameter models. Scaling to frontier models and substantially harder reasoning domains remains untested.

Most importantly, self-feedback does not create external knowledge. If the pretrained model lacks a fact, RLSF can reinforce a confidently wrong internal pattern. Figure 3 makes the distinction concrete: confidence becomes less extreme, but the answer is still wrong. The method should be understood as an internal-consistency and calibration stage, not as a replacement for retrieval, tool use, world-model verification, or safety constraints.

There is also a reproducibility ambiguity. The model section names Gemma 2 2B, while Table 2 and the public README refer to a Gemma 9B configuration for some question-answering and reward-model work. The paper may be reporting different configurations in different experiments, but it should identify the exact model behind each table more explicitly. Without that mapping, readers cannot fully separate method effects from model-size effects.

Finally, the abstract and conclusion imply that calibration improves without harming accuracy. The detailed tables are more nuanced. RLSF-PPO lowers Qwen MultiArith accuracy from 79.44 to 78.06, and its Gemma GSM8K result of 88.14 remains below the 89.18 obtained by ten-way decoding. A defensible summary is that RLSF offers substantial benefits for poorly calibrated bases and a useful cost trade-off for strong bases, not an unconditional accuracy guarantee.

Conclusion

The central idea is economical: a model already exposes alternatives during decoding, and those alternatives can be ranked without asking a human to label them. RLSF converts expensive multi-path reasoning at inference into synthetic preferences at training time, then distills the preferred behavior through PPO or DPO. It is most persuasive when the base model is poorly calibrated and a single-pass model is needed after training.

The unresolved question is whether confidence is measuring reasoning quality or merely internal familiarity. Combining self-feedback with external execution, retrieval, or formal verification would address that question more directly than another round of self-training. For robotics and other safety-sensitive systems, such external grounding should remain a separate layer rather than being inferred from a lower answer-token probability alone.

Self-feedback can make uncertainty more useful, but it cannot turn internal confidence into external evidence.

Related Papers

Reflect, Retry, Reward: Self-Improving LLMs via Reinforcement Learning

Reflect, Retry, Reward: Self-Improving LLMs via Reinforcement Learning

We explore a method for improving the performance of large language models through self-reflection and reinforcement learning. By incentivizing the model to generate better self-reflections when it answers incorrectly, we demonstrate that a model's ability to solve complex, verifiable tasks can be enhanced even when generating synthetic data is infeasible and only binary feedback is available. Our framework operates in two stages: first, upon failing a given task, the model generates a self-reflective commentary analyzing its previous attempt; second, the model is given another attempt at the task with the self-reflection in context. If the subsequent attempt succeeds, the tokens generated during the self-reflection phase are rewarded. Our experimental results show substantial performance gains across a variety of model architectures, as high as 34.7% improvement at math equation writing and 18.1% improvement at function calling. Notably, smaller fine-tuned models (1.5 billion to 7 billion parameters) outperform models in the same family that are 10 times larger. Our novel paradigm is thus an exciting pathway to more useful and reliable language models that can self-improve on challenging tasks with limited external feedback.

Shelly Bensal, Umar Jamil, Christopher Bryant · 10 views · May 30, 2025
Large Language ModelsReinforcement Learning
May 30, 2025
RLSR: Reinforcement Learning from Self Reward

RLSR: Reinforcement Learning from Self Reward

Large language models can generate solutions to complex problems, but training them with reinforcement learning typically requires verifiable rewards that are expensive to create and not possible for all domains. We demonstrate that LLMs can effectively self-improve through self-judging without reference solutions, leveraging the inherent asymmetry between generating and verifying solutions. Our experiments show that models can provide reliable reward signals without ground truth answers, enabling reinforcement learning in domains where verifiable rewards are impractical. By implementing self-judging across Countdown puzzles and integration problems, we achieve performance comparable to formal verification without ground truth solutions. Most notably, Qwen 2.5 7B DeepSeek Distilled trained with self-rewards qualifies for the prestigious MIT Integration Bee competition, performance through self-supervised improvement. When combined with synthetic question generation, we establish a complete self-improvement loop where models generate practice problems, solve them, and evaluate their own performance without any external validation. Our findings demonstrate that LLM judges can provide effective reward signals for training, unlocking reinforcement learning in countless domains previously limited by reward engineering challenges. This work represents a significant step toward autonomous AI systems that continuously improve through self-directed learning rather than human-guided training, potentially accelerating progress across domains where training data is scarce or evaluation is complex.

Toby Simonds, Kevin Lopez, Akira Yoshiyama · 12 views · May 12, 2025
Reinforcement LearningLarge Language Models
May 12, 2025
Why is AI-generated language so hard to understand?

Why is AI-generated language so hard to understand?

The authors compare psycholinguistic processing-cost features across 14 language models in chat, coding, and essay settings. Relative to round-trip paraphrases, frontier models overuse low-frequency n-grams, long dependencies, stacked noun compounds, denominal verbs, reduced object relatives, and atypical animacy patterns. They hypothesize that post-training for math, code, and verifiable rewards rewards information density rather than human communication. A Qwen2.5-1.5B Instruct experiment with GRPO shows that a simple length penalty can create a near-categorical preference for shorter variants and transfer to some untrained constructions. Task success therefore does not guarantee human-comprehensible language.

Thomas Hikaru Clark, Matias B. Martin, Kyle Mahowald · 114 views · Oct 21, 2026
Large Language ModelsPsycholinguistics
Oct 21, 2026
TokenGate: Learnable Token Pruning for Fast, Memory-Efficient LLM Prefill

TokenGate: Learnable Token Pruning for Fast, Memory-Efficient LLM Prefill

TokenGate learns a residual scorer at a middle layer, retains top-K document tokens plus request scaffolding, and uses token-gated attention to train through the discrete selection. It reports 1.4-11.3x faster TTFT and 1.5-3.4x lower peak prefill memory on Qwen3 and Qwen3.5 without accuracy loss; robotics performance remains untested.

Liana Patel, Rishabh Ranjan, Ion Stoica · 181 views · Oct 19, 2026
Large Language ModelsToken Pruning
Oct 19, 2026

As an Amazon Associate, we earn from qualifying purchases.