Manuscript Offprint

arXiv:2609.05111

Unifying ICL, SFT, KL-Regularized RL Through a Bayesian Lens

Junxin Fan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language models are now trained and evaluated under a diverse set of paradigms: supervised fine-tuning (SFT), few-shot in-context learning (ICL), KL-regularized RLHF/RLVR, on-policy distillation (OPD), and test-time reasoning with search and chain-of-thought. These methods are often discussed as fundamentally different, and recent empirical results—such as the mixed impact of few-shot prompting on RL-tuned reasoning models—can appear puzzling. This note develops a unified Bayesian perspective that puts these procedures on the same footing.

At the core is a two-step template: (i) construct a (generalized) Bayes or Gibbs posterior q∗q^* over outputs or actions given a context, using a prior/reference model and a utility signal (log-likelihood, reward, or advantage); and (ii) approximate q∗q^* by a forward-KL projection onto a parametric family, either in-weights (SFT/RL) or in-context (ICL). Part I formalizes few-shot ICL and SFT as amortized and in-weights projections onto the Bayes posterior predictive. Parts II–IV show that KL-regularized RLHF/RLVR, reward-weighted SFT, reward-weighted ICL (RW-ICL), and advantage-weighted SFT (AWSFT) are all instances of forward-KL projection onto Gibbs posteriors induced by rewards or advantages. We disentangle where these equivalences hold (objectives and first-order updates) and where they do not (source and granularity of the learning signal).

Part V sketches implications for modern reasoning pipelines. We view RLHF/RLVR recipes as “posterior design + projection”, explain why some form of cold-start or supervised warm-up is practically unavoidable for importance-weighted KL projections—including on-policy distillation and self-training pipelines—through a support-overlap and importance-weighting view, and interpret DeepSeek-R1 and o1-style reasoning models as combining test-time Bayesian search with training-time KL amortization. Together, these pieces suggest a coherent Bayesian/KL-projection backbone behind many current post-training strategies for reasoning LMs.

Keywords: in-context learning; supervised fine-tuning; KL-regularized reinforcement learning; Gibbs posterior; Bayesian meta-learning

Part I: Few-shot ICL ≈ SFT (Bayesian View)

References (22)