Communityコーディング&開発github.com

潜在ブリーフィング(Latent Briefing)

階層型マルチエージェントシステムにおいて、ワーカーモデルのKVキャッシュを注意マッチングで圧縮し、推論軌跡をテキストではなく表現レベルで共有します。

潜在ブリーフィング(Latent Briefing) とは?

Latent Briefingは、オーケストレーターが蓄積した長い推論軌跡を、ワーカーモデルのKVキャッシュ内で注意マッチング(Attention Matching, AM)により圧縮することで、トークンコスト増大と情報損失を同時に解決する高度なスキルです。従来のLLM要約やRAGでは困難だった、オーケストレーターの進化的な推論状態をワーカーに正確かつ効率的に転送できます。主にRecursive Language Modelsやツール多用型エージェントグラフでトークン爆発が発生している場合に有効で、ワーカー呼び出し時のトークン削減と精度維持の両立を目指します。ただし、内部KVテンソルへのアクセス権が必要であり、API専用スタックでは利用できません。また、タスクに応じた閾値チューニングが性能に大きく影響するため、ワークロードごとの再測定が推奨されます。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/tree/main/skills/latent-briefing

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Latent Briefing(潜在ブリーフィング)とKVキャッシュメモリ共有

階層型マルチエージェントシステムでは、多くの場合、同じコンテキストを二重に支払うことになります。オーケストレーターは長い推論軌跡を蓄積しますが、各ワーカーが受け取るのは通常、サブタスクのプロンプトと生のドキュメント断片など、狭いテキストハンドオフにすぎません。全文の軌跡を渡せばカバレッジは向上しますが、ワーカー呼び出しごとにトークンコストが急増します。要約では遅延と情報損失が発生します。検索はドキュメントアクセスには役立ちますが、オーケストレーターの進化的な推論状態は保持されません。

Latent Briefingはこれを解決するために、テキストレベルではなく表現レベルでメモリを共有します。核となるアイデアは、オーケストレーターの軌跡をワーカーモデルのKVキャッシュ内で圧縮し、現在のワーカータスクに最も関連する位置のみを保持することです。この手法はAttention Matching (AM) KVキャッシュ圧縮をベースに、タスクガイド付きクエリ、ヘッド間で共有されるトークンマスク、ロバストな閾値設定を推論時マルチエージェントハンドオフに適応させたものです。

アクティブ化のタイミング

以下の場合にこのスキルをアクティブ化してください:

  • オーケストレーター・ワーカー型やスーパーバイザー・スペシャリスト型システムを設計しており、ワーカーが完全な軌跡をテキストとして再生することなく、以前のオーケストレーター状態にアクセスする必要がある場合
  • クロスエージェント状態転送におけるLLM要約やRAGの代替案を評価している場合
  • KVキャッシュ圧縮を、同一プロンプトのプレフィックスキャッシングだけでなく、第一級の推論プリミティブとして実装または研究している場合
  • 再帰的、階層的、ツール多用型のエージェントグラフにおけるトークン爆発をデバッグしている場合
  • ワーカートークン節約量、総トークン節約量、圧縮オーバーヘッド、精度を同時に報告するベンチマークを解釈している場合

以下の隣接作業にはこのスキルをアクティブ化しないでください(他のスキルが担当):

  • 内部KVテンソルにアクセスできないAPI専用スタック:context-compression、memory-systems、またはmulti-agent-patternsを使用
  • 通常の永続メモリ、エンティティ追跡、グラフ検索:memory-systemsを使用
  • 表現レベルの状態共有を行わない一般的なマルチエージェントトポロジ:multi-agent-patternsを使用
  • KV状態を変換しないプレフィックスキャッシング、マスキング、バジェットポリシー:context-optimizationを使用

中核概念

トークン爆発パターン。 再帰的またはREPLスタイルのシステムでは、オーケストレーターが証拠の検査、仮説の検証、サブ質問への回答のためにワーカーを繰り返し呼び出します。オーケストレーターの軌跡は、部分的な結論、行き止まり、ツール出力、以前のワーカー応答によって成長します。その軌跡がワーカー呼び出しごとに完全に渡されると、コストは急速に増加します。

表現レベルでの共有。 システムは軌跡を自然言語に要約する代わりに、ワーカーモデルのKVキャッシュ上で動作します。現在のタスクに対してワーカーが注目するであろう位置を保持し、残りをドロップします。これは通常のプレフィックスキャッシングよりも特化しています。プレフィックスキャッシングは同一のプレフィックスを再利用するのに対し、Latent Briefingは再利用された軌跡内でタスク条件付き選択的保持も実行します。

圧縮エンジンとしてのAttention Matching。 AMは、完全なキャッシュのアテンション出力を近似する、より小さなキャッシュを求めます。Latent Briefingは、スコアリング信号とバッチ戦略を変更することで、AMをマルチエージェント推論に適応させます:

  1. 現在のワーカープロンプトから派生したタスクガイド付きクエリベクトルを使用
  2. スコアをヘッドごとの独立したサブセットではなく、共有グローバルマスクに集約
  3. 固定のtop-kではなく、median + tau * MADなどのロバストな閾値を使用

参考結果の形状。 公開された記事では、長文書QAワークロードにおいて、実質的なワーカートークン削減、顕著な総トークン節約、および数秒未満の圧縮オーバーヘッドが報告されています(claim-latent-briefing-public-results)。これらの数値はワークロード固有の証拠であり、一般的な保証ではありません。

詳細トピック

テキストのみの緩和策が不十分な理由

アプローチ主な弱点
LLM要約高レイテンシ、損失のある抽象化、次のサブタスクに必要な情報が保存される保証がない
検索/RAGチャンキングと埋め込みに依存し、チャンク間やステップ間の依存関係を見逃す可能性がある
完全な軌跡を渡すコストがワーカー呼び出しごとに増大し、無関係なコンテキストがワーカーの品質を低下させる可能性がある

Latent Briefingは、ボトルネックがドキュメント検索そのものではなく、オーケストレーター状態をワーカーに効率的かつ正確に転送する方法である場合に有用です。

再帰的オーケストレーター・ワーカーの形状

Recursive Language Modelsなどのフレームワークは、長いコンテキストを環境として扱い、その上で再帰します:オーケストレーターが作業を分解し、ワーカーに委任します。Latent Briefingは、オーケストレーターがすでにワーカーに情報を伝えるべきタスク固有の状態を構築しているが、その状態をテキストとして再シリアル化するにはコストが高すぎる、またはノイズが多いというギャップを埋めます。

理想的なセットアップでは、ワーカーはオーケストレーター軌跡に対して永続的なKV状態を維持します。新しい軌跡トークンがその状態を拡張し、現在のサブタスクの生成直前に圧縮が実行されます。

3つの推論時変更

  1. タスクガイド付きクエリベクトル。 コンテキストからの汎用サンプルではなく、現在のワーカータスクプロンプトからのクエリを使用します。軌跡と現在のタスクをワーカーモデルにフォワードパスし、タスクが各位置にどの程度注目するかで軌跡位置をスコアリングします。

  2. 共有トークン選択。 レイヤーとヘッド全体のスコアを、位置ごとに1つのスコアに集約します。1つの共有マスクによりバッチ操作が可能になり、何百もの互換性のないヘッドごとのソリューションを回避できます。

  3. MAD閾値設定。 median + tau * MADなどのロバストな外れ値閾値より上の位置を保持します。tauが高いほど積極的です。最適な設定は、タスクのレジーム、軌跡の品質、ドキュメントの長さに依存します。

インフラストラクチャの前提条件

Latent Briefingは、システムがワーカー推論ランタイムを十分に制御してKV状態を検査または変換できる場合にのみ実用的です。内部KVテンソルにアクセスできないAPI専用スタックでは不適切な選択です。また、オーケストレーターの軌跡がワーカーのモデル空間で表現可能であることを前提とします。オーケストレーターとワーカーのトークナイザー、アーキテクチャ、またはアテンションレイアウトが大きく異なる場合、直接的な表現共有は実行不可能な可能性があります。

決定フレームワーク

ボトルネックに一致するメカニズムを選択してください:

ニーズ優先理由
安定した繰り返しプレフィックス、最小限のロジック変更プレフィックスキャッシング最も安価な最適化、情報損失なし
人間が読み取り可能で監査可能なクロスステップ状態構造化ノートまたは要約検査と保存が容易
大規模な外部コーパスへのスパースルックアップ検索/RAGドキュメントを効率的に見つける
ワーカーがオーケストレーター状態のタスク固有スライスを必要とし、ランタイムアクセスが存在するLatent Briefingすべてのテキストを再生せずに関連する潜在状態を転送

Latent Briefingは、要約や検索の普遍的な代替ではありません。制御可能なオーケストレーター・ワーカースタックをすでに実行しているシステム向けの、特殊な最適化です。

閾値レジーム

報告された長文書QAの結果は以下の示唆を与えます:

  • 長いドキュメント: 軽めの圧縮で証拠のカバレッジをより広く維持しつつ、トークンを節約できる。
  • 難しい質問: オーケストレーター軌跡に投機的または価値の低い分岐が含まれる場合、より積極的な圧縮が役立つ。
  • 短く、簡単なコンテキスト: 適度な圧縮で、必要な証拠を落とさずに冗長性を除去できる可能性がある。

これらはチューニングの仮説であり、移植可能な法則ではありません。対象のワークロードで再測定してください。

実践的なガイダンス

  • まず共有メモリの境界を定義する。 軌跡キャッシュに何を入れるかを正確に決定する:以前のワーカー応答、ツール出力、思考連鎖、または選択された成果物のみ。圧縮の品質は、最初にキャッシュに入れるものに依存します。
  • 逸話ではなく検証データで調整する。 タスク精度、ワーカートークン、総トークン、保持率、圧縮オーバーヘッドを同時に追跡します。
  • エンドツーエンドのレイテンシを測定する。 圧縮が報われるのは、圧縮+生成が同じ品質目標に対して最良のテキスト層の代替案を上回る場合のみです。
  • 強力なベースラインを使用する。 「すべて送信」だけでなく、プレフィックスキャッシング、構造化ノート、検索、選択的テキストハンドオフと比較します。
  • オーケストレーターのばらつきを考慮する。 分解戦略が実行ごとに変化する場合、圧縮効果をオーケストレーターノイズから分離するために十分な試行回数で平均化します。

例

シナリオ:ワーカー呼び出し間でオーケストレーター軌跡が成長する

呼び出し1: 軌跡T1 -> ワーカーがサブ質問Aに回答
呼び出し2: 軌跡T2 = T1 + 新しい推論 + 応答A
        タスクBのプロンプトを使用してKV(T2)を圧縮
        ワーカーがサブ質問Bに回答

タスクBのプロンプトが、T2のどの部分が圧縮されたワーカー状態に残るかを決定します。

否定的な例:API専用ワーカー

ワーカーがKVテンソルを公開しないホスト型テキスト生成APIの背後で動作する場合、Latent Briefingを直接実装できません。代わりに、context-compressionからの構造化テキストハンドオフを使用するか、memory-systemsから状態を取得します。

ガイドライン

  1. 主な無駄がソースドキュメントの検索ではなく、オーケストレーター状態をワーカーに再送信することにある場合、Latent Briefingを優先します。
  2. 監査可能性、移植性、またはクローズドモデルAPIがトークン効率よりも重要な場合、プレーンテキストのハンドオフを優先します。
  3. 圧縮を評価と共同設計します。小さな品質低下が大きなトークン節約を帳消しにする可能性があります。
  4. 圧縮の積極性は隠れた定数ではなく、制御可能なパラメータとして公開します。

注意点

  1. インフラストラクチャアクセスが最初の関門。 ランタイムがワーカーKV状態を検査および書き換えできない場合、Latent Briefingは研究上のアイデアであり、デプロイ可能な技術ではありません。
  2. 共有モデル空間が重要。 KV圧縮は特定のモデルのアテンション空間で定義されます。異なるモデルファミリー間で潜在ハンドオフがクリーンに機能するとは想定しないでください。
  3. 閾値はワークロードに依存。 単一のグローバルtauが長いコンテキストと短いコンテキスト、簡単なタスクと難しいタスクの両方で機能することはほとんどありません。圧縮が積極的になりすぎると精度の崖が予想されます。
  4. ベンチマークの範囲は狭い。 公開結果は長文書QAに焦点を当てています。コード生成、数学、マルチドキュメント合成は異なる動作をする可能性があります。
  5. オーケストレーターのばらつきが信号を隠す可能性がある。 確率的なオーケストレーターは、小さな圧縮の利得や損失を圧倒するほど軌跡を変化させる可能性があります。
  6. 弱いベースラインは見かけ上の勝利を誇張する。 システムレベルの優位性を主張する前に、強力なテキストレベルの代替案と比較します。

統合

  • context-optimization - プレフィックスキャッシングと観測マスキングはデフォルトの最初の手段であり、Latent Briefingは互換性のあるオーケストレーター・ワーカースタック向けのより専門的な最適化です。
  • multi-agent-patterns - マルチエージェントのトークンコストが調整オーバーヘッドだけでなく、スーパーバイザー軌跡の再生によって駆動される場合に適用されます。
  • context-compression - 人間が読み取り可能な状態、移植性、または監査ログが重要な場合、テキスト層の要約が引き続き推奨されます。
  • memory-systems - クロスステップ状態を外部メモリに保持するか、ワーカーの潜在状態に保持するかの判断に役立ちます。
  • tool-design - ワーカー呼び出しの形状とタスクプロンプトが、圧縮中にどのトークンが高スコアを得るかを決定します。

参考資料

内部参照:

このコレクションの関連スキル:

  • context-optimization - 読むタイミング:主なニーズがワーカーKV操作ではなく、プレフィックスキャッシング、観測マスキング、またはテキスト層の圧縮である場合
  • multi-agent-patterns - 読むタイミング:アーキテクチャがそもそもオーケストレーター・ワーカーであるべきかどうかを決定する場合
  • context-compression - 読むタイミング:潜在転送よりも人間が読める要約の方が適している可能性がある場合
  • memory-systems - 読むタイミング:モデル内の潜在状態と外部の永続メモリを比較する場合

外部リソース:


スキルメタデータ

作成日: 2026-04-14 最終更新日: 2026-05-15 作者: Agent Skills for Context Engineering Contributors; 主な技術ソース Ramp Labs(公開投稿) バージョン: 1.2.0

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

advanced-evaluation

This skill should be used for advanced LLM evaluation: LLM-as-judge systems, direct scoring, pairwise comparison, rubric calibration, evaluator bias mitigation, confidence scoring, and automated quality assessment.

bdi-mental-states

This skill should be used when modeling agent mental states with BDI concepts: beliefs, desires, intentions, RDF-to-belief transformations, rational agency traces, cognitive agents, BDI ontologies, and neuro-symbolic AI integration.

book-sft-pipeline

This skill should be used for book-to-SFT pipelines: ePub extraction, literary segmentation, author-voice dataset construction, style-transfer training, LoRA workflows, and model evaluation for voice replication.

comprehensive-research-agent

Ensure thorough validation, error recovery, and transparent reasoning in research tasks with multiple tool calls

context-compression

This skill should be used when long-running agent sessions need context compression, structured summarization, compaction, token-per-task optimization, or durable handoff summaries that preserve decisions, files, risks, and next actions.

context-degradation

This skill should be used for diagnosing and mitigating context degradation: lost-in-middle failures, context poisoning, context clash, context confusion, attention-pattern issues, and agent performance degradation caused by accumulated or conflicting context.

context-fundamentals

This skill should be used to explain or reason about the foundational concepts of context engineering: what context is, the anatomy of a context window, how attention mechanics work, the U-shaped attention curve, why context quality matters more than quantity, and the mental models needed to interpret every other context-engineering decision. Use this for conceptual explanation, onboarding, and background reading. Route operational work to the specialized skills: debugging attention failures goes to context-degradation, token-efficiency work goes to context-optimization, conversation summarization goes to context-compression, and project-shape decisions go to project-development.

context-optimization

This skill should be used for improving context efficiency: context budgeting, observation masking, prefix or KV-cache strategy, partitioning, token-cost reduction, retrieval scoping, and extending effective context capacity without lowering answer quality.

evaluation

This skill should be used when building agent evaluation systems: deterministic checks, regression suites, multi-dimensional rubrics, quality gates, production monitoring, baseline comparison, and outcome measurement for agent pipelines.

filesystem-context

This skill should be used when agent work needs file-backed context: durable scratchpads, tool-output offloading, just-in-time discovery, cross-agent handoff files, filesystem memory, or cleanup policies for context stored outside the prompt.

harness-engineering

This skill should be used when designing autonomous agent harnesses: research loops, evaluation scaffolds, locked and editable surfaces, durable logs, novelty gates, pruning, rollback, PR preparation, and human approval boundaries.

hosted-agents

This skill should be used when designing hosted or background agent infrastructure: sandboxed execution, remote coding environments, warm pools, session persistence, multiplayer collaboration, self-spawning agents, or Modal-style sandboxes.

long-horizon-prompting

This skill should be used when writing, enhancing, or evaluating the launch prompt for a long-running autonomous agent or a parallel multi-agent orchestration attacking a hard problem: pseudo-formal task briefs that define terms and an exact success predicate linguistically, enumerate non-counting outcomes, set persistence rules with explicit stop and return conditions and effort floors, manage a diverse portfolio of parallel approaches with an approach registry and blocked-route bookkeeping, and gate the return on adversarial audit. Route agent topology and coordination protocols to multi-agent-patterns, runtime control surfaces and loop governance to harness-engineering, evaluator and quality-gate construction to evaluation, judge design to advanced-evaluation, and compaction or memory mechanics to context-compression and memory-systems.

memory-systems

This skill should be used for persistent semantic memory in agent systems: cross-session knowledge retention, entity tracking, temporal validity, graph or vector retrieval, memory consolidation, and memory benchmark selection. Route file-backed scratchpads to filesystem-context, handoff summaries to context-compression, and token-efficiency tactics to context-optimization.

multi-agent-patterns

This skill should be used when designing multi-agent systems that need context isolation, supervisor or swarm coordination, explicit handoffs, parallel execution, or a decision on whether multiple agents are justified.

project-development

This skill should be used for project-level decisions about LLM-powered systems: whether an LLM is the right primitive for the task at hand, the shape of a multi-stage batch or agent pipeline, token and cost estimation, choosing between single-agent and multi-agent at the project level, structured output design for downstream parsing, and structuring agent-assisted iteration. Use this when the unit of work is a whole project or a multi-stage pipeline. Route individual tool design to tool-design and individual skill-loading or context-budget tactics to context-optimization.

self-improvement-loops

This skill should be used when the harness, scaffold, workflow, or optimizer itself is the optimization target: recursive self-improvement (RSI) loops, meta-harnesses, self-improving harnesses that mine their own failures and propose bounded edits, evolutionary or population-based search over agent scaffolds, acceptance gates for self-modifying systems, and agentic context evolution where the mechanism that produces context is versioned and evolved. Route governance of a single autonomous loop (locked surfaces, durable logs, rollback, novelty gates, approval boundaries) to harness-engineering, measurement and quality-gate design to evaluation, judge design to advanced-evaluation, and remote sandbox infrastructure to hosted-agents.

self-managed-context

This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context exposed as an editable file the model rewrites with code tools, model-driven eviction and in-place updates, the harness invariants that keep self-editing safe (pinned prefix, edit gate, edit receipts, budget readouts, rollback on overflow), the prefix-cache cost of mid-context edits, and steering or training the model's own context-editing strategy. Route note content and fixed-threshold summarization to context-compression, cache-stable layout under harness control to context-optimization, file offloading to filesystem-context, and loop governance to self-improvement-loops.

tool-design

This skill should be used for the tool-interface layer of an agent system specifically: writing tool descriptions agents can route on, designing tool schemas and response formats, naming conventions, actionable error recovery messages, MCP server design, tool-set consolidation, and deciding when to add or remove an individual tool. Use this when the unit of work is a single tool or a set of tools. Route project-shape, pipeline architecture, and task-model-fit decisions to project-development; route deciding whether to introduce sub-agents to multi-agent-patterns.

関連スキル