Reward Is Enough: LLMs Are In-Context Reinforcement Learners

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Song, Kefan, Moeini, Amir, Wang, Peng, Gong, Lei, Chandra, Rohan, Zhang, Shangtong, Qi, Yanjun
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915955585581056
author Song, Kefan
Moeini, Amir
Wang, Peng
Gong, Lei
Chandra, Rohan
Zhang, Shangtong
Qi, Yanjun
author_facet Song, Kefan
Moeini, Amir
Wang, Peng
Gong, Lei
Chandra, Rohan
Zhang, Shangtong
Qi, Yanjun
contents Reinforcement learning (RL) is a framework for solving sequential decision-making problems. In this work, we demonstrate that, surprisingly, RL emerges during the inference time of large language models (LLMs), a phenomenon we term in-context RL (ICRL). To reveal this capability, we introduce a simple multi-round prompting framework, we call ICRL prompting, for inference-time self-improvement. The goal of ICRL prompting is to guide LLMs to perform reinforcement learning during inference for self-improvement on a given task. After each response, the model receives numerical scalar feedback, denoted as a reward. In the next round, we prompt the LLM again together with a context that concatenates all prior responses and their associated rewards. We consistently observe that response quality improves as the context grows. In other words, the LLM can optimize scalar reward signals during inference, exhibiting behavior analogous to reinforcement learning. We evaluate ICRL prompting on Game of 24, creative writing, ScienceWorld, and Olympiad-level math competitions (AIME and HMMT), demonstrating significant improvements over baselines such as Self-Refine and Reflexion. Notably, even when the reward signals are generated by the same LLM, ICRL prompting still improves performance, highlighting a promising new paradigm for test-time scaling.
format Preprint
id arxiv_https___arxiv_org_abs_2506_06303
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Reward Is Enough: LLMs Are In-Context Reinforcement Learners
Song, Kefan
Moeini, Amir
Wang, Peng
Gong, Lei
Chandra, Rohan
Zhang, Shangtong
Qi, Yanjun
Machine Learning
Artificial Intelligence
Computation and Language
Reinforcement learning (RL) is a framework for solving sequential decision-making problems. In this work, we demonstrate that, surprisingly, RL emerges during the inference time of large language models (LLMs), a phenomenon we term in-context RL (ICRL). To reveal this capability, we introduce a simple multi-round prompting framework, we call ICRL prompting, for inference-time self-improvement. The goal of ICRL prompting is to guide LLMs to perform reinforcement learning during inference for self-improvement on a given task. After each response, the model receives numerical scalar feedback, denoted as a reward. In the next round, we prompt the LLM again together with a context that concatenates all prior responses and their associated rewards. We consistently observe that response quality improves as the context grows. In other words, the LLM can optimize scalar reward signals during inference, exhibiting behavior analogous to reinforcement learning. We evaluate ICRL prompting on Game of 24, creative writing, ScienceWorld, and Olympiad-level math competitions (AIME and HMMT), demonstrating significant improvements over baselines such as Self-Refine and Reflexion. Notably, even when the reward signals are generated by the same LLM, ICRL prompting still improves performance, highlighting a promising new paradigm for test-time scaling.
title Reward Is Enough: LLMs Are In-Context Reinforcement Learners
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2506.06303