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

Wen-Tse Chen, Jiayu Chen, Fahim Tajwar, Hao Zhu, Xintong Duan +2 more
2/19/2026
cs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2026retrospective,
  title  = {Retrospective In-Context Learning for Temporal Credit Assignment with Large Language Models},
  author = {Wen-Tse Chen and Jiayu Chen and Fahim Tajwar and Hao Zhu and Xintong Duan and Ruslan Salakhutdinov and Jeff Schneider},
  year   = {2026},
  eprint = {2602.17497},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.17497v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.17497.svg)](https://codeofpaper.com/paper/2602.17497)

Discussion