Anthropic finds over 10,000 vulnerabilities with Project GlasswingSynthID expands to Google Search and ChromeGoal mode now available across all Codex platformsCodex Thursday adds remote Mac controlAnthropic publishes early Project Glasswing resultsAnthropic updates vulnerability disclosure dashboardReleases new science-focused AI skills toolGemini 3.5 Flash released with enhanced research toolsGoogle launches ADK for Kotlin and Android 0.1.0Gemini 3.5 Flash officially launchedAI solves long-standing open math problem for first timeGoogle announces Gemini Omni for video creationUse multiple agents with Gemini OmniOpenAI Introduces Guaranteed Capacity for Long-Term ComputeGemini for Science assists with research tasksSynthID watermark and verification tool added to AI imagesGoogle I/O 2026 to unveil new AI breakthroughsOpenAI boosts image provenance and verificationKPMG rolls out Claude globally, starting with taxGoogle adds Managed Agents to the Gemini APIAnthropic finds over 10,000 vulnerabilities with Project GlasswingSynthID expands to Google Search and ChromeGoal mode now available across all Codex platformsCodex Thursday adds remote Mac controlAnthropic publishes early Project Glasswing resultsAnthropic updates vulnerability disclosure dashboardReleases new science-focused AI skills toolGemini 3.5 Flash released with enhanced research toolsGoogle launches ADK for Kotlin and Android 0.1.0Gemini 3.5 Flash officially launchedAI solves long-standing open math problem for first timeGoogle announces Gemini Omni for video creationUse multiple agents with Gemini OmniOpenAI Introduces Guaranteed Capacity for Long-Term ComputeGemini for Science assists with research tasksSynthID watermark and verification tool added to AI imagesGoogle I/O 2026 to unveil new AI breakthroughsOpenAI boosts image provenance and verificationKPMG rolls out Claude globally, starting with taxGoogle adds Managed Agents to the Gemini API
🔒 公式発表のみ掲載。噂・リーク・情報商材は載せません。
← Back to glossary

Context Length

コンテキスト長

こんてきすとちょう

Definition

Context length refers to the token limit of a model's context window and is directly tied to its long-document handling capability. It also influences latency and cost as prompts grow.

100ページのPDFを丸ごとAIに読ませたいのに、途中で内容が切れてしまう。あるいは長い会話の前半で伝えた条件を、AIがすっかり忘れている。こうした問題の根本にあるのがコンテキスト長の制約です。コンテキスト長とは、LLMが一度の処理で扱えるトークン数の上限であり、モデルの「作業メモリ」の容量に相当します。

公称値と実効値のギャップ

モデルのスペック表には「128Kトークン」「200Kトークン」といった数字が並びますが、この数字をそのまま信用するのは危険です。まず、入力上限と出力上限は別々に設定されているモデルが大半です。たとえばClaude 3.5 Sonnetはコンテキスト長200Kですが、最大出力は8,192トークンに制限されています。GPT-4 Turboも128Kの入力に対し、出力は4,096トークンが標準です。さらに重要なのが「実効的なコンテキスト長」の問題です。公称値の上限付近では、情報の検索精度が著しく低下することが多くのベンチマークで確認されています。

Needle in a Haystackテストと「Lost in the Middle」

実効的なコンテキスト長を測定する代表的な手法がNIAH(Needle in a Haystack)テストです。大量のテキスト(干し草の山)の中に特定の情報(針)を埋め込み、モデルがそれを正確に取り出せるかを位置と深さを変えて測定します。このテストで明らかになった重要な現象が「Lost in the Middle」問題です。入力の先頭と末尾に置かれた情報は高精度で検索できるのに、中間部分の情報は正答率が20〜30%低下することがあります。2023年のスタンフォード大学の研究がこの現象を体系的に示し、長コンテキストモデルの評価方法に大きな影響を与えました。

長コンテキストを活かす実践戦略

この特性を踏まえた活用のコツがあります。最も重要な情報はプロンプトの先頭か末尾に配置するのが鉄則です。長い文書を丸ごと入力するよりも、RAG(検索拡張生成)で関連部分だけを抽出してから入力するほうが、精度とコストの両面で優れる場合が多いです。また、セクションごとに明確な見出しやマーカーを付けることで、モデルが情報を見つけやすくなります。

コストとのトレードオフ

コンテキスト長が大きいモデルほど処理コストも高くなります。APIの料金はトークン数に比例するため、128Kのコンテキストをフルに使えば、短いプロンプトの数十倍のコストがかかります。用途に応じて「本当に長いコンテキストが必要か」を見極め、短い入力で済む場合は小さいモデルを選ぶほうがコストパフォーマンスに優れます。コンテキスト長は「大きければ良い」ではなく、精度・コスト・速度のバランスの中で最適な設定を選ぶべき設計判断です。

h
hayami

Stay on top of OpenAI, Google & Anthropic updates. An AI digest for business professionals.

Source Policy

We use only official sources. Each article links to the original announcement so you can verify it yourself.

© 2026 hayami. All rights reserved.