Agentic In-Context Learning: What Algorithms Can Transformers Learn in Closed-Loop Interaction?

Shiguang Wu, Yaqing Wang, Quanming Yao
10/16/2026
cs.AI
transformer-attentionrl

No confident code implementation found for this paper.

Abstract

The learning algorithm view of in-context learning (ICL) studies how fixed-parameter Transformers learn from supplied examples. Language model agents extend this setting through interaction: their actions determine what evidence enters context next.

Show full abstract

We call this regime Agentic In-Context Learning (Agentic ICL). Existing studies largely depend on externally supplied contexts or reward-bearing interaction histories, while work on general tool-using agents lacks a learning algorithm view. We represent an interactive learner by its state, update, and decision rule, covering active learning, bandits, and online reinforcement learning (RL). For expressivity, we construct causal Transformers that approximate these algorithms over a finite horizon, and bound the resulting loss in return. For training, we characterize when optimizing process rewards preserves behavior that maximizes the final outcome. Distillation experiments show that Transformers can learn to execute three representative recursions. We then train models from outcome or process rewards without oracle action or state targets, as in RL post-training. Different rewards yield distinct decision policies. Improving the alignment of process supervision with outcome-optimal action preferences shifts learned decisions accordingly. Such behavioral differences persist in a pretrained language model across textual paraphrases.

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. Any repos shown below are weak matches — 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{wu2026agentic,
  title  = {Agentic In-Context Learning: What Algorithms Can Transformers Learn in Closed-Loop Interaction?},
  author = {Shiguang Wu and Yaqing Wang and Quanming Yao},
  year   = {2026},
  eprint = {2610.23051},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.23051v1}
}

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/2610.23051.svg)](https://codeofpaper.com/paper/2610.23051)

Discussion