Reward Is Enough: LLMs Are In-Context Reinforcement Learners
This work investigates whether large language models (LLMs) can spontaneously perform reinforcement learning–like optimization during inference—termed *in-context reinforcement learning* (ICRL). To this end, we propose an ICRL framework that requires no parameter updates and instead relies solely on multi-round context augmentation and scalar reward feedback: at each round, the prompt is dynamically reconstructed based on prior model responses and (human- or self-generated) rewards, enabling online improvement of output quality. Our key contribution is the first empirical demonstration that LLMs possess gradient-free, inference-time reward maximization capability, supporting closed-loop self-feedback optimization and extending beyond conventional test-time learning paradigms. Evaluated on Game of 24, creative writing, and ScienceWorld, ICRL significantly outperforms Self-Refine and Reflexion. Notably, it maintains robust performance gains even when using self-assessed rewards.