Connect the Dots: Training LLMs for Long-Lifecycle Agents with Cross-Domain Generalization Via Reinforcement Learning

Yanxi Chen, Weijie Shi, Yuexiang Xie, Boyi Hu, Yaliang Li +2 more
6/18/2026
cs.LGcs.AIcs.CL

Official code: agentscope-ai/Trinity-RFT (703 stars, Apache-2.0, last commit 2026-04-28).

Abstract

This work presents a general framework for training large language models (LLMs) to "Connect the Dots" (CoD), a meta-capability required by long-lifecycle agents: as an LLM-based AI agent gets deployed in an environment, it solves a long sequence of tasks while continuously exploring the environment, learning from its own experiences, and iteratively self-updating its context about the environment, thereby achieving progressively better performance on future tasks conditioned on the updated context. Major components of the CoD framework include: (1) algorithm design and infrastructure for end-to-end reinforcement learning (RL) with long rollout sequences interleaving solve-task and update-context episodes; (2) tasks and environments for incentivizing and eliciting the targeted meta-capability in LLMs during training, as well as for faithfully measuring progress during evaluation. We present proof-of-concept implementations of the CoD framework, including a GRPO-style RL algorithm with fine-grained credit assignment, as well as tasks and environments tailored to the targeted meta-capability (rather than domain-specific LLM capabilities or standard task-by-task RL). Empirical results validate the efficacy of end-to-end RL training in the CoD setting, and demonstrate the potential for out-of-distribution generalization -- within the training domains, across different domains, and from CoD to Ralph-loop settings -- of the elicited meta-capability. Our investigation of CoD connects several lines of prior works, and opens up new opportunities for advancing LLMs and AI agents. To facilitate further research and applications, we release our implementations at \url{https://github.com/agentscope-ai/Trinity-RFT/tree/research/cod/examples/research_cod}.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Trinity-RFT is a general-purpose, flexible and scalable framework designed for reinforcement fine-tuning (RFT) of large language models (LLM).

70383Jinja, PythonApr 9, 20255 months agoApache-2.0
agentllmrlhf

Similar Papers

Cite this paper

@article{chen2026connect,
  title  = {Connect the Dots: Training LLMs for Long-Lifecycle Agents with Cross-Domain Generalization Via Reinforcement Learning},
  author = {Yanxi Chen and Weijie Shi and Yuexiang Xie and Boyi Hu and Yaliang Li and Bolin Ding and Jingren Zhou},
  year   = {2026},
  eprint = {2606.20002},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.20002v1}
}

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

Discussion