arXiv:2610.11152cs.LGOct 2026

Manuscript Offprint

arXiv:2610.11152

Do LLMs Learn from Rewards in Context? : Rethinking the role of reward in In-Context Reinforcement Learning

Minchan Kwon, Seunghee Koh, Sunghyun Baek, Minsung Bae, Junmo Kim

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

Abstract

LLM agents increasingly improve at inference time by accumulating experience in context rather than by updating parameters. This process is often described as in-context reinforcement learning (ICRL). Whether in-context learning (ICL) can actually play the role of RL, however, has not been tested. We study this question in its simplest form, direct ICRL, where the model conditions directly on raw trajectory–reward pairs, and ask whether the reward acts as a learning signal. Through controlled experiments on four benchmarks across six models, we find that the reward is read, but its effect is small: flipping, randomizing, or removing the reward leaves the improvement curve almost unchanged, and this holds even under meta-prompts that explicitly instruct the model to explore, exploit, or reason over rewards. Trajectories drive improvement, but not through their semantic content: shuffled or corrupted trajectories work as well as real ones. These patterns closely mirror those known in ICL, suggesting that direct ICRL is better understood as a special case of ICL than as inference-time RL. This reframing has implications for agent memory design: ICL factors such as input distribution and demonstrations may matter more than RL elements such as reward shaping and exploration.

1 Introduction

Recently, agent-based AI systems have demonstrated remarkable performance in many areas by learning from experience without changing their parameters [18, 29, 22, 24, 27]. This involves the agent performing an action, receiving feedback, storing the results in memory, and then acting based on that memory in the next attempt. The terminology surrounding these systems is borrowed from reinforcement learning (RL), and the performance improvements they demonstrate are often accepted as evidence of in-context reinforcement learning (ICRL) [19, 3, 18]. However, in-context learning (ICL) is known to operate quite differently from gradient-based learning [11, 28]. ICL is sensitive to input distributions and surface forms, yet surprisingly insensitive to label content [11]. This raises a fundamental question. When an LLM improves through experience-reward pairs in a context, is it performing reinforcement learning, or is it performing ICL?

To answer this question, we conduct research in the simplest controllable ICRL setting. We define “Direct In-Context Reinforcement Learning (Direct ICRL).” In this setting, the model is given only raw trajectory–reward pairs. This is a simple setting that excludes various additional elements such as memory storage, selection, and summarization methods [18, 29, 27]. Recent research reports that even in this setting alone, LLMs can function as in-context RL learners [19, 3]. We conduct various controlled experiments in direct ICRL to analyze how direct ICRL works.

(RQ1) The role of reward. Does the reward text act as a signal that induces an RL-like shift in the policy distribution, boosting high-reward trajectories and suppressing low-reward ones?

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

(RQ2) The role of trajectory. Which features of the trajectory drive improvement — its semantic content, its surface form, or its relevance to the task?

To answer these questions, we design three controlled experiments. The first asks whether the improvement depends on the reward. We keep the trajectories fixed and replace the true rewards with flipped or random values, or remove them entirely (Section 4). The second asks how strongly a reward changes the model's tendency to reproduce a trajectory. We measure the probability of regenerating each trajectory in memory and how often the model actually replays it (Section 5). The third asks which properties of a trajectory make it useful. We compare memories built from different sources and perturb trajectories so that their surface form is preserved while their content is corrupted (Section 6). The experiments are conducted across three benchmarks—coding environments (HumanEval+ [2], MBPP+ [1]) and the agentic environment (ScienceWorld [23])—using six models (Qwen-3-4B-Instruct [20], Qwen-3.5-9B [16], Llama-3.1-8B [5], Gemini-3.1-Flash-Lite [4], GPT-5-nano [14], GPT-5-mini [13]) spanning both open-source and proprietary models.

Our findings indicate that direct ICRL is driven more by trajectory imitation than by reward semantics. The reward works, but its effect is weak. Changes in reward levels have a negligible impact on policy probabilities compared to the influence of trajectories. According to our regeneration-probability analysis, the reward's impact is only about 14% of the trajectory's. Furthermore, the model uses trajectories without depending on their semantic correctness. Even shuffled or corrupted trajectories perform comparably to real ones. The only factor that degrades performance is task relevance. These findings closely mirror the patterns observed in ICL by Min et al. [11].

Therefore, we argue that direct ICRL should be reframed as a special case of ICL rather than as inference-time RL. This raises questions for agentic memory design, which has so far been guided by RL-style ideas such as reward-based filtering [3], exploration [19], and reward shaping. The factors that matter may shift toward those identified in ICL, such as input distribution and demonstrations [11]. For example, if failures are accumulated in memory, this may induce replay rather than exploration. Relatedly, this implies that the success condition for direct ICRL is bounded by the model's prior. We discuss these topics in Section 7.

References (24)