エージェント評価:詳細ガイド(53 分読了)
LLM の評価基準が静的ベンチマークから、コーディングや医療など高リスク領域で動作する動的なエージェントシステムの長期的・現実的なハルネス評価へとシフトしている。
キーポイント
評価パラダイムの転換
従来の静的ベンチマークから、複雑な環境下で長時間にわたって動作する動的なエージェントシステムへの評価基準へ移行している。
高リスク領域での必要性
コーディングや医療など、結果が重大な影響を及ぼす分野において、厳格なパフォーマンス測定と成果指向の評価が不可欠となっている。
リアルな評価ハルネスの重要性
エージェントの真価を測るには、現実世界を模した複雑な環境で動作させるための「リアリスティックなハルネス」の構築が鍵となる。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェントの実用化が進む中で、単なる精度テストを超えた「信頼性」と「安全性」をどう測定するかという業界の喫緊の課題を浮き彫りにしています。開発者は今後は静的なスコアだけでなく、複雑なシナリオ下でのエージェントの振る舞いを継続的に監視・評価するインフラや手法の開発に注力する必要が生じます。
編集コメント
エージェントが実社会で活躍するようになりつつある現在、その品質保証の方法論そのものが進化している重要な転換点です。開発者は従来のベンチマーク思考から脱却し、より現実的なテスト環境の構築に注力すべき時期に来ています。
(from [1, 3, 8, 12])
評価は、大規模言語モデル(LLM)における最も重要な研究分野の一つです。最近では、LLM の利用パターンと評価方法が劇的に変化しました。以前は静的な質問や短い会話からなるベンチマークを用いて LLM を評価していましたが、現在では長時間にわたって動作し環境と相互作用するエージェントシステムが存在します。その複雑さと自律性のため、エージェントを適切に評価することは困難です。エージェントシステムの能力を正確に測定するためには、実践での使用と同様にエージェントをテストできる現実的なハルネス(評価基盤)を構築する必要があります。コーディングや医療といった高リスクなアプリケーションにおけるエージェントの採用が拡大している現在、このような評価能力を構築することほど重要な時期はありません。
この概要では、現在のエージェントシステムがどのように評価されているかについて詳細なガイドを提供します。まず、基本概念からマルチエージェントシステムに至るまで、エージェント全般についての理解を深めることから始めます。次に、実践で観察される一般的なパターンに基づき、エージェント評価プロセスのための明確な枠組みを示します。これらの知識を基盤として、最近のエージェントベンチマークのいくつかの事例研究を紹介し、同様の概念を適用して独自のエージェント評価を構築する方法を示すロードマップを提供します。評価は時間がかかり困難ですが、適切にエージェントを評価する方法を学ぶことは非常に価値があります。パフォーマンスを厳密に測定し、逸話的なチェックに頼らないことで、エージェントの能力を急速に向上させることができます。
***「LLM は複雑な多段階タスクを処理する能力がますます高まっています。推論、マルチモーダル性、ツール利用における進展は、エージェントと呼ばれる新しいカテゴリの LLM 駆動システムを可能にしました。」 - [3] より引用
アジェンティック・エラの初期には、エージェントと通常の LLM の区別は不明確でした。結局のところ、LLM はすべてのエージェントシステムの核心にあります。時間の経過とともに、エージェントシステムの主要な特徴が明らかになってきました:
- リーディング
- ツールの呼び出し
- 複雑な多段階問題の解決
- エラーからの回復
- ユーザーに代わって行動を実行する
LLM は推論、ツール呼び出し、問題解決の能力を備えていますが、エージェントはこれらのコンポーネントをアジェンティック・ループ(agentic loop)内で組み合わせることで困難な問題を解決できる点で区別されます。詳しくは後述します。実際、最もシンプルな エージェントの定義 は、ツールを自律的にループ処理する LLM です。従来の LLM と異なり、エージェントはこのアジェンティック・ループ内で効果的に動作するために、中間結果を評価し、自らのエラーから動的に回復する必要があります。
アジェンティック・ループ
エージェントは長い時間軸で推論を行い、ツールを使用するため、*その自律性のレベルによって特徴づけられることもあります*。従来の LLM は、分類や質問応答など、狭く明確な範囲のタスクによく使用されます。この場合、モデルは出力を生成しますが、独立して行動を継続したり環境を変更する能力は持ちません。一方、エージェントは通常、一定期間にわたって自身のワークフローを制御することが許可されており、ツールを使用して自律的に行動を実行できます(例:カレンダーイベントの変更や航空券の予約など)。
従来の LLM の入力出力シグネチャ
上記の通り、LLM の入力出力インターフェースは単純明快です:*プロンプトを入力として提供し、出力を受け取ります*。このシンプルなインターフェースが、一般大衆による AI 採用に大きな役割を果たしました:*LLM は有用であり、直感的です*。このテキストからテキストへのインターフェースは、推論やツール使用などの様々な補助的動作を処理するように拡張することもでき、従来の LLM とエージェントの間のギャップは比較的狭くなります。特に、エージェントシステムは通常、以下の 3 つのコンポーネントで構成されます:
- 基盤となる LLM(または推論モデル)
- エージェントが使用するツール
- エージェントへの指示
LLM はシステムの脳として機能し、最終的な解決策に向けた進捗を判断し、そこに到達するために必要なステップを決定します。しかし多くの場合、正しい最終的な解決策に到達するには、LLM 単体だけでは不十分です。エージェントの期待される動作を明確に指定し、必要に応じてモデルがツールを呼び出したり複雑な推論を行ったりできるようにする必要があります。
ツール利用。外部環境と対話するためには、LLM は API や CLI、MCP サーバー などのツールを利用できる必要があります。例えば、ローカルのレストランでテーブルを予約するエージェントを作りたい場合、モデルに OpenTable API への呼び出しを作成する方法を教えるだけで済みます。具体的には、ツール呼び出しに関連する一連の特殊トークンを定義し、LLM にこれらのトークンの使い方を教えることで、ツール呼び出しは LLM のトークンストリーム内で自然に処理できます;以下参照。
例えば、Qwen3 モデルでは、ツール呼び出しはトークナイザー内に特殊トークンとして格納されたいくつかの XML スタイルタグを介して行われます:
- と は、ツール定義を囲むために使用されます。
- と は、呼び出すべきツールと関連するパラメータを含む特定の実行を囲むために使用されます。
- と 拶は、呼び出されたツールからの結果または応答を囲むために使用されます。
Qwen3 の指示テンプレートの構造は以下の通りです。利用可能なツールの定義とその呼び出し形式をシステムメッセージに定義し、モデルに対して *i)* 利用可能なツールを理解させ、*ii)* これらのツールに対する有効な呼び出しを構築するための必要な文脈を提供します。その後、モデルは出力生成時に と 拶 トークンを出力することでツール呼び出しを作成できます。推論時には、拶トークンが生成されるたびに生成を中断します。その後、リクエストを解析し、ツールを実行し、その結果を現在の出力に連結して生成を再開します。これにより、モデルは残りの出力を生成する際に、ツール呼び出しの結果をコンテキストとして保持することになります。
エージェントによって容易に理解され、正しく呼び出されるような有用なツールを作成することは芸術です。ツールは文書化が十分で明確な目的を持ち、他のツールとの重複を最小限に抑え、エラーから回復できる柔軟性を持つ必要があります。ツールが適切に設計されているかどうかを判断する最も簡単な方法は、自分自身に「提供されたドキュメントから、人間のエンジニアがこのツールを使用できるだろうか?」と問いかけることです。
ツール呼び出しは、エージェントシステム内で複数の目的を果たします。LLM はツールを使用して外部情報を取得し、ハルシネーションを軽減したり、環境内のタスクを完了させたり、コードを実行したり、他のエージェントを呼び出したりすることができます。必要なタスクに対して API が利用できない場合でも、computer-use primitives に頼ることで、エージェントがコンピュータ上の任意のアプリケーションに直接対話できるようにすることも可能です—*これは人間がコンピューターを使用するのと同様です*。
*「Computer use エージェントは、API やコード実行ではなく、スクリーンショット、マウスクリック、キーボード入力、スクロールなど、人間と同じインターフェースを通じてソフトウェアと対話します…各ツールには標準化された定義が必要であり、これによりツールとエージェントの間の柔軟な多対多の関係が可能になります。文書が整備され、徹底的にテストされ、再利用可能なツールは、発見可能性を高め、バージョン管理を簡素化し、重複する定義を防ぎます。」* — [1] より引用
LLM にツールを使用する方法を教えるには複数の方法があります—*in-context learning や finetuning など*—しかし、ツール呼び出しは LLM が学習できる他のスキルと何ら変わりありません。ツール呼び出し能力を測定するためのベンチマークさえ存在しており、そのパフォーマンスはさまざまな異なる指標を用いて評価されます:
- インボケーション精度は、LLM が呼び出すべき時にツールを正しく呼び出し、呼び出すべきでない時に呼び出さないかどうかを測定するものです。例えば、モデルが直接質問に答えるべき場面でツールを呼び出してしまう場合があります。
- セレクション精度は、LLM が正しいツールを呼び出したかどうかを測定するもので、通常、特定の課題を解決するために必要なツールのリストを含むグランドトゥルース(正解)の軌跡を追跡することで評価します。
- 構文精度とスキーマ妥当性は、ツール呼び出しの構造が正しいかどうかを測定するものです。例えば、モデルはツール呼び出しに誤った引数を含めたり、間違った呼び出し構造を提供したりしてはいけません。
- 軌道精度は、課題解決時にモデルが行った一連のツール呼び出しシーケンスを、何らかの方法でグランドトゥルースと比較するものです(例:正しい呼び出し順序、正しい選択、不要なツールの使用など)。
また、LLM が最終的に出力した答えが正しいかどうかという結果志向の評価も利用できます。これは、その答えを生み出すために使用されたツール自体よりも、最終的な回答の正しさに焦点を当てた評価手法です。
推論も、効果的なエージェントシステムを構築する私たちの能力において重要な役割を果たします。標準的な大規模言語モデル(LLM)をエージェントシステムの基盤モデルとして使用することも可能ですが、通常は推論機能を備えたモデルを使用することで恩恵を受けます。多段階のタスクを解決するためには、エージェントは困難な問題をより小さく単純な部分に分解し、それぞれの部分を解決する能力を持たなければなりません—*ツールの助けを借りて*—最終的な解決策に至るためです。さらに、モデルは問題解決中に自己反省を行い、自身のミスを回復できる必要があります。このように長期的な課題に対処するには、推論と信頼性のレベルが必要であり、これは推論モデルの登場によってようやく可能になったことです。
推論モデルが生成した思考トレース
プロンプトを与えられた際に出力を生成する標準的な大規模言語モデル(LLM)とは異なり、推論モデルは即座に回答を提供しません。その代わりに、最終的な回答の前に、長く—*通常は非表示の*—テキストによる推論経路1 を記述します;上記を参照してください。この思考プロセスは自然と 推論時のスケーリング法則 に適合します。モデルは、異なる長さの動的な推論を行うように教えられ得ます—*これは通常、推論トレース内のトークン数によって測定されます*。より長い推論トレースには、より多くの推論時の計算リソースが必要となります。なぜなら、より多くのトークンを生成しているためです。しかし、この計算への投資は通常、性能の向上をもたらします。*モデルがより長く推論に時間を費やすことを可能にすることで、より困難な問題を解決できるようになるのです*。詳細については、以下のリンク先にある推論モデルに関する長文の記事をご覧ください。
推論モデルと標準的な LLM は排他的である必要はありません。まもなく、複数の LLM やエージェントで構成され得るマルチエージェントシステムについて学ぶことになります。例えば、推論能力が重要な分野—*高レベルの計画やワークフロー管理など*—には推論モデルを使用し、より単純なサブタスクのためのツールとして標準的な LLM を公開するという使い方が可能です。
指示事項。 エージェントシステムの最終コンポーネントは、エージェントの指示です。これらの指示のコア部分は、ドメインの既存ドキュメント(例えば、注釈ガイドラインやポリシー文書)から引用できます。指示は可能な限り明確であるべきであり、明示的なルールや具体的な例を通じてエッジケースを明確にし、エージェントに期待される正確な行動を指定する必要があります。理想的には、指示は簡潔さと具体性のバランスを取るべきです。エージェントの行動を確実に導くのに十分な詳細さを持つ指示が必要ですが、過度に複雑なプロンプトは脆くなり、維持が困難になります。より良いエージェント用指示を作成するための支援として、モデル・イン・ザ・ループ(*または 自動プロンプトオプティマイザー*)アプローチを用いて、指示を反復してその明確性を向上させることができます。
*「エージェントは一度にあまりにも多くのことを実行しようとする傾向があり、本質的にアプリを一発で完了させようとしていました…これにより、実装の途中でモデルのコンテキストが不足し…その後、エージェントは何が起こったかを推測する必要が生じ、基本的なアプリを再び動作させるために多大な時間を費やすことになりました。」 - [4] より
エージェントへの指示には、解決すべき問題だけでなく、その問題を解決するための最良の戦略についても説明する必要があります。例えば、一度に大きすぎる問題を解決しようとしないよう、エージェントに対して問題をより小さな部分に分割するよう指示することができます。さらに、このプロセスにおけるエージェントの期待される行動を明確化することもできます。具体的には、ソリューションの各ステップが完全に機能する機能として実装されるようにすることや、将来のエージェントが参照できるように永続的なノートを作成すること、あるいはグローバルなToDoリストを維持することが挙げられます。
ReAct フレームワーク。完全なエージェントシステムは、これらすべてのコンポーネントを「while ループ」の中で結合します。これを*アジェンティック・ループ*と呼びます。このループ内では、エージェントは提供された指示に基づいて推論を行い、ツールを呼び出し、アクションを実行し続けます。これは、エージェンシーの終了条件に従ってターミナル状態に達するまで継続されます2。この時点で、エージェントはワークフローの制御を手放します—*人間ユーザーまたは他のエージェントのいずれかに*。この一連のプロセス全体が、アジェンティック・ループの単一の"run(実行)"とみなされます。
ReAct フレームワーク
アジェンティック・ループという考え方は単純ですが、このアイデアには多くの派生形が存在します。最も初期の派生形の1つが ReAct—*「RE」asoning と「ACT」ion の略称である*—フレームワーク [5] です。これはアジェンティック・ループに対して固定された構造を提案するものであり、上記を参照してください。
ReAct エージェントループは、一連の連続したステップに整理されています。各ステップにおいて、エージェントは環境の現在の状態を観察し、最適な次のステップについて推論を行い、その推論プロセスに基づいて何らかの行動を実行します。この反復的な問題解決フレームワークの具体的な例を以下に示します。
ReAct の重要な新機軸は、思考と行動の両方を強調している点にあります。エージェントループは、モデルが実行される各行動について明示的に推論し、ツール呼び出しからの観察や以前の思考といったすべての文脈を考慮して、取るべき正しい行動を決定するように構造化されています。簡単に言えば、推論と行動には相乗関係があります。詳細については、以下のリンク先にある ReAct の完全な概要およびエージェントフレームワークにおける他の一般的なパターンをご覧ください。
単一エージェントシステムは、関連するタスクを解決するための必要なツールを備えている場合、シンプルでありながら驚くほど強力です。複数のエージェントを調整することの複雑さのため、私たちはほぼ常に単一エージェント設計から始め、この基本的なセットアップを可能な限り最適化するべきです—*単一エージェントは評価と維持が容易であるためです*。エージェントの能力は、システムに追加でツールや条件付きロジックを段階的に追加することで拡張できます—*プロンプトテンプレート の形式または修正された指示として*。エージェントが良好に機能するためには、すべてのツールに対して明確な名前、説明、引数を提供し、タスクに対する期待される行動と結果を概説する詳細な指示を与えるべきです。
(from [13])
複数のエージェントが必要なのはいつか? 複数エージェントシステムは、協調的な方法でタスク実行を複数の専門化されたエージェントに分散します。例えば、上記の Claude の複数エージェントによる深層調査アーキテクチャ [13] を参照してください。複数エージェントシステムは困難なタスクのコンポーネントを論理的に分離するのに役立ちますが、その分複雑さも増します。このため、必要な場合にのみ複数エージェントシステムへ拡張すべきです。複数のエージェントを使用することが有益である可能性を示す一般的な兆候には以下が含まれます:
- シングルエージェントシステムの指示は冗長化しており、明確なロジックやテンプレート化が行われていても、エージェントが指示に従うのに苦労しています。
- 利用可能なツールが多すぎるため、エージェントが誤ったツールを選択してしまいます。
現代の LLM(大規模言語モデル)の推論能力により、多数のツールから適切に選択することが可能になっています。しかし、利用可能なツールのセットに類似したまたは重複する目的がある場合、問題が発生し、ツールの選択がより主観的になります。この問題をより明確なツール仕様で解決できない場合は、ツールを異なるエージェント間で分割することで、より正確で信頼性の高い選択が可能になります。
マルチエージェントシステムのタイプ。 マルチエージェントシステムを設計する方法は数多く存在します。しかし、実務において頻繁に現れるパターンとして 2 つが挙げられます:
- マネージャー設定:中央の「マネージャー」エージェントがツール呼び出しを通じて専門的なエージェントを調整し、各エージェントは特定のタスクまたはドメインを担当します。
- 分散型設定:複数のエージェントが互いに同等として動作し、それぞれの専門性に基づいてタスクを引き渡しながら連携します。
マネージャー設定では、タスクの実行は単一の中央集権的なエージェントによって制御されます。マネージャーエージェントは、問題解決戦略を策定し、作業の一部を専門的なエージェントに委任し、これらの結果を統合して最終的な解決策を導き出すことで、タスク解決のための「接着剤」として機能します。例えば、マルチエージェント翻訳システムでは、マネージャーエージェントが要求された言語ペアを特定し、各ペアを専用の翻訳エージェントへルーティングするために使用できます;以下に示す通りです。
マネージャー設定を備えた翻訳システム([3]より)
このようなマネージャー設定は、サブエージェントの概念に関連しています。タスクに関するすべての状態を単一のエージェント内に保持するのではなく、サブエージェントをトリガーしてタスクの一部を担当させることができます。この設定では、主要なエージェントがタスク解決のための高レベルな計画を調整し、ユーザーと対話を行う一方、サブエージェントは特定の技術的タスク(例:コードの探索や情報の取得)を実行し、関連するコンテキストを主要なエージェントに返します。サブエージェントを使用することで、主要なエージェントのコンテキストが過負荷になるのを防ぎ、システムの信頼性を向上させることができます。
分散型マルチエージェントシステムには、タスク実行を調整する集中型のエージェントは存在しません。代わりに、制御はピアとして動作する複数のエージェント間で受け渡されます。エージェントはツール呼び出しまたは関数呼び出しを通じて互いに制御を引き継ぎます。このような構成は、結果の統合やユーザーとの対話を中央のエージェントに依存する必要がない場合に最も効果的に機能します。分散型システムでは、必要に応じて複数の異なるエージェントが実行を制御し、ユーザーと相互作用することができます。例えば、まずエージェントで問題のトリアージを行い、その後その特定タイプの問題を解決するための専門的なエージェントへ制御を引き渡すような、エージェント型のサポートシステムを作成することが可能です(以下参照)。
原文を表示
Evaluation is one of the most important research areas for large language models (LLMs). Recently, patterns in LLM usage and evaluation have drastically changed. Whereas we previously evaluated LLMs using benchmarks composed of static questions or short conversations, we now have agent systems that operate over long time horizons and interact with the environment. Agents are difficult to properly evaluate due to their complexity and autonomy. To accurately measure the capabilities of an agent system, we must build harnesses that are realistic and capable of testing agents similarly to how they are used in practice. Building such evaluation capabilities is now more important than ever due to the growing adoption of agents in high-stakes applications like coding and medicine.
This overview will provide a detailed guide of how current agent systems are evaluated. We will begin by developing an understanding of agents in general, covering everything from basic concepts to multi-agent systems. We will then provide a clear framework for the agent evaluation process based upon common patterns observed in practice. Building upon this knowledge, we will end with several case studies of recent agent benchmarks and provide a roadmap that outlines how to build our own agent evaluation by applying similar concepts. Although evaluation is time-consuming and difficult, learning how to properly evaluate agents is incredibly valuable. By rigorously measuring performance and not relying on anecdotal checks, we can rapidly improve agent capabilities.
“LLMs are becoming increasingly capable of handling complex, multi-step tasks. Advances in reasoning, multimodality, and tool use have unlocked a new category of LLM-powered systems known as agents.” - from [3]
During the early days of the agentic era, the distinction between an agent and a normal LLM was unclear. After all, LLMs are at the core of all agent systems. Over time, the key characteristics of agent systems began to emerge:
- Reasoning
- Calling tools
- Solving complex, multi-step problems
- Recovering from errors
- Taking actions on behalf of a user
LLMs are capable of reasoning, tool calling, and problem solving, but agents are distinguished by their ability to combine these components within an agentic loop to solve difficult problems; see below. In fact, the simplest definition of an agent is an LLM that autonomously uses tools in a loop. Unlike conventional LLMs, agents must assess intermediate results and dynamically recover from their own errors to operate effectively within this agentic loop.
Given that agents reason over long time horizons and use tools, *they can also be characterized by their level of autonomy*. Conventional LLMs are often used for narrow, well-scoped tasks (e.g., classification or question answering) where the model produces an output but does not independently continue acting or have the ability to modify its environment. On the other hand, agents are usually allowed to control their own workflow over a period of time and can use tools to take actions autonomously (e.g., modify a calendar event or book a plane ticket).
As shown above, the input-output interface of an LLM is straightforward: *we provide a prompt as input and receive an output*. This simple interface played a large role in the adoption of AI by the general public: *LLMs are both useful and intuitive*. This text-to-text interface can also be extended to handle a variety of auxiliary behaviors like reasoning and tool use, making the gap between a conventional LLM and an agent relatively small. In particular, an agent system is typically composed of three components:
- The underlying LLM (or reasoning model)
- Tools for the agent to use
- Instructions for the agent
The LLM serves as the brain of the system, judging progress toward a final solution and deciding the steps that must be taken in order to get there. In many cases, however, arriving at a correct final solution requires more than just the LLM itself. We must clearly specify the agent’s expected behavior and enable the model to invoke tools or perform complex reasoning when necessary.
Tool use. In order to interact with the external environment, LLMs need to be able to use tools like APIs, CLIs, or MCP servers. For example, if we want our agent to reserve a table for us at a local restaurant, we can simply teach the model how to craft a call to the OpenTable API. Concretely, tool calls can be handled naturally within the LLM’s token stream by creating a set of special tokens related to tool calling and teaching the LLM how to use these tokens; see below.
For example, Qwen3 models handle tool calling via several XML-style tags that are stored as special tokens within the tokenizer:
- <tool> and </tool> are used to encapsulate tool definitions.
- <tool_call> and </tool_call> are used to encapsulate a specific tool call, including the tool to be invoked and associated parameters.
- <tool_response> and </tool_response> are used to encapsulate the result or response from the tool that is called.
The structure of the instruction template for Qwen3 is shown below. We define available tools and the expected format for calling them in the system message, which provides necessary context for the model to *i)* understand what tools are available and *ii)* construct valid calls to these tools. The model can then craft tool calls by outputting <tool_call> and </tool_call> tokens while generating output. At inference time, we interrupt generation whenever a </tool_call> token is generated. We can then parse the request, invoke the tool, concatenate the result to the current output, and restart generation. The model then has the result of the tool call in its context when generating the remaining output.
Creating useful tools that can be easily understood and correctly invoked by agents is an art. Tools should be well-documented, have a clear purpose, overlap minimally with other tools, and recover gracefully from errors. The easiest way to determine whether a tool is designed correctly is to simply ask yourself: *Would a human engineer be able to use this tool from the provided documentation?*
Tool calling serves multiple purposes within an agent system. The LLM can use tools to retrieve external information to help reduce hallucination, accomplish tasks within its environment, execute code, call other agents, and more. If there is no API available for a task that needs to be accomplished, we can even rely upon computer-use primitives to allow our agent to directly interact with arbitrary applications on a computer—*similarly to a human using a computer*.
*“Computer use agents interact with software through the same interface as humans—screenshots, mouse clicks, keyboard inputs, and scrolling—rather than through APIs or code execution… Each tool should have a standardized definition, enabling flexible, many-to-many relationships between tools and agents. Well-documented, thoroughly tested, and reusable tools improve discoverability, simplify version management, and prevent redundant definitions.”* - from [1]
We can teach an LLM to use tools in multiple ways—*such as through in-context learning or finetuning*—but tool calling is no different than any other skill that an LLM could learn. There are even entire benchmarks for measuring tool calling capabilities, where performance is measured using a variety of different metrics:
- Invocation accuracy measures whether the LLM correctly decided to call a tool when it should, or avoided calling one when it should not. For example, the model may call a tool when it should answer the question directly.
- Selection accuracy measures whether the LLM called the correct tools, usually by keeping track of a ground truth trajectory that includes a list of necessary tools for solving a particular problem.
- Structural accuracy and schema validity measure whether the structure of a tool call is correct. For example, our model should not include wrong arguments in a tool call or provide an incorrect call structure.
- Trajectory accuracy looks at the sequence of tool calls made by the model when solving a problem and compares them to ground truth in some way (e.g., correct call order, correct selection, using unnecessary tools, and more).
We can also use outcome-oriented evaluation by focusing on whether the LLM’s final answer is correct instead of the tools it uses to produce an answer.
Reasoning also plays a key role in our ability to build effective agent systems. Although we can use a standard LLM as the underlying model for an agent system, we usually benefit from using a model that has reasoning capabilities. To solve multi-step tasks, an agent must be able to decompose difficult problems into smaller, simpler parts and solve each of those parts—*possibly with the help of tools*—to arrive at a final solution. Additionally, the model must be able to self-reflect and recover from its own mistakes while solving problems. Handling long-horizon problems in this way requires a level of reasoning and reliability that has only recently become possible with the advent of reasoning models.
Unlike a standard LLM that produces output given a prompt, reasoning models do not immediately provide an answer. Instead, they write a long—*usually hidden*—textual reasoning trajectory1 prior to their final answer; see above. This thinking process naturally lends itself to inference-time scaling laws. The model can be taught to dynamically reason for different lengths—*often measured by the number of tokens in the reasoning trace*. Longer reasoning traces require more inference-time compute, as we are generating a larger number of tokens. However, this compute investment usually leads to improved performance, *allowing harder problems to be solved by allowing the model to spend more time reasoning*. For more details, please see the long-form writeup on reasoning models linked below.
Reasoning models and standard LLMs do not have to be mutually exclusive. We will soon learn about multi-agent systems that can be composed of multiple LLMs or agents. For example, we could use reasoning models for high-level planning and workflow management—*areas where reasoning capabilities are important—*while exposing a standard LLM as a tool for simpler subtasks.
Instructions. The final component of an agent system is the agent’s instructions. The core of these instructions can be taken from existing documentation for the domain (e.g., annotation guidelines or policy documents). Instructions should be as clear as possible, clarify edge cases via explicit rules or concrete examples, and specify the exact actions expected of the agent. Ideally, instructions should strike a balance between simplicity and specificity. We want instructions to be detailed enough to reliably guide agent behavior, but prompts that are overly complex become brittle and difficult to maintain. To help with writing better instructions for an agent, we can use a model-in-the-loop approach—*or an automatic prompt optimizer*—to iterate upon the instructions and improve their clarity.
“The agent tended to try to do too much at once—essentially to attempt to one-shot the app… this led to the model running out of context in the middle of its implementation… the agent would then have to guess at what had happened, and spend substantial time trying to get the basic app working again.” - from [4]
Instructions for an agent should explain not only the problem being solved, but also the best strategy for solving the problem. For example, we can instruct the agent to break a problem into smaller parts to avoid trying to solve a problem that is too large in a single shot. Additionally, we can further clarify the expected behaviors of the agent in this process, such as ensuring every step of a solution is implemented as a fully functional feature, writing persistent notes that can be used as a reference by future agents, or maintaining a global to-do list.
ReAct framework. A full agent system combines all of these components together in a while loop: *this is called an agentic loop*. In this loop, the agent will reason, call tools, and take actions based on the provided instructions until a terminal state has been reached according to the exit conditions for the agent2. At this point, the agent will relinquish control of the workflow—*either to a human user or another agent*. This entire process is considered a single “run” of the agentic loop.
The idea of an agentic loop is simple, but many variants of this idea exist. One of the earliest variants is the ReAct—*short for REasoning and ACTion—*framework [5], which proposes a fixed structure for the agentic loop; see above.
The ReAct agentic loop is organized into a set of sequential steps. At each step, our agent observes the current state of the environment, reasons about the best next steps, and takes some action based upon its reasoning process. A concrete example of this iterative problem-solving framework is provided below.
The key novelty of ReAct is its emphasis on both thinking and action. The agentic loop is structured such that the model explicitly reasons through each action that is taken and considers all context—*such as observations from tool calls or prior thoughts*—when deciding the correct action to take. Put simply, reasoning and action have a symbiotic relationship. For more details, see the full overview of ReAct and other common patterns in agentic frameworks linked below.
Single-agent systems are simple and incredibly powerful when equipped with the necessary tools for solving relevant tasks. Due to the complexity of orchestrating multiple agents, we should almost always start with a single-agent design and optimize this basic setup as much as possible—*single agents are easier to evaluate and maintain*. We can expand the agent’s capabilities by incrementally adding more tools and conditional logic—*in the form of prompt templates or modified instructions*—to the system. For the agent to perform well, we should provide clear names, descriptions, and arguments for all tools, as well as detailed instructions that outline the expected actions and outcomes for a task.
When are multiple agents needed? Multi-agent systems distribute task execution across multiple specialized agents in a coordinated fashion; e.g., see Claude’s multi-agent deep research architecture depicted above [13]. Multi-agent systems help logically separate components of a difficult task, but they are also more complex. For this reason, we should expand to multi-agent systems only when necessary. Common signs that using multiple agents may be helpful include:
- Instructions for the single-agent system are bloated, and the agent is struggling to follow instructions even with clear logic or templating.
- Tools are being selected incorrectly by the agent because there are too many available tools.
The reasoning capabilities of modern LLMs make it possible to properly select tools even from a large set. Issues arise when the set of tools that are available have similar or overlapping purposes, making tool selection more subjective. If this problem cannot be solved with cleaner tool specifications, splitting tools across distinct agents can lead to more accurate and reliable selection.
Types of multi-agent systems. There are many ways that one could design a multi-agent system. However, two patterns arise frequently in practice:
- Manager setup: a central “manager” agent orchestrates specialized agents via tool calls, where each agent handles a specific task or domain.
- Decentralized setup: multiple agents operate as peers by handing off tasks to one another based on their respective specializations.
In the manager setup, task execution is controlled by a single, centralized agent. The manager agent acts as the “glue” for solving a task by developing a problem-solving strategy, delegating parts of the work to specialized agents, and deriving a final solution by synthesizing these results. For example, a multi-agent translation system could use a manager agent to identify the requested language pairs and route each pair to a specialized translation agent; see below.
Such a manager setup is related to the concept of a sub-agent. Rather than keeping all state for a task within a single agent, we can trigger a sub-agent to handle task components. In this setup, our main agent coordinates the high-level plan for solving a task and interacts with the user, while sub-agents perform specific technical tasks (e.g., exploring code or retrieving information) and return relevant context to the main agent. Using sub-agents can help improve system reliability by preventing the main agent’s context from being overloaded.
Decentralized multi-agent systems have no centralized agent to orchestrate task execution. Instead, control is passed among multiple agents that operate as peers. Agents pass control to one another via tool or function calls. Such a setup works best when we do not need a central agent to synthesize results or interact with the user. In a decentralized system, multiple different agents can control execution and interact with the user as needed. For example, we can create an agentic support system that first uses an agent to triage the issue, then passes control to a specialized agent to solve that particular type of issue; see below.
<img src="https://substackcdn.com/image/fetch/$s_!WEjd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み