AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
GitHub Blog·2026年6月18日 04:41·約12分で読める

各トークンからより多くを引き出す:Copilot のコンテキスト処理とモデルルーティングの改善方法

#LLM#Prompt Engineering#Agentic Workflow#GitHub Copilot#Model Routing
TL;DR

GitHub Copilot は、プロンプトキャッシングとオンデマンドツール検索によるコンテキスト効率化、およびタスクに応じた自動モデル選択機能(Auto)の強化を通じて、長期間にわたるエージェントワークにおけるトークン使用効率と推論能力を大幅に向上させた。

AI深層分析2026年6月18日 05:03
4
重要/ 5段階
深度40%
5
関連度30%
5
実用性20%
4
革新性10%
3

キーポイント

1

プロンプトキャッシングとツール検索の導入

反復されるコンテキスト情報をキャッシュし、不要なツール定義を送信しないことで、トークンコストと遅延を削減する技術が実装された。

2

オンデマンド型ツール定義ロード

セッション全体で全ツールのスキーマを送信するのではなく、必要な際にのみツール定義を読み込むことで、複雑なエージェントワークのオーバーヘッドを軽減した。

3

タスク別自動モデル選択(Auto)

開発者が手動で設定しなくても、タスクの意図と現在のモデル状態に基づき、簡単な説明から複雑な多ファイル変更まで最適なモデルを自動的に選定する機能。

4

エージェントワークへの最適化

計画、編集、デバッグ、ツール呼び出しなど、長時間にわたるセッションにおける効率性を重視し、トークン使用の知能化を図った。

5

タスクとシステム状態に基づく動的ルーティング

Auto は「モデルの健全性」と「タスクの複雑さ(HyDRA)」という2つの信号を組み合わせ、最も適したモデルを選択します。

6

キャッシュ効率を考慮した自然な境界での切り替え

会話中の頻繁なモデル切替によるキャッシュ破損を防ぐため、最初のターンや要約後のみルーティングを行い、それ以外は同一モデルを維持します。

7

多言語対応とルーティング精度

16の言語ファミリーを対象にトレーニングされたルーティングモデルは、英語ベースラインに対し4ポイント以内の精度を維持し、言語による品質格差はない。

影響分析・編集コメントを表示

影響分析

この発表は、AI エージェントが実務で長時間稼働する際のボトルネックであるトークンコストとコンテキスト管理の課題を解決する重要なステップです。特に「Auto」機能による自動モデル選定は、開発者の運用負荷を下げつつ、タスクの複雑さに応じた最適な推論能力を提供することで、Copilot の実用性と信頼性をさらに高めるでしょう。

編集コメント

トークンコストの最適化と自動モデル選定は、AI エージェントが本格的に業務フローに組み込まれるための必須要件であり、実用性の飛躍的な向上が期待されます。

Copilot が計画や編集、デバッグ、レビュー、より長いセッションにわたるツール呼び出しなど、より多くのエージェントワークを引き受けるにつれ、効率化とは単にトークン数を減らすことだけではありません。それは、トークンをどのように使うかについて賢明になることを意味します。

効率性の向上は、ターンからターンへと Copilot が繰り返す必要があるもの(コンテキスト、ツール定義、キャッシュされた状態など)を削減することから始まります。そして、作業に適したモデルを選択することも含まれます。簡単な説明、焦点を絞った編集、複雑な複数ファイルの変更は、すべて同じ方法で扱うべきではありません。

私たちはこの両方に取り組んでいます:各セッションのより多くの部分がタスク自体に費やされるように Copilot ハーネス(基盤)を改善することと、開発者が毎回モデル選択を行う必要なく Copilot が作業に適したモデルを選べるように Auto を拡張することです。本稿では、VS Code 用の GitHub Copilot におけるハーネスの改善点と、Copilot の各機能領域にわたる Auto の拡充に向けた継続的な取り組みについて焦点を当てます。

プロンプトキャッシングの強化とツールの遅延ロード

VS Code でのより長い GitHub Copilot セッションでは、モデルのために多くの反復情報をハーネスが準備します:指示、リポジトリコンテキスト、会話履歴、利用可能なツール、およびタスクの現在の状態です。その一部は必要ですが、一部はキャッシュしたり、遅延させたり、関連性が高まったときにのみ読み込んだりできます。

⟦CODE_0⟧

VS Code 用の GitHub Copilot では、主に 2 つの改善が行われています。プロンプトキャッシングは、Copilot が繰り返し現れるプロンププの接頭辞に対してモデルの状態を再利用し、毎回同じ接頭辞を再計算するのではなく効率的に処理できるようにします。ツール検索機能では、モデルが必要な時にのみツールの定義を読み込み、各ターンで完全なツールスキーマをすべてコンテキストに送信する必要がなくなります。

これはエージェントがより多くのツールを使用するようになると、特に重要になります。セッションには MCP ツール、ターミナルコマンド、ファイル操作、ワークスペース検索、製品固有のアクションへのアクセスが必要になる場合があります。すべてのツールの完全な定義を事前に読み込むと、タスクに関連するツールが少数であっても、各ターンに固定コストが発生してしまいます。ツール検索機能を使えば、Copilot は利用可能なツールセットを広範囲に保ちつつ、モデルに送信する不要なツールスキーマを減らすことができます。

実装の詳細、プロンプトキャッシング、キャッシュ制御のブレークポイント、プロバイダー固有のツール検索、そしてこれらの変更が長時間実行されるエージェントセッションでどのように機能するかについて、より技術的な解説は VS Code の技術的深掘り記事をご覧ください。

GitHub Copilot の自動モデル選択の位置づけ

Auto は実用的な質問に答えます:「今このタスクにはどのモデルが最も適しているか?」

最初のプロンプトの後、Copilot はタスクの意図と現在のモデルの状態に基づいて、そのタスクに最適なモデルを選択します。クイックな説明、集中的な編集、複数ファイルの変更など、異なる種類の作業はすべて同じレベルの推論を必要とするわけではありません。Auto は、ユーザーがモデル設定を手動で調整する必要なく、最適な選択を行います。

評価において、単一のモデルがすべてのタスクで一貫して最良の性能を発揮することはありませんでした。多くの場合、より効率的なモデルが同じ結果を達成しており、強力なモデルが最も重要となるのは、深い推論が必要なタスクの場合です。Auto は、どこで強い推論が結果を改善するかを学習します。タスクに要求される場合は上流へルーティングし、必要ない場合はより効率的な状態を維持します。目標は品質とコストのトレードオフを行うことではなく、作業に最も適したモデルを使用することです。

どのようにして Auto が適切なモデルを選択するか

Auto は 2 つのシグナルを組み合わせています:現在健全で利用可能なモデルが何か、そして Copilot にどのような作業を依頼されているかという点です。

リアルタイムのモデルヘルス:動的エンジンがモデルの利用可能性、利用率、速度、エラー率、コストを追跡します。あるモデルがタスクを処理する能力を持っていても、それがその瞬間に最良の選択肢であるとは限りません。Auto は現在のシステム状況を考慮し、Copilot が能力がありかつ応答準備ができているモデルへルーティングできるようにしています。

HyDRA を用いたタスク認識型ルーティング:推論深度、コードの複雑さ、デバッグの難易度、ツールオーケストレーションの必要性などの要因を考慮するルーティングモデルです。HyDRA はタスクの品質基準を満たすことができるモデルを特定し、その中から最も適したモデルを選択します。

imageimage図 1:3 つの HyDRA 動作点は調整可能性を示しています。(ピーク)は Sonnet を上回り 12.9% の節約を実現し、(アグリゲート)は品質をバランスさせながら 72.5% の節約を実現します。

図 2:HyDRA (Cons.) は、OpenRouter Auto と解決率(70.8%)で同点となりながら、コストは約 3.3 倍節約しています。HyDRA (Agg.) は Azure Foundry の両方の運用モードを上回っています。

これらのシグナルを総合的に活用することで、Auto は「一つの方法が全てに通用する」というアプローチを回避できます。重要なのは、すべてのタスクを最大規模のモデルへ送るでも、すべてのタスクを最安値のモデルへ送るでもありません。それは、作業内容に適したモデルを選択することです。

実務における Auto の活用

評価においてルーティングを正しく行うことは問題の一部に過ぎません。Auto を実際のワークフローで有用なものとするためには、開発者が実際に Copilot をどのように使用するかにも対応する必要があります。会話の長さが伸び、コンテキストが蓄積し、タスクが変化し、開発者は多言語で作業を行います。

キャッシュを考慮したルーティング。ターンごとにモデルを切り替えることは柔軟に見えるかもしれませんが、効率性を損なう可能性があります。会話が同じモデルに留まる場合、プロンプトのプレフィックス(先頭部分)をキャッシュしてターン間で再利用できます。会話中にモデルを切り替えるとこのキャッシュが破棄され、ルーティングの変更で得られる節約分以上のコストがかかる恐れがあります。Auto はこれを回避するため、自然なキャッシュ境界点でのみルーティングを行います。具体的には、キャッシュを失うリスクがない最初のターンと、Copilot が過去のターンを要約してプロンプトのプレフィックスがリセットされるコンパクション(圧縮)処理の後です。これらのポイントの間は選択されたモデルを固定し、キャッシュが蓄積され続けるようにします。

言語間ルーティング。Copilot は世界中の開発者を支援しているため、ルーティングは英語以外の言語でも機能する必要があります。私たちは 16 の言語群(CJK、ヨーロッパ系、その他を含む)にわたる会話データを用いてルーティングモデルを訓練しました。評価結果では、各言語グループ間で英語のベースラインから 4 ポイント以内の精度が維持され、統計的に有意な品質の差は見られませんでした。

imageimage図 3: インテリジェントなルーティングは英語のベースラインから 4 ポイント以内にとどまる。英語、ヨーロッパ系、CJK、その他の文字体系ファミリーにわたるモデル評価は、19 の言語にまたがる本番環境の VS Code チャットテレメトリデータからサンプリングされた保留中の評価セットに基づいています。

エスカレーションが必要な場面を学習する。タスクを単に「簡単」または「難しい」とラベル付けするのではなく、私たちはルーティングモデルが実際にどの時点でモデル間で差が生じるかを学べるように訓練しました。各トレーニングクエリに対して、能力の低いモデルと能力の高いモデルからの回答を、品質の次元ごとにスコアリングします。これにより、より強力なモデルが価値を加える場面と、より効率的なモデルが同等の結果を生み出せる場面を学習します。長いエージェントセッションにおける文脈依存メッセージについては、元のユーザー意図、直近のアシスタント応答、会話メタデータを含む完全な多ターン会話を対象にルーティングモデルを訓練しています。

タスクの意図に基づく自動処理が拡大中

タスク意図を考慮した Auto はすでに Visual Studio Code、github.com、およびモバイル版で利用可能です。これにより、コーディング、デバッグ、計画策定、ツール使用など、あなたが何に取り組んでいるかについて Copilot により多くのシグナルが提供され、タスクに応じた最適なモデル選択が可能になります。

私たちは引き続き Copilot 全体でこの体験を拡大しています。次は、タスク意図を考慮した Auto をより多くのプラットフォームに導入し、チームが Auto をデフォルトとして設定できる方法をさらに増やします。

タスク意図を考慮した Auto は、Copilot CLI、GitHub App、および追加の IDE にも登場します。

Copilot Free および Student プランは簡素化され、Auto が唯一のモデル選択オプションとして活用されます。

管理者コントロールにより、組織が Auto をデフォルトに設定したり、唯一の選択肢として強制したりできるようになります。

AI クレジットからより多くの価値を引き出す

Copilot はデフォルトでより効率的になっていますが、いくつかの習慣を心がけることでクレジットをより長く使えます。

まずは Auto から始めましょう。Auto は、毎回手動でモデルを選択する必要なく、あなたが何を行おうとしているかに基づいて最適なモデルを選定するため、多くのタスクに対する強力なデフォルトです。

コンテキストに焦点を当てて保ちましょう。タスクを切り替えるときは新しいセッションを開始し、必要に応じて長時間実行されるセッションをコンパクトにし、関連するコードがどこにあるかをすでに知っている場合は、Copilot に使用してほしいファイルを明示してください。不必要なコンテキストを減らすことで、セッションの多くを実際の作業に充てることができます。

セッション中にモデルや設定を変更しないでください。モデル、推論レベル、コンテキストサイズ、またはツール構成を切り替えると、キャッシュの再利用が破損し、Copilot がコンテキストを再構築する原因となります。望むようにセッションを設定したら、関連する作業はまとめて行いましょう。

並列化を行う前に計画を立ててください。大規模なタスクの場合、まず Copilot に計画を立てさせるよう依頼してください。並列エージェントは、作業が本当に分割可能な場合に有用ですが、同時にクレジットも消費するため、意図的に使用するようにしましょう。

必要なツールのみを使用してください。ツールや MCP サーバーは強力ですが、広範なツールセットは余分なコンテキストを追加する可能性があります。タスクに関連するものを有効にし、不要なものは無効にしてください。GitHub Copilot のエージェントファインダーをチェックして、ツールの使用を効率化しましょう。

利用状況を確認してください。AI 利用ページでは、機能やモデル間でクレジットがどこに使われているかを確認できます。Copilot CLI では、セッションレベルの利用状況も確認できるため、作業中に高コストなパターンを特定するのに役立ちます。

完全なガイドについては、「AI クレジットをより有効活用する方法」をご覧ください。

始めましょう

自動モデル選択は、現在サポートされているすべての Copilot 体験で利用可能です。詳しくは「自動モデル選択ドキュメント」をご覧ください。また、Copilot のディスカッションフィードバックでも意見を共有できます。

システム全体を通じて Copilot をより効率的にし、各モデルの選択を手動で調整する必要なく、クレジットをより多くの有用な作業に充てられるように継続して改善しています。

「各トークンからより多くを引き出す:Copilot がコンテキスト処理とモデルルーティングをどのように改善したか」という記事は、GitHub Blog で最初に公開されました。

原文を表示

As Copilot takes on more agentic work, from planning and editing to debugging, reviewing, and calling tools across longer sessions, efficiency means more than using fewer tokens. It means being smarter about how you use them.

Increasing efficiency starts with reducing what Copilot has to repeat from turn to turn, including context, tool definitions, and cached state. It continues with choosing the right model for the job. A quick explanation, a focused edit, and a complex multi-file change should not all be treated the same way.

We are working on both: improving the Copilot harness so more of each session goes toward the task itself, and expanding Auto so Copilot can pick the model that fits the work without asking developers to make that choice every time. This post focuses on harness improvements in GitHub Copilot for VS Code and on ongoing work to expand Auto across Copilot surfaces.

Increased prompt caching and deferred tools

In longer GitHub Copilot sessions in VS Code, the harness prepares a lot of recurring information for the model: instructions, repository context, conversation history, available tools, and the current state of the task. Some of that context is needed. Some of it can be cached, deferred, or loaded only when it becomes relevant.

Two improvements in GitHub Copilot for VS Code are doing most of the work here. Prompt caching helps Copilot reuse model state for repeated prompt prefixes instead of recomputing the same prefix on every request. Tool search lets the model load tool definitions on demand, instead of sending every full tool schema into context on every turn.

That matters more as agents use more tools. A session may need access to MCP tools, terminal commands, file operations, workspace search, and product-specific actions. Loading every full tool definition up front adds fixed cost to each turn, even when only a small number of tools are relevant to the task. With tool search, Copilot can keep the available toolset broad while sending less unnecessary tool schema into the model.

For a deeper technical look at the implementation, including prompt caching, cache-control breakpoints, provider-specific tool search, and how these changes work across long-running agentic sessions, read the VS Code technical deep dive.

Where GitHub Copilot auto model selection fits in

Auto answers a practical question: which model is the best fit for this task right now?

After your first prompt, Copilot uses task intent and current model health to choose a model that best fits the task. Different kinds of work, like quick explanations, focused edits, or multi-file changes, do not all benefit from the same level of reasoning, so Auto makes that call without requiring you to tune model settings.

In our evaluations, no single model consistently performed best across tasks. In many cases, a more efficient model reached the same outcome, while stronger models mattered most when the task required deeper reasoning. Auto learns where stronger reasoning improves the result. It routes up when the task demands it and stays more efficient when it does not. The goal is not to trade quality for cost, but to use the model that best fits the work.

How Auto selects the right model

Auto combines two signals: what model is healthy and available right now, and what kind of work Copilot is being asked to do.

Real-time model health: a dynamic engine tracks model availability, utilization, speed, error rates, and cost. A model may be capable of handling a task, but that does not mean it is the best choice at that moment. Auto takes current system conditions into account so Copilot can route to a model that is both capable and ready to respond.

Task-aware routing with HyDRA: a routing model that considers factors like reasoning depth, code complexity, debugging difficulty, and tool orchestration needs. HyDRA identifies models that can meet the quality bar for the task, then chooses the best fit among them.

imageimageFigure 1: Three HyDRA operating points illustrate tunability: (Peak) exceeds Sonnet at 12.9% savings; (Agg.) balances quality for 72.5% savings.

imageimageFigure 2: HyDRA (Cons.) ties OpenRouter Auto on resolution rate (70.8%) at 3.3x the savings. HyDRA (Agg.) outperforms both Azure Foundry operating modes.

Taken together, these signals let Auto avoid a one-size-fits-all approach. The point is not to send every task to the biggest model, or every task to the cheapest one. It is to choose the model that fits the work.

Making Auto work in practice

Getting routing right in evaluations is only part of the problem. To make Auto useful in real workflows, we also had to account for how developers actually use Copilot: conversations get longer, context builds up, tasks shift, and developers work in many languages.

Cache-aware routing. Switching models on every turn may sound flexible, but it can work against efficiency. When a conversation stays on the same model, the prompt prefix can be cached and reused across turns. Switching models mid-conversation breaks that cache, which can cost more than the routing change saves. Auto avoids that by routing at natural cache boundaries: on the first turn, when there is no cache to lose, and after compaction, when Copilot summarizes older turns and the prompt prefix resets. Between those points, the selected model stays in place so the cache can keep building.

Routing across languages. Copilot serves developers around the world, so routing has to work in languages other than English. We trained the routing model on conversations across 16 language families, including CJK, European, and others. In evaluations, routing accuracy stayed within four points of the English baseline across language groups, with no statistically significant quality gap.

imageimageFigure 3: Intelligent routing stays within 4 points of English baseline. Model evaluations across English, European, CJK, and other script families, based on a held out evaluation set sampled from production VS Code chat telemetry across 19 languages.

Learning when escalation matters. Instead of labeling tasks as simply “easy” or “hard,” we trained the router to learn where models actually diverge. For each training query, responses from a less capable model and a more capable model are scored across quality dimensions. The router learns when the stronger model adds value, and when a more efficient model can produce an equally good result. For context-dependent messages in longer agentic sessions, the router is trained on complete multi-turn conversations, including the original user intent, recent assistant responses, and conversation metadata.

Auto with task intent is expanding

Auto with task intent is already live in Visual Studio Code, github.com, and mobile. It gives Copilot more signal about the kind of work you are doing, whether that is coding, debugging, planning, or using tools, so it can make a better model choice for the task.

We are continuing to expand that experience across Copilot. Next, we are bringing Auto with task intent to more surfaces and adding more ways for teams to make Auto the default.

Auto with task intent is coming to Copilot CLI, GitHub App, and additional IDEs.

Copilot Free and Student plans will be simplified to leverage Auto as the only model selection option.

Admin controls will let organizations set Auto as the default or enforce Auto as the only option.

Getting more value from your AI credits

Copilot is getting more efficient by default, but a few habits can help your credits go further.

Start with Auto. Auto is the strong default for many tasks because it chooses a model based on what you are trying to do, without making you pick one manually every time.

Keep context focused. Start a new session when you switch tasks, compact long-running sessions when needed, and mention the files you want Copilot to use when you already know where the relevant code lives. Less unnecessary context means more of the session goes toward the actual work.

Avoid changing models or settings mid-session. Switching models, reasoning levels, context size, or tool configuration can break cache reuse and make Copilot rebuild context. Set up the session the way you want it, then keep related work together.

Plan before parallelizing. For larger tasks, ask Copilot to plan first. Parallel agents can be useful when work can truly be split up, but they also consume credits in parallel, so use them deliberately.

Use only the tools you need. Tools and MCP servers are powerful, but broad toolsets can add extra context. Enable what is relevant to the task and turn off what you do not need. Check out agent finder in GitHub Copilot to help streamline your tool usage.

Check your usage. Your AI usage page shows where credits are going across features and models. In Copilot CLI, session-level usage can also help you spot expensive patterns while you work.

For the full guide, see How to get more out of your AI credits.

Get started

Auto model selection is available today across supported Copilot experiences. To learn more, see the Auto model selection docs. You can also share feedback in Copilot discussions.

We are continuing to make Copilot more efficient across the system so more of your credits go toward useful work, without requiring you to tune every model choice yourself.

The post Getting more from each token: How Copilot improves context handling and model routing appeared first on The GitHub Blog.

この記事をシェア

関連記事

Latent Space★42026年6月19日 14:53

[AINews] GLM は GPT より優れているか?GLM-5.2 が実用性を証明、Z.ai が 12 月までに「Open Fable」を公開予定

Latent Space のニュースでは、中国のモデル「GLM-5.2」がベンチマークで優れた結果を示し実用性があると評価されたことと、Z.ai が 12 月までにオープンソースプロジェクト「Open Fable」を発表する見込みについて報じられています。

MarkTechPost★32026年6月19日 11:44

Salesforce CodeGen チュートリアル:ユニットテストと安全性チェック付きの Python 関数の生成・検証・再ランク付け

Salesforce は Hugging Face からモデルを読み込み、自然言語から Python 関数を生成するエンドツーエンドワークフローを公開した。この手法には構文チェックや静的解析、ユニットテストによる検証が含まれる。

AWS Machine Learning Blog★42026年6月19日 08:31

CloudWatch の SageMaker メトリクスとインサイトダッシュボードを用いた生成 AI 推論の監視・デバッグ

AWS は、大規模な生成 AI 推論エンドポイントの P99 レイテンシ急上昇などのトラブルを GPU メモリ圧力や KV キャッシュ飽和などから特定できるよう、CloudWatch に SageMaker の詳細メトリクスとインサイトダッシュボードを追加した。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む