エージェントの改善はデータマイニングの問題である
LangChain は、AI エージェントの性能向上においてアルゴリズムの改良よりも、高品質なデータの収集と分析というデータマイニングアプローチが本質的に重要であると主張している。
キーポイント
データ中心のアプローチの転換
エージェントの能力向上には複雑なアルゴリズムの変更よりも、入力・出力データの品質と分析が鍵となるというパラダイムシフトを提唱している。
データマイニングの重要性
失敗事例や成功事例からパターンを抽出する「データマイニング」プロセスこそが、エージェントのロジック改善と信頼性向上に直結すると指摘している。
実装への示唆
開発者はアルゴリズムの微調整よりも、ドメイン固有の高品質データセットを構築・分析するインフラ整備にリソースを割くべきであると結論付けている。
影響分析・編集コメントを表示
影響分析
本記事は、AI エージェント開発における「モデルやアルゴリズム中心主義」からの脱却を促し、データ駆動型アプローチの重要性を再認識させる重要な示唆を与えている。業界全体がデータ収集と分析基盤への投資を加速させる契機となり、より信頼性の高い自律型システムの構築に向けた道筋を示すものである。
編集コメント
アルゴリズムの複雑化に走る昨今の潮流に対し、根本的なデータ品質への回帰を説く本記事は、実務家にとって非常に示唆に富んでいます。特にエージェント開発において「何を食べさせるか」が「どう動かすか」以上に重要であるという視点は、今後の開発戦略を見直すきっかけとなるでしょう。
Key Takeaways
• トレーシングデータをマイニングすることで、ヒルクライムを行うためのシグナルを得られます
• オープンモデルのファインチューニングと複合エージェントシステムは、大規模なトレーシングデータを処理するために役立ちます
• 継続的学習(Continual Learning)とは、長期的な時間軸においてエージェントデータを処理し、再びエージェントに統合することです
• エージェントは人類が歴史上残してきたデータ量よりも多くのデータを生成します。これを処理するためのツールを更新する必要があります。
継続的学習、ハーネスエンジニアリング、ポストトレーニングはいずれも同じ基盤に帰着します:大規模なデータのキュレーションを行い、実験を実行してエージェントを改善することです。私は今年開催された AI Engineer World Fair でこれについて講演を行いました。素晴らしいものを創造してくださった @swyx さんに感謝します!
私たちは、トレーシングデータからのマイニングが、自社のエージェントを理解し、大規模なデータのキュレーションを行い、改善ループを実行するために企業が構築できる最もレバレッジの高い能力の一つである理由について議論しました。
以下は、私が共有したスライドの簡単なウォークスルーで、いくつかのコメンタリーと(半ば)刺激的な見解を添えています。
すべての継続的学習企業は可観測性企業である
温かいとは言い難い見解から始めましょう:すべての継続的学習企業は可観測性企業であり、その逆もまた真です!継続的学習を行うチームのワークフローを見ると、最初に目にするのは何らかの形でトレーシングデータを共有するメッセージです。

継続学習とは、エージェントが環境内で行動を行い、その経験から得られた情報をエージェントシステムに統合するプロセスです。これは、人間が環境内で行動を起こし、何らかの学習や記憶、保存をトリガーして後で利用するという学習様式とほぼ同様に機能します。
そのため、長期にわたるエージェントの改善における通貨となるのは「トレース(Traces)」です。これらは、環境内でのエージェントの経験を、理解するためにデータマイニング可能な形式へと投影したものです。
現在では、すべての情報をどのように統合して戻すべきかについては明確ではありませんが、おそらく以下の組み合わせになるでしょう:
- SFT(Supervised Fine-Tuning: 教師あり微調整)や RL(Reinforcement Learning: 強化学習)などを通じてモデルの重みに統合するためのトレーニングデータの収集
- インストラクション、ツール、スキル、オーケストレーション戦略などを追加するためのハッキングエンジニアリング
- コンテキスト検索のために情報をメモリストアに統合する
このプロセスを大規模なデータ量と長期の時間軸でどのように行うかを説明する際に、「スケーリング・ドリーミング(Scaling Dreaming)」という用語は非常に適切な表現です。

エージェント改善のための実践的なレシピ
この講演は、チームが今日からエージェントの改善を開始できるようにするための実践的なレシピを動機づけることに主に焦点を当てていました。

データ収集のフライングホイールを起動することは、チームが行える最も価値のあることの 1 つです!つまり、ある程度まともなバージョンのエージェントを構築して、それを世に送り出すことです。そこから改善は以下から生まれます:
- 何を改善すべきかを見るためにデータをマイニングする
- 乗せるための評価(つまりトレーニングデータ)をキュレーションする
- 自分が関心のある軸に沿ってエージェントを改善するための実験を実行する
スケールでのトレースによるエージェントの理解
エージェントの振る舞いは、従来のコードよりも不透明です。単にエージェント定義を読むだけでは、エージェントが具体的に何をするか正確にはわかりません。私たちは決定論性を自律性と交換し、その理解のギャップを埋めるためにトレースを使用します。

スケールで評価を実行し、トレースを読み取ることで、私たちが与えたタスクに対してエージェントがどのように振る舞う可能性が高いかについての定量的な指標と直観を構築できます。
トレースは、エージェントの振る舞いを理解し、改善することを可能にします。しかし、現代のエージェントはますます複雑になり、より多くの作業を行い、これまでに見たこともないほど大量のデータを生成しています。数百万ものトレースを読み、その多くが数百万トークン長である場合:
- 膨大なトークンを処理するためのコストの問題
- 重要なシグナルを見つけるためにトレースを検索するためのコンテキストの問題
これが、スケールでのトレースから効率的にデータを理解しキュレーションするために、専用のエージェントとモデルを作成する理由です。

トレースを理解するためのシステム構築
オープンモデルは知能の閾値を超え、大規模なトレース処理においてコスト効率の高い選択肢となっています。各企業は自社のトレースから異なるシグナルを探しています。これにはユーザーインタラクションにおける微妙なニュアンス、ドメイン固有のデータ、そしてどのデータのサブセクションが重要かを曖昧さを解消する能力が含まれます。私たちは Trace judge モデルをファインチューニングしました(Trace judge: トレース評価モデル)ことで、トレーシングプロジェクト全体にわたってシグナルをマイニングし、狭いタスクにおいてはオープンで小規模なモデルがクローズドな最前線モデルを上回る性能を発揮しつつ、実行コストは桁違いに安価であることを発見しました。
自社でモデル知能を所有しデプロイするもう一つの利点は、トークンコストとインフラストラクチャコストのトレードオフを行うことで、大規模運用時の実行コストが大幅に抑えられることです。推論量が十分に高いレベルであれば、このトレードオフは多くのチームにとって合理的な選択となります。

私たちはトレースのマイニングが重要だと考えているため、それを核とした製品を構築しました。LangSmith Engine は、専門的なエージェントを用いてすべてのトレースを読み込み、チームが関心を持つ特定のシグナルを探し出し、問題点を特定し、コードの修正を作成し、評価(evals)を生成し、重要な情報をメモリおよびコンテキストストアに記録し、時間とともにあらゆるエージェントの改善に取り組んでいます。
こちらで、Engine の構築と評価についてどのように考えているかについて詳しく解説しています。
モデル・タスク・ハネスの適合性、評価(evals)、およびエージェントの適合方法
トレースマイニングの結果は、改善ループ実験の実行における入力となります。「良い」トレースをマイニングすることで、よりコスト効率の高い小規模モデルを抽出するためのシグナルが得られます。本番環境でのすべてのエージェントの失敗は、評価と環境を作成できるターゲットとなります。

評価(evals)は、エージェントのトレーニングデータです。
評価の目的は、それを合格させることにあり、その結果、トレースで測定した同じ振る舞いが、ヒルクライム法によって最適化する過程でエージェントの振る舞いとして転移されます。
一般的に私たちの役割は次の通りです:
- 良質なデータを見つける
- 適切な適合関数を見つける
データを収集した後、私たちの仕事は学習システムをそのデータに適合させることです。"古典的 ML"が sci-kit-learn の適合関数を持っていたのと同様に、現代のエージェントには、ファインチューニング(SFT, RL, DPO)や、評価スコアをヒルクライミング指標として用いたハッチングにおける自動研究などの戦略を持つ「Harness Engineering」といった適合戦略があります。

ここで目指しているのは、知能の源泉としてのモデルから逆算して作業を行い、一連のタスクにおけるパフォーマンスを最適化するために、モデルとハッチングに対する最適な変更点を見つけることです。ハッチングはネイティブなモデル知能を増幅・拡張するものであり、モデルが賢くなるにつれて、多くの部分が溶解し、モデルが自由にその知能を活用できるようになります。
適合関数の例として、環境や評価に基づいてエージェントを改善するための一般的な戦略としてループと自動研究を見つけました。Terminal Bench 2.0において、単純にハッチングを調整し、ヒルクライミングによる正答率指標やトレースを用いて行動を理解させることで、ベースラインのハッチングに対して大幅な 13.7% の向上をもたらすことがわかりました。

トレースは、単純なスカラー報酬を超えて広範に探索するために、エージェントに豊かな行動フィードバックを与えることでフィードバック信号を濃密化します。
私たちはよくこの質問を受けます:「ハルネスエンジニアリングとファインチューニングのどちらをいつ行うべきか?」機械学習における多くの質問と同様に…それは状況によります。しかし、私たちが非常に成功していると感じる一般的な戦略は、ハルネスエンジニアリング → ファインチューニング → ハルネスエンジニアリングという漏斗(またはサンドイッチ)構造です。

ハルネスエンジニアリングは、多くのチームにとって十分です。チームは即座にフィードバックを得られ、エラーに関する知識や観察をエージェントへ転送するための非常に高帯域幅の表面へのアクセスを得られます。モデルは世代ごとに賢くなり、それとともにコンテキスト内学習(in-context learning)を行う能力も成長します。適切なコンテキスト、ツール表面、プロンプトの準備に注意を払うチームは、多くの場合、タスクに対して十分なパフォーマンスを実現できます。
しかし、最終的にはハルネスエンジニアリングは知能の天井に達し、単にプロンプトを微調整するだけではさらなる向上が得られなくなります。これらのケースや、情報をより小さなモデルへ蒸留(distillation)したい場合のような高推論負荷のケースでは、ファインチューニングが理にかなっています。これはより複雑で、データのキュレーションと長いフィードバックループにおける実験を必要としますが、タスク指向にモデルの知能を再構築することは、パフォーマンスを向上させる効果的な方法です。
そして最後に、微調整済みモデルに満足したら、その微調整済みモデルをタスク全体で使用しながら、新しい知能の風景が関連する問題にどのように一般化するかを確認するために、さらにエンジニアリングを活用することが良い手段となります。チームに一つだけレシピを推薦するなら、それは急速な反復とより複雑な適合関数への段階的な露出との最適なバランスを得るためのこのレシピです。
学びのポイント
エージェントの改善、継続的学習、環境/評価などという広大な風景を、単一の講演やスライドセットに要約するのは困難です。しかし、本講演と記事の目的は、チームに対して今後数年間でエージェントの改善における鍵となるドライバーがデータである理由を動機づける、実践的な出発点を提供することでした。
いくつかの簡潔な学びのポイント:
- トレースのマイニングにより、ヒルクライムを行うためのシグナルが得られる
- オープンモデルの微調整と複合型エージェントシステムは、大規模なトレースデータを処理するのに役立つ
- 継続的学習とは、長期的な時間軸においてエージェントのデータを処理し、再びエージェントに統合することである
- エージェントは人類史上の人間よりも多くのデータを生成する。それを処理するためにツールを更新する必要がある
LangChain Labs の研究チームはこれらの問題に取り組んでおり、すべてのチームが自社のデータを活用してより良いエージェントを構築できるよう支援しています。より良いデータへ、より深い理解へ、そしてより良いエージェントへ。
原文を表示
Key Takeaways
• Mining traces gives you signals to hill climb on
• Open model fine-tuning & compound agent systems help you process large scale trace data
• Continual Learning is about processing & integrating agent data back into agents over long time horizons
• Agents will produce more data than humans have in history. We need to update our tooling to process it.
Continual Learning, Harness Engineering, Post-Training all boil down to the same substrate: curating data at scale to run experiments & improve agents. I gave a talk about this at this year’s AI Engineer World Fair, shoutout @swyx for creating something amazing!
We talked about why data mining from Traces is one of the highest leverage muscles companies can build to understand their agents, curate data at scale, & then run improvement loops.
Here’s a brief walking through of the slides I shared with some commentary and (semi-)spicy takes from the talk.
Every Continual Learning Company is an Observability Company
Let’s warm up with a lukewarm take: Every Continual Learning Company is an Observability Company…and vice versa! When we look at the workflows of teams that do Continual Learning, the first thing we see is some sort of message to share traces.

Continual Learning is about agents taking actions in their environment and then integrating information produced from that experience back into the agent system. This roughly mirrors how humans learn by taking actions in their environment, triggering some sort of learning, memorization, or storage to use later.
This is why Traces are the currency of long horizon agent improvement. They’re projections of agent experience in environments into a data format we can mine to understand.
Today it’s unclear exactly how to integrate back all of the information, but it likely will be a mix of:
- collecting training data to integrate into back into model weights via SFT, RL, etc
- harness engineering to add instructions, tools, skills, orchestration strategies, etc
- integrating information into memory stores for contextual retrieval
The term Scaling Dreaming is a nice way to describe how to do this at large data scales over long time-horizons

A Practical Recipe for Agent Improvement
This talk was largely centered around motivating a practical recipe so teams can start improving their agents today.

Kickstarting the data collection flywheel is one of the most valuable things teams can do! And that means building some decent version of the agent and getting it out there. From there improvement comes from:
- mining data to see what to improve
- curating evals (ie. training data) to fit on
- running experiments to improve your agent along some axis you care about
Understanding Agents via Traces at Scale
Agents behavior is more opaque than traditional code. We don’t know exactly what agent will do from just reading their agent definition. We trade determinism for autonomy and then use Traces to fill the understanding gap.

By running evals and reading traces at scale, we can develop a quantitative measure + intuition for how agents are likely to behave on tasks we give them.
Traces allow us to understand and then improve agent behavior. But modern agents are becoming much more complex, do much more work, and thus produce much more data than we’ve ever seen before. Reading millions of traces where many traces are millions of tokens long is:
- A cost problem for processing that many tokens
- A context problem for searching through traces to find important signals
This is why we create specialized agents and models to efficiently understand and curate data from Traces at Scale.

Building Systems to Understand Traces
Open models have crossed an intelligence threshold and are cost-efficient options for processing traces at scale. Every company looks for different signals in their traces. This includes nuances in user interactions, domain specific data, and an ability to disambiguate between which sub-sections of data matter. We fine-tuned a Trace judge model to mine signals across our tracing project and find that on narrow tasks, open, small models outperform closed frontier models while being orders of magnitude cheaper to run.
Another benefit of owning and deploying your own model intelligence is that it can be much cheaper to run at scale as you trade token costs for infrastructure costs. At high enough inference volumes this tradeoff makes sense for many teams.

We think that mining traces is important, so we built a product around it. LangSmith Engine uses specialized agents to read every trace, look for particular signals your team cares about, finds issues, creates code fixes, generates evals, commits important pieces of information to memory+context stores, and works to improve every agent over time.
Here’s a deep dive into how we think about building and evaluating Engine.
Model-Task-Harness Fit, Evals, & How to Fit Agents
The outputs of Trace Mining become inputs become the inputs of running improvement loop experiments. Mining “good” traces gives us a signal to distill smaller models which gives greater cost efficiency. Every agent failure in production becomes a target we can create eval and environment for.

Evals are training data for agents.
The point of evals is to make them pass and thus the same behaviors we measure in traces get transferred into agent behavior as we hill-climb them.
Generally our job is to:
- Find good data
- Find good fit functions
Once we’ve collected data, our job is to fit our learning system to that data. In the same way “classical ML” had sci-kit-learn fit functions, modern day agents have fitting strategies like fine-tuning (SFT, RL, DPO) or Harness Engineering with strategies like auto-research on the harness using eval scores as the hill-climbing metric.

The idea here is to work backwards from the model as a source of intelligence and finding optimal alterations to the model and harness to optimize performance on a set of tasks. Harnesses are amplifiers and extenders of native model intelligence and as models get smarter much of the harness will dissolve to allow models to freely use their intelligence.
For an example of a fit function, we founds loops and auto-research as a general strategy for improving agents grounded in environments and evals. On Terminal Bench 2.0, we found that simply adjusting the harness by hill-climbing correctness metrics & traces to understand behavior gave us a big 13.7% lift over the base harness.

Traces densify the feedback signal by giving agents rich behavior feedback to search across beyond simple scalar rewards.
We get this question a lot: “when should I do harness engineering vs. fine-tuning?” Like most questions in machine learning…it depends. But a general strategy we've seen be very successful is a funnel (or a sandwich) of Harness Engineering -> Fine-Tuning -> Harness Engineering.

Harness Engineering is often enough for most teams. Teams get immediate feedback and get access to a very high-bandwidth surface for transferring their knowledge and observations of errors into their agent. Models get smarter every generation and with that grows their ability to do in-context learning. Teams that take care in preparing good context, tool surfaces, and prompts can very often get good enough performance for their tasks.
But eventually harness engineering hits an intelligence ceiling where simply tweaking the prompt doesn’t create more gains. For both these cases or cases of high inference workloads where you want to distill information to smaller models, fine-tuning makes sense. It’s more involved, requires curating data and doing experiments over longer feedback loops. But reshaping model intelligence towards your tasks is an effective way to increase performance.
And finally once you’re happy with a fine-tuned model, further harness engineering is a good avenue to see how the new intelligence landscapes generalizes to related problems as you use the fine-tuned model across your tasks. If I had to recommend teams one recipe, it would be this one for getting the best tradeoff of rapid iteration and progressive exposure to more complicated fit functions.
Takeaways
It’s difficult to distill the vast landscape of agent improvement, Continual Learning, Environments/Evals, and more into a single talk and set of slides. But the goal of this talk and write-up was to give teams a practical jumping off point that motivates why data will be the key driver of agent improvement in the years to come.
Some brief takeaways:
- Mining traces gives you signals to hill climb on
- Open model fine-tuning & compound agent systems help you process large scale trace data
- Continual Learning is about processing & integrating agent data back into agents over long time horizons
- Agents will produce more data than humans have in history. We need to update our tooling to process it.
Our research team at LangChain Labs is focusing on these problems and helping every team use their data to build better agents. To better data, better understanding, and better agents.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み