Agent Lightning: 強化学習によるあらゆるAIエージェントのトレーニング
Agent Lightning: Train ANY AI Agents with Reinforcement Learning
August 5, 2025
著者: Xufang Luo, Yuge Zhang, Zhiyuan He, Zilong Wang, Siyun Zhao, Dongsheng Li, Luna K. Qiu, Yuqing Yang
cs.AI
要旨
本論文では、任意のAIエージェントに対する大規模言語モデル(LLM)の強化学習(RL)ベースのトレーニングを可能にする、柔軟で拡張性の高いフレームワーク「Agent Lightning」を提案します。既存の手法ではRLトレーニングがエージェントと密結合していたり、シーケンス連結とマスキングに依存していたりするのに対し、Agent Lightningはエージェントの実行とトレーニングを完全に分離し、LangChain、OpenAI Agents SDK、AutoGenなどのフレームワークを使用して開発された既存のエージェントや、ゼロから構築されたエージェントと、ほぼコード変更なしでシームレスに統合できます。エージェントの実行をマルコフ決定過程として定式化することで、統一されたデータインターフェースを定義し、クレジット割り当てモジュールを含む階層型RLアルゴリズム「LightningRL」を提案します。これにより、任意のエージェントによって生成された軌跡をトレーニング遷移に分解することが可能になり、RLがマルチエージェントシナリオや動的ワークフローなどの複雑な相互作用ロジックを扱えるようになります。システム設計においては、トレーニングとエージェントを分離するアーキテクチャを導入し、エージェントのランタイムに観測可能性フレームワークを組み込むことで、標準化されたエージェントのファインチューニングインターフェースを提供します。テキストからSQLへの変換、検索拡張生成、数学ツール使用タスクにおける実験を通じて、安定した継続的な改善が確認され、本フレームワークが実世界のエージェントトレーニングとデプロイメントにおいて持つ可能性が示されています。
English
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.