Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer Inference

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Fei, Weizhi, Niu, Xueyan, Xie, Guoqing, Liu, Yingqing, Bai, Bo, Han, Wei
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917913189941248
author Fei, Weizhi
Niu, Xueyan
Xie, Guoqing
Liu, Yingqing
Bai, Bo
Han, Wei
author_facet Fei, Weizhi
Niu, Xueyan
Xie, Guoqing
Liu, Yingqing
Bai, Bo
Han, Wei
contents Although applications involving long-context inputs are crucial for the effective utilization of large language models (LLMs), they also result in increased computational costs and reduced performance. To address this challenge, we propose an efficient, training-free prompt compression method that retains key information within compressed prompts. We identify specific attention heads in transformer-based LLMs, which we designate as evaluator heads, that are capable of selecting tokens in long inputs that are most significant for inference. Building on this discovery, we develop EHPC, an Evaluator Head-based Prompt Compression method, which enables LLMs to rapidly "skim through" input prompts by leveraging only the first few layers with evaluator heads during the pre-filling stage, subsequently passing only the important tokens to the model for inference. EHPC achieves state-of-the-art results across two mainstream benchmarks: prompt compression and long-context inference acceleration. Consequently, it effectively reduces the complexity and costs associated with commercial API calls. We further demonstrate that EHPC attains competitive results compared to key-value cache-based acceleration methods, thereby highlighting its potential to enhance the efficiency of LLMs for long-context tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2501_12959
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer Inference
Fei, Weizhi
Niu, Xueyan
Xie, Guoqing
Liu, Yingqing
Bai, Bo
Han, Wei
Computation and Language
Although applications involving long-context inputs are crucial for the effective utilization of large language models (LLMs), they also result in increased computational costs and reduced performance. To address this challenge, we propose an efficient, training-free prompt compression method that retains key information within compressed prompts. We identify specific attention heads in transformer-based LLMs, which we designate as evaluator heads, that are capable of selecting tokens in long inputs that are most significant for inference. Building on this discovery, we develop EHPC, an Evaluator Head-based Prompt Compression method, which enables LLMs to rapidly "skim through" input prompts by leveraging only the first few layers with evaluator heads during the pre-filling stage, subsequently passing only the important tokens to the model for inference. EHPC achieves state-of-the-art results across two mainstream benchmarks: prompt compression and long-context inference acceleration. Consequently, it effectively reduces the complexity and costs associated with commercial API calls. We further demonstrate that EHPC attains competitive results compared to key-value cache-based acceleration methods, thereby highlighting its potential to enhance the efficiency of LLMs for long-context tasks.
title Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer Inference
topic Computation and Language
url https://arxiv.org/abs/2501.12959