強化学習によるマルチターンAIエージェントのカスタマイズ
Amazon Web ServicesのAI Labsは、既存の環境シミュレーターと検証可能なグランドトゥルースに基づく報酬関数を活用した強化学習によるカスタマイズ手法により、小規模モデル・小規模データでもマルチターンAIエージェントのタスク成功率を向上させることを実証した。
キーポイント
汎用AIエージェントのドメイン特化課題
汎用AIシステムは幅広いタスクで優れた能力を示すが、特定のワークフローや組織ニーズを深く理解する必要がある専門分野では限界があり、効率的なカスタマイズ手法が求められている。
強化学習による効率的なカスタマイズ手法
AWS AI Labsは、強化学習を用いて汎用エージェントを特定ドメインに適応させる手法を開発し、機械学習の専門知識や膨大な計算リソースを必要とせずに効率的なカスタマイズを実現した。
実証実験と成果
パーソナルアシスタントエージェントとエージェント型RAGの2つのユースケースで実験を行い、比較的少量のトレーニングデータでもタスク成功率を大幅に向上させることを実証した。
実用的な実験フレームワーク
非同期マルチターンエージェントに焦点を当て、ツールを使用して自律的にタスクを完了し、グランドトゥルースに対して結果を検証可能とする実用的なアプローチを採用した。
実験環境と報酬設計
既存のベンチマークデータセットと環境シミュレータを活用し、検証可能な環境フィードバック(タスク完了率、コード実行成功率など)を報酬信号として使用した。
RLトレーニングフレームワークの構成
オンラインシミュレータがタスクのバッチからロールアウト軌跡と報酬を生成し、オンラインRLトレーナーがそれらを使用してアクターポリシーを更新する。
RL訓練による具体的な行動改善
RL訓練により、エージェントはAPIドキュメントを常に確認してからコードを書くようになり、コードエラーが減少した。また、プロンプトのバリエーションに対して堅牢な意味理解を維持している。
影響分析・編集コメントを表示
影響分析
この研究は、企業が汎用AIモデルを自社の特定業務に効率的に適応させるための実用的な方法論を提供し、AIカスタマイズのコストと参入障壁を下げる可能性がある。特に中小企業や専門分野でのAI導入促進に寄与し、業界全体のAI実用化を加速させる重要な進展と言える。
編集コメント
汎用AIの実ビジネス応用における最大の課題である「ドメイン特化」に対して、強化学習という確立された手法で現実的な解決策を提示している点が注目される。研究内容が具体的なユースケースと実験結果で裏付けられているため、実用性の高い技術記事と言える。
強化学習によるマルチターンAIエージェントのカスタマイズ
検証可能なグランドトゥルースに基づく既存の環境シミュレーターと報酬関数を活用することで、小さなモデルと小さなトレーニングデータセットであっても、タスクの成功率を向上させることができます。
共有 共有 リンクをコピー
今日の急速に進化するAIの状況において、組織は、特定のドメインやビジネス環境で卓越した能力を発揮するAIエージェントをますます必要としています。汎用AIシステムは幅広いタスクにおいて印象的な能力を示しますが、特定のワークフロー、ツール、組織のニーズに対する深い理解を必要とする専門的な文脈で展開される場合、しばしば不十分な点があります。
最近の研究で、Amazon Web ServicesのAI Labsの科学者たちは、機械学習に関する広範な専門知識や法外な計算資源を必要とせずに、汎用エージェントを特定のドメインに効率的に適応させる方法を調査してきました。パーソナルアシスタントエージェントとエージェント型検索拡張生成(RAG)という2つの異なるユースケースにわたる体系的な実験を通じて、比較的少量のトレーニングデータであっても、強化学習ベースのカスタマイズが多様なユースケースにわたるタスクの成功率を大幅に向上させることができることを実証しました。
実験的枠組みと仮定
複雑な内部システムを操作し、企業固有のポリシーを理解し、何千ものインタラクションを通じて一貫したブランドの声を維持する必要があるカスタマーサービスエージェントを考えてみてください。あるいは、特定の組織のコーディング標準、アーキテクチャパターン、開発ワークフローに適応しなければならないコーディングアシスタントを想像してみてください。これらのシナリオは、既製のAIソリューション以上のものを要求します。それらは、意図された環境に対して体系的にカスタマイズおよび最適化できるエージェントを必要とします。私たちの研究は、そのようなエージェントをカスタマイズするための強化学習(RL)の使用を探求しています。
実験に実用的な基盤を確立するために、私たちはいくつかの単純化の仮定を置きました。私たちは主に、ツールを使用して自律的にタスクを完了でき、その結果がグランドトゥルースに対して検証可能な非同期マルチターンエージェントに焦点を当てました。このアプローチは、多くのシナリオに適用可能な枠組みを維持しながら、シミュレートされたユーザーへの依存を減らします。
さらに、公開ベンチマークデータセットおよびエージェントから既存の環境およびツールシミュレーターを活用し、シミュレーションインフラをゼロから構築するのではなく、中核となるRL方法論に集中できるようにしました。報酬信号については、タスク完了率、コード実行の成功、情報検索の精度など、環境から直接利用可能な検証可能なフィードバックに依存しています。これらの制約は、シナリオを現実的なものに保ちながら、実験を開始するために必要な最小限の条件を提供します。
実験設計
パーソナルアシスタントエージェントに関する実験では、電話アプリのインタラクションを通じて日常活動を完了させることを含むAppWorldベンチマークを使用しました。エージェント型RAG実験では、2つの異なるデータセットを使用して、インテリジェントな情報検索と統合のためのDeepSearchエージェントを実装しました。報酬関数については、AppWorldには検証可能な環境ベースのフィードバックを、RAGタスクには完全一致と意味的精度を頼りにしました。
私たちのRLトレーニングフレームワークには、オンラインシミュレーターとオンラインRLトレーナーという2つの主要コンポーネントがあります。オンラインシミュレーターは、タスクのバッチを受け取り、ロールアウト軌跡のバッチ(エージェントとその環境との間のインタラクションのシーケンスで、しばしば数十のAPI呼び出しを含む)を生成します。また、グランドトゥルースに対するチェックを実行することによって、各軌跡に対する報酬も生成します。
RLベーストレーニングパイプライン。
オンラインRLトレーナーは、オンラインシミュレーターからのロールアウト軌跡と報酬を受け取り、アクターポリシーを更新します。内部的に、オンラインRLトレーナーには、アクター、クリティック(近接方策最適化用で、ポリシー更新中に各トレーニング例に与えられるべき最適な重みを近似する)、およびリファレンスモデルなどのコンポーネントがあります。オンラインRLトレーナーでアクターポリシーが更新された後、アクターモデルの重みはオンラインシミュレーター内のエージェントに同期されます。
RLベーストレーニングパイプライン
AppWorld実験を例として、RLパイプラインを詳しく見てみましょう。まず、シミュレーターは、提供されたタスクIDに基づいてエージェントとAppWorld環境との間のインタラクションの並列シミュレーションを行い、ロールアウト軌跡のバッチを生成します。そのような軌跡の1つを考えてみましょう。これは、エージェントが「ファイルに日付プレフィックスを追加し、当年以外のファイルをリサイクルビンに移動する」という高レベルの指示を、複数のアプリケーションと推論ステップにわたる32の離散的なAPI呼び出しのシーケンスに体系的に分解する方法を示しています。
32ステップのサンプル軌跡のステップ17から19。完全な軌跡はAppWorldウェブサイトで見つけることができます。
エージェントは、スーパーバイザー提供の認証情報を使用してファイルシステムで認証することから始め、次に、イントロスペクション呼び出しを通じて利用可能なAPIを体系的に探索します。各ステップには、次のアクションに関する明示的な推論、APIが期待に沿わない場合のエラー処理(エージェントが「rename_file」関数を見つけられず、「move_file」を代わりに使用して適応する場合など)、および複数のファイル操作にわたる状態の維持が含まれます。
この軌跡は、エージェントが日付と時刻の複雑な解析を処理し、ファイルコレクションを反復処理し、データの整合性を維持しながら異なるディレクトリ構造にわたる操作を調整する能力を示しています。決定的に重要なのは、環境がタスク実行が成功したかどうかについて検証可能な情報を提供することであり、これにより強化学習フレームワークは、各ステップで人間による評価を必要とせずに、具体的で測定可能な結果を通じて学習することができます。さらに、報酬は最後のターンでのみ収集され、このスパースな報酬収集は、類似の方法と比較して大きなパフォーマンス上の利点を提供します。
結果と洞察
以下の統合表は、比較的小さなモデルに比較的小さなトレーニングデータセットが適用された場合でも、強化学習が多様なユースケースにわたるエージェントのパフォーマンスを大幅に向上させることができることを示しています。
ベースモデルパフォーマンス
RLトレーニング後パフォーマンス
パーソナルアシスタントエージェント
Qwen2.5-32B-Instruct
72% (vs. Sonnet 3.7/4.0 ~69%)
タスク目標完了
Qwen2.5-3b-Base
Llama-3.2-3B-inst
以下は、私たちの実験的知見のいくつかです:
より大きなベースモデルは、RLトレーニングによる絶対的なパフォーマンスの向上が大きくなります。これはおそらく、トレーニング中により高品質なロールアウトを生成し、RLプロセスを強化する正のフィードバックループを作り出すことに起因しています。
ますます能力の高いベースモデルにオンラインRLカスタマイズを適用することで、現在のプロプライエタリモデルによって確立されたベンチマークを超えるパフォーマンスが引き出される可能性があります。これらのプロプライエタリモデルは、ベースモデルよりもしばしば数倍大きく複雑です。
小規模なRLトレーニング(AppWorldでは72例)で、コストの1%から2%でプロプライエタリモデルに近いパフォーマンスを達成することは、モデルカスタマイズの経済性における根本的な変化を示しています。場合によっては、オンラインRLは最初のトレーニングステップから即効性を示し、30ステップ以内に競争力のあるパフォーマンスに急速に進展します。
RLトレーニングはまた、コードを書く前に常にAPIドキュメントをチェックするなど、有用である可能性のある特定の行動の改善を引き起こし、コードエラーの減少につながります。モデルはまた、
原文を表示
Customizing multiturn AI agents with reinforcement learning
Leveraging existing environment simulators and reward functions based on verifiable ground truth boosts task success rate, even with small models and small training datasets.
Share Share Copy link
In today's rapidly evolving AI landscape, organizations increasingly need AI agents that excel in specific domains and business environments. While general-purpose AI systems demonstrate impressive capabilities across broad tasks, they often fall short when deployed in specialized contexts that require deep understanding of particular workflows, tools, and organizational needs.
In recent work, scientists with Amazon Web Services’ AI Labs have been investigating how to efficiently adapt general-purpose agents to specific domains without requiring extensive expertise in machine learning or prohibitive computational resources. Through systematic experimentation across two distinct use cases — personal-assistant agents and agentic retrieval-augmented generation (RAG) — we've demonstrated that reinforcement-learning-based customization can significantly boost task success rates across diverse use cases, even with relatively small amounts of training data.
Experimental framework and assumptions
Consider a customer service agent that needs to navigate complex internal systems, understand company-specific policies, and maintain consistent brand voice across thousands of interactions. Or imagine a coding assistant that must adapt to a particular organization's coding standards, architectural patterns, and development workflows. These scenarios demand more than off-the-shelf AI solutions: they require agents that can be systematically customized and optimized for their intended environments. Our work explores the use of reinforcement learning (RL) to customize such agents.
To establish a practical foundation for our experiments, we made several simplifying assumptions. We focused primarily on asynchronous multiturn agents that can autonomously complete tasks using tools, with results verifiable against ground truth. This approach reduces our dependency on simulated users while maintaining a framework applicable to many scenarios.
Additionally, we leveraged existing environment and tool simulators from public benchmark datasets and agents, allowing us to focus on the core RL methodology rather than building simulation infrastructure from scratch. For reward signals, we rely on verifiable feedback available directly from the environment, such as task completion rates, code execution success, or information retrieval accuracy. These constraints provide the minimal conditions needed to begin our experimentation while keeping our scenarios realistic.
Experimental design
For our experiments involving a personal-assistant agent, we used the AppWorld benchmark, which involves the completion of day-to-day activities through phone app interactions. For the agentic-RAG experiments, we implemented a DeepSearch Agent for intelligent information retrieval and synthesis, using two different datasets. For the reward functions, we relied on verifiable environment-based feedback for AppWorld and exact match and semantic accuracy for RAG tasks.
Our RL training framework has two main components: an online simulator and an online RL trainer. The online simulator takes a batch of tasks and produces a batch of rollout trajectories — sequences of interactions between the agent and its environment, often involving dozens of API calls. It also produces a reward for each trajectory by running checks against ground truth.
RL-based-training pipeline.
The online RL trainer takes the rollout trajectories and the reward from the online simulator to update the actor policy. Internally, the online RL trainer has components such as actor, critic (for proximate policy optimization, which approximates the optimal weight that any one training example should be given during policy updates), and reference model. After the actor policy is updated in the online RL trainer, the weights of the actor model are synced to the agent in the online simulator.
RL-based-training pipeline
Let’s take a closer look at the RL pipeline, using the AppWorld experiments as an example. First, the simulator does a parallel simulation of interactions between agents and the AppWorld environment based on the provided task IDs and produces a batch of rollout trajectories. We’ll consider one such trajectory, which demonstrates how an agent systematically decomposes a high-level instruction — "add date prefixes to files and move non-current year files to recycle bin" — into a sequence of 32 discrete API calls across multiple applications and reasoning steps.
Steps 17 through 19 of a 32-step sample trajectory. The full trajectory can be found on the AppWorld website.
The agent begins by authenticating with the file system using supervisor-provided credentials, then methodically explores available APIs through introspection calls. Each step involves explicit reasoning about the next action, error handling when APIs don't conform to expectations (as when the agent finds no "rename_file" function and adapts, using "move_file" instead), and maintaining state across multiple file operations.
The trajectory showcases the agent's ability to handle complex parsing of dates and times, iterate through file collections, and coordinate operations across different directory structures while maintaining data integrity. Critically, the environment provides verifiable information about whether the task execution is successful, enabling the reinforcement learning framework to learn through concrete, measurable outcomes, rather than requiring human evaluation at every step. Moreover, rewards are collected only at the last turn, and this sparse reward collection provides a significant performance advantage over similar methods.
Results and insights
The consolidated table below shows that reinforcement learning can significantly boost agent performance across diverse use cases, even when relatively small training datasets are applied to relatively small models.
Base model performance
RL-trained performance
Personal-assistant agent
Qwen2.5-32B-Instruct
72% (vs. Sonnet 3.7/4.0 ~69%)
Task goal completion
Qwen2.5-3b-Base
Llama-3.2-3B-inst
Here are a few of our experimental findings:
Larger base models demonstrate greater gains from RL training in absolute performance. This likely stems from their generating higher-quality rollouts during training, creating a positive feedback loop that enhances the RL process.
Applying online RL customization to increasingly capable base models may unlock performance exceeding the benchmarks established by current proprietary models, which are often several times as large or complex as the base models.
Achieving near-proprietary-model performance with small-scale RL training (72 examples in AppWorld) at 1% to 2% the cost demonstrates a fundamental shift in the economics of model customization. In some cases, online RL shows immediate effectiveness from the first training step, with rapid progression to competitive performance within 30 steps.
RL training also induces specific behavioral improvements that may be useful, such as always checking API documentation before writing code, which leads to reduced code errors. Models also maintain robust semantic understanding across prompt variations even when exact-match scores decline, indicating genuine comprehension rather than pattern matching.
In our experiments, smaller models face fundamental reasoning limitations (inability to recognize unanswerable questions or extract answers from relevant context) that RL alone cannot overcome. For constrained models, targeted distillation from more capable models may be more effective than scaling RL training.
Based on these findings, we recommend investing in online RL as a method for agent customization across assistant agents and other use cases such as coding agents. However, several critical factors emerged that warrant careful attention in deployment: data quality and format correctness proved essential at every stage of the pipeline; larger base models demonstrated disproportionate benefits from RL training; and strategic task selection — prioritizing harder problems during training — enabled more efficient learning through asymmetric transfer to simpler tasks.
Looking ahead, our research roadmap focuses on two primary directions. The first is expanding the applicability of our approach through synthetic-data generation and adaptive data filtering to improve training efficiency. The second is deepening our understanding of RL algorithms through more thorough comparisons across model families, reward signal exploration beyond outcome-based metrics, and pipeline optimizations. These investigations aim to make RL-based agent customization more accessible, efficient, and effective for organizations seeking to deploy AI agents that truly excel in their specific operational contexts.
Our latest research papers — “SALT: Step-level advantage assignment for long-horizon agents via trajectory graph” and “Reinforcement learning for self-improving agent with skill library” — demonstrate further advances in agent RL algorithms, via fine-grained advantage assignment and reward shaping for agent skill learning, further demonstrating huge potential in this area.
Acknowledgments: Lin Lee Cheong
Conversational AI
Large language models (LLMs)
Reinforcement learning
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み