---
title: "Prompt compression — プロンプト圧縮"
source: "https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE"
wiki: "systems-analysis.info/int"
article: "Prompt_compression_—_プロンプト圧縮"
language: "ja"
categories:
  - "Category:Japanese"
  - "Category:Large language models"
  - "Category:Machine learning"
  - "Category:Prompt engineering"
revision_id: 6007
wiki_created_at: 2026-09-06T23:57:05Z
wiki_modified_at: 2026-09-06T23:57:05Z
downloaded_at: 2026-09-07T23:11:31Z
---

# Prompt compression — プロンプト圧縮

**プロンプト圧縮**（英: *prompt compression*）とは、大規模言語モデル（LLM）への入力テキスト（プロンプト）の長さを、重要な情報を維持しつつ短縮することを目的としたプロンプトエンジニアリングにおける一連の手法です<sup>[\[1\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-jha2024-1)</sup>。LLMのコンテキストウィンドウが数百万トークン（例：Google Gemini）にまで拡大するにつれて、非常に長いテキストを処理できるようになりましたが、これにより新たな問題が生じました。具体的には、API呼び出しコストの高さ、遅延の増加、そして「中間部分の損失（loss-in-the-middle）」効果による推論品質の低下です<sup>[\[2\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-survey2024-2)</sup>。

プロンプト圧縮は、短縮された入力に最も本質的なデータを集中させ、冗長な部分を排除することでこれらの問題を解決します。これにより、コンテキスト長の制限を超えるリスクが減少し、生成が高速化され、コストが削減されると同時に、回答の精度も維持されます<sup>[\[3\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-datacamp-guide-3)</sup>。

## プロンプト圧縮の手法

プロンプト圧縮の手法は、いくつかの主要なクラスに分類できます。

### トークンの削除（フィルタリング）

このアプローチは、元のテキストから最も情報量の少ないトークン、フレーズ、または文を、残りの部分を変更せずに削除することに基づいています。トークンの重要度はヒューリスティックに決定されます。

- **LLMLingua**: Microsoftが開発した手法で、各トークンのパープレキシティを計算し、テキストの予測可能性への影響が少ないトークンを削除します。**LongLLMLingua**バージョンでは、このアプローチが長い文書向けに改良されており、ユーザーの特定のクエリに対するフラグメントの関連性を考慮します<sup>[\[4\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-jiang2023_llmlingua-4)</sup>。
- **Selective-Context**: 小規模な言語モデルを使用して各トークンの自己情報量（*self-information*）を評価し、情報量が最も少ないトークンを破棄します<sup>[\[5\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-li2023_selective-5)</sup>。
- **PCRL** (Prompt Compression via Reinforcement Learning): 強化学習を用いてエージェントを訓練し、各トークンに対して「維持」か「削除」かの決定を行わせ、最終的な回答の品質指標（例：ROUGE）を最大化することを目指します<sup>[\[6\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-jung2023_pcrl-6)</sup>。

### 要約的圧縮（サマリー生成）

このアプローチでは、圧縮モデル（通常はより小さいモデル）が元のテキストの短い要約を生成し、それが主要なLLMに渡されます。

- **RECOMP** (Retrieval-Compression-Prompting): ナレッジベース内の各文書について、ユーザーの想定されるクエリを考慮した短い要約（*query-aware summary*）を事前に生成します。これにより、圧縮だけでなく、情報の事前処理も可能になります<sup>[\[7\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-xu2024_recomp-7)</sup>。
- **PRCA** (Prompt Compression with Reinforced Context Aggregation): 要約モデルの訓練と強化学習を組み合わせ、主要なLLMの回答品質を最大化するような要約を生成します<sup>[\[8\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-yang2023_prca-8)</sup>。
- **Prompt-SAW** (Semantic Aware Winnowing): 要約の前に、テキストから知識グラフ（エンティティと関係）を抽出し、関連性の高いノードを選択して、それに基づいて圧縮されたテキストを生成します<sup>[\[9\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-ali2024_promptsaw-9)</sup>。

### 抽出的圧縮

この手法は、元のテキストから主要な断片（文、段落）を、言い換えることなく抽出します。

- **Reranker-LLMs**: リランカーモデル（*reranker*）を使用し、現在のクエリに対する各段落や文書の重要性を評価し、最も関連性の高いものだけを選択します<sup>[\[10\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-pradeep2023_reranker-10)</sup>。
- **CompAct**: 反復的な抽出・要約を行います。モデルは長いテキストのセグメントを順次取得し、それを圧縮して、回答に十分な情報があるかを確認します。情報が不足している場合は、次のセグメントを追加して再度圧縮し、品質を維持しながら大幅な圧縮を実現します<sup>[\[11\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-yoon2024_compact-11)</sup>。

### 蒸留と「メモリトークン」

テキストの代わりに、圧縮された情報を含む特別に訓練された代替トークンや埋め込み表現をモデルが受け取る、新しいクラスの手法です。

- **Gist Tokens**: LLMを追学習させ、長い指示を少数の特別な*gistトークン*（例えば、数千トークンの代わりに20〜30トークン）に「折りたたむ」ようにします。これらのトークンは元のプロンプトの代わりに使用され、品質の低下を最小限に抑えながら最大26倍の圧縮を実現します<sup>[\[12\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-mu2023_gist-12)</sup>。
- **Soft Prompt Tuning**: テキストプロンプトの代わりに、特定のタスクを解決するために調整される学習可能な「仮想トークン」（埋め込み表現）を使用します。
- **SelfCP**: 凍結されたLLM自体を圧縮機として使用することを提案します。特別なマーカー付きのテキストセグメントをモデルに与えることで、モデルは高密な表現（*memory tokens*）を生成し、それを後で自身が回答に使用します<sup>[\[13\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-gao2024_selfcp-13)</sup>。

## 有効性とトレードオフ

- **高速化とコスト削減**: トランスフォーマーの計算量はシーケンス長に対して二乗（\$O(n^2)\$）で増加するため、プロンプトを数分の一に短縮することで大幅な節約が実現します。例えば、*gist tokens*は26倍の圧縮で最大40%のFLOPs削減を示します<sup>[\[12\]](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_note-mu2023_gist-12)</sup>。
- **品質の向上**: 元のテキストにノイズや注意を散漫にさせる詳細が含まれていた場合、プロンプトの圧縮が回答の品質を向上させることさえあります。無関係なコンテキストを削除することで、モデルはタスクの重要な側面に集中しやすくなります。
- **品質のトレードオフ（忠実性）**: 過度に積極的な圧縮は、重要な詳細（日付、名前、否定表現など）の損失につながり、回答の品質を低下させる可能性があります。要約的な手法は、特にハルシネーションのリスクにさらされます。圧縮されたプロンプトの完全性と正確性（*faithfulness*）を制御することが重要な課題です。

## 他の分野との関連性

- **Retrieval-Augmented Generation (RAG)**: RAGとプロンプト圧縮は密接に関連しています。RAGは外部の圧縮ステップと見なすことができます。データベース全体を処理する代わりに、関連する文書を検索・選択します。プロンプト圧縮は、選択された文書をLLMに渡す前にその量を削減することで、RAGを補完します。
- **In-Context Learning**: 文脈内の例（デモンストレーション）はプロンプトの長さを大幅に増加させます。これらのデモンストレーションを圧縮すること（例えば、多数の例を一つの短い指示に置き換える*Instruction Distillation*）は、活発な研究分野です。

## 参考文献

- Ali, M. et al. (2024). *Prompt-SAW: Semantic-Aware Winnowing for Prompt Compression*. <a href="https://arxiv.org/abs/2403.00000" class="external text" rel="nofollow">arXiv:2403.00000</a>.
- Gao, J.; Cao, Z.; Li, W. (2024). *SelfCP: Compressing Over-Limit Prompt via the Frozen Large Language Model Itself*. <a href="https://arxiv.org/abs/2405.17052" class="external text" rel="nofollow">arXiv:2405.17052</a>.
- Jiang, H. et al. (2023). *LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models*. <a href="https://arxiv.org/abs/2310.05736" class="external text" rel="nofollow">arXiv:2310.05736</a>.
- Jiang, H. et al. (2023). *LongLLMLingua: Accelerating and Enhancing LLMs in Long-Context Scenarios via Prompt Compression*. <a href="https://arxiv.org/abs/2310.06839" class="external text" rel="nofollow">arXiv:2310.06839</a>.
- Jung, H.; Kim, K. (2023). *PCRL: Discrete Prompt Compression with Reinforcement Learning*. <a href="https://arxiv.org/abs/2308.08758" class="external text" rel="nofollow">arXiv:2308.08758</a>.
- Li, M. et al. (2023). *Selective-Context: Compressing Context to Summarise and Answer Questions*. <a href="https://arxiv.org/abs/2307.00000" class="external text" rel="nofollow">arXiv:2307.00000</a>.
- Mu, J. et al. (2023). *Learning to Compress Prompts with Gist Tokens*. <a href="https://papers.nips.cc/paper_files/paper/2023/hash/3d77c6dcc7f143aa2154e7f4d5e22d68-Abstract-Conference.html" class="external text" rel="nofollow">NeurIPS 2023</a>.
- Xu, F.; Shi, W.; Choi, E. (2023). *RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation*. <a href="https://arxiv.org/abs/2310.04408" class="external text" rel="nofollow">arXiv:2310.04408</a>.
- Yang, C. et al. (2023). *PRCA: Prompt Compression with Reinforced Context Aggregation*. <a href="https://arxiv.org/abs/2311.00000" class="external text" rel="nofollow">arXiv:2311.00000</a>.
- Yoon, J. et al. (2024). *CompAct: Interactive Prompt Compression for Long-Document QA*. <a href="https://arxiv.org/abs/2402.00000" class="external text" rel="nofollow">arXiv:2402.00000</a>.
- Zhang, S. et al. (2024). *Efficient Prompting Methods for Large Language Models: A Survey*. <a href="https://arxiv.org/abs/2404.01077" class="external text" rel="nofollow">arXiv:2404.01077</a>.
- Jha, S. et al. (2024). *Characterizing Prompt Compression Methods for Long Context Inference*. <a href="https://arxiv.org/abs/2407.08892" class="external text" rel="nofollow">arXiv:2407.08892</a>.

## 脚注

1.  <span id="cite_note-jha2024-1">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-jha2024_1-0) Jha, S., et al. (2024). «Characterizing Prompt Compression Methods for Long Context Inference». *arXiv*. <a href="https://arxiv.org/html/2407.08892v1" class="external autonumber" rel="nofollow">[1]</a></span>
2.  <span id="cite_note-survey2024-2">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-survey2024_2-0) «Efficient Prompting Methods for Large Language Models: A Survey». *arXiv*. <a href="https://arxiv.org/html/2404.01077v2" class="external autonumber" rel="nofollow">[2]</a></span>
3.  <span id="cite_note-datacamp-guide-3">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-datacamp-guide_3-0) «Prompt Compression: A Guide With Python Examples». *DataCamp*. <a href="https://www.datacamp.com/tutorial/prompt-compression" class="external autonumber" rel="nofollow">[3]</a></span>
4.  <span id="cite_note-jiang2023_llmlingua-4">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-jiang2023_llmlingua_4-0) Jiang, H., et al. (2023). «LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models». *arXiv*.</span>
5.  <span id="cite_note-li2023_selective-5">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-li2023_selective_5-0) Li, M. (2023). «Compressing context to summarize and answer questions». *arXiv*.</span>
6.  <span id="cite_note-jung2023_pcrl-6">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-jung2023_pcrl_6-0) Jung, H., & Kim, K. (2023). «Learning to Compress Prompts with Reinforcement Learning». *arXiv*.</span>
7.  <span id="cite_note-xu2024_recomp-7">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-xu2024_recomp_7-0) Xu, F., et al. (2024). «RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation». *arXiv*.</span>
8.  <span id="cite_note-yang2023_prca-8">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-yang2023_prca_8-0) Yang, C., et al. (2023). «PRCA: A new framework for prompt compression». *arXiv*.</span>
9.  <span id="cite_note-ali2024_promptsaw-9">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-ali2024_promptsaw_9-0) Ali, M., et al. (2024). «Prompt-SAW: A new method for prompt compression». *arXiv*.</span>
10. <span id="cite_note-pradeep2023_reranker-10">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-pradeep2023_reranker_10-0) Pradeep, R., et al. (2023). «How to select the best passages for RAG?». *arXiv*.</span>
11. <span id="cite_note-yoon2024_compact-11">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-yoon2024_compact_11-0) Yoon, J., et al. (2024). «CompAct: A new framework for interactive prompt compression». *arXiv*.</span>
12. <span id="cite_note-mu2023_gist-12">↑ <sup>[12.0](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-mu2023_gist_12-0)</sup> <sup>[12.1](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-mu2023_gist_12-1)</sup> Mu, J., et al. (2023). «Learning to Compress Prompts with Gist Tokens». *OpenReview*. <a href="https://openreview.net/forum?id=2DtxPCL3T5" class="external autonumber" rel="nofollow">[4]</a></span>
13. <span id="cite_note-gao2024_selfcp-13">[↑](https://systems-analysis.info/int/Prompt_compression_%E2%80%94_%E3%83%97%E3%83%AD%E3%83%B3%E3%83%97%E3%83%88%E5%9C%A7%E7%B8%AE#cite_ref-gao2024_selfcp_13-0) Gao, C., et al. (2024). «SelfCP: Compressing Over-Limit Prompt via the Frozen Large Language Model Itself». *arXiv*. <a href="https://arxiv.org/html/2405.17052v2" class="external autonumber" rel="nofollow">[5]</a></span>
