Agent Lightning: Train ANY AI Agents with Reinforcement Learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Luo, Xufang, Zhang, Yuge, He, Zhiyuan, Wang, Zilong, Zhao, Siyun, Li, Dongsheng, Qiu, Luna K., Yang, Yuqing
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912521659613184
author Luo, Xufang
Zhang, Yuge
He, Zhiyuan
Wang, Zilong
Zhao, Siyun
Li, Dongsheng
Qiu, Luna K.
Yang, Yuqing
author_facet Luo, Xufang
Zhang, Yuge
He, Zhiyuan
Wang, Zilong
Zhao, Siyun
Li, Dongsheng
Qiu, Luna K.
Yang, Yuqing
contents We present Agent Lightning, a flexible and extensible framework that enables Reinforcement Learning (RL)-based training of Large Language Models (LLMs) for any AI agent. Unlike existing methods that tightly couple RL training with agent or rely on sequence concatenation with masking, Agent Lightning achieves complete decoupling between agent execution and training, allowing seamless integration with existing agents developed via diverse ways (e.g., using frameworks like LangChain, OpenAI Agents SDK, AutoGen, and building from scratch) with almost ZERO code modifications. By formulating agent execution as Markov decision process, we define an unified data interface and propose a hierarchical RL algorithm, LightningRL, which contains a credit assignment module, allowing us to decompose trajectories generated by ANY agents into training transition. This enables RL to handle complex interaction logic, such as multi-agent scenarios and dynamic workflows. For the system design, we introduce a Training-Agent Disaggregation architecture, and brings agent observability frameworks into agent runtime, providing a standardized agent finetuning interface. Experiments across text-to-SQL, retrieval-augmented generation, and math tool-use tasks demonstrate stable, continuous improvements, showcasing the framework's potential for real-world agent training and deployment.
format Preprint
id arxiv_https___arxiv_org_abs_2508_03680
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Agent Lightning: Train ANY AI Agents with Reinforcement Learning
Luo, Xufang
Zhang, Yuge
He, Zhiyuan
Wang, Zilong
Zhao, Siyun
Li, Dongsheng
Qiu, Luna K.
Yang, Yuqing
Artificial Intelligence
Machine Learning
We present Agent Lightning, a flexible and extensible framework that enables Reinforcement Learning (RL)-based training of Large Language Models (LLMs) for any AI agent. Unlike existing methods that tightly couple RL training with agent or rely on sequence concatenation with masking, Agent Lightning achieves complete decoupling between agent execution and training, allowing seamless integration with existing agents developed via diverse ways (e.g., using frameworks like LangChain, OpenAI Agents SDK, AutoGen, and building from scratch) with almost ZERO code modifications. By formulating agent execution as Markov decision process, we define an unified data interface and propose a hierarchical RL algorithm, LightningRL, which contains a credit assignment module, allowing us to decompose trajectories generated by ANY agents into training transition. This enables RL to handle complex interaction logic, such as multi-agent scenarios and dynamic workflows. For the system design, we introduce a Training-Agent Disaggregation architecture, and brings agent observability frameworks into agent runtime, providing a standardized agent finetuning interface. Experiments across text-to-SQL, retrieval-augmented generation, and math tool-use tasks demonstrate stable, continuous improvements, showcasing the framework's potential for real-world agent training and deployment.
title Agent Lightning: Train ANY AI Agents with Reinforcement Learning
topic Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2508.03680