cs.LGFeb 19, 2026

Retrospective In-Context Learning for Temporal Credit Assignment with Large Language Models

Authors: Wen-Tse Chen, Jiayu Chen, Fahim Tajwar, Hao Zhu, Xintong Duan, Ruslan Salakhutdinov, Jeff Schneider

Organizations: Carnegie Mellon University · The University of Hong Kong · Stanford University

Abstract

Learning from self-sampled data and sparse environmental feedback remains a fundamental challenge in training self-evolving agents. Temporal credit assignment mitigates this issue by transforming sparse feedback into dense supervision signals. However, previous approaches typically depend on learning task-specific value functions for credit assignment, which suffer from poor sample efficiency and limited generalization. In this work, we propose to leverage pretrained knowledge from large language models (LLMs) to transform sparse rewards into dense training signals (i.e., the advantage function) through retrospective in-context learning (RICL). We further propose an online learning framework, RICOL, which iteratively refines the policy based on the credit assignment results from RICL. We empirically demonstrate that RICL can accurately estimate the advantage function with limited samples and effectively identify critical states in the environment for temporal credit assignment. Extended evaluation on four BabyAI scenarios show that RICOL achieves comparable convergent performance with traditional online RL algorithms with significantly higher sample efficiency. Our findings highlight the potential of leveraging LLMs for temporal credit assignment, paving the way for more sample-efficient and generalizable RL paradigms.

Figures & tables

Appendix figures & tables10 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Self-Credit: Credit Assignment for Long-Horizon Agentic RL via Intra-group Rescaling

    Oct 20, 2026Fangcong Yin, Ming Yin, Tanvi Bhandarkar +7Agentic RLStep-Level Credit Assignment in RL

  2. LLM Value Functions for Credit Assignment in Agentic RL

    Oct 11, 2026Kaijie Zhu, Weixiang Yan, Omar Attia +3RL for LLM AgentsAgentic RL

  3. Contextual Credit Policy Optimization

    Oct 13, 2026Huiwen Han, Ziyao Zeng, Zihao Zhu +6RL for LLM AgentsStep-Level Credit Assignment in RL