LLMLingua-2: Datadistillatie voor efficiënte en betrouwbare taakonafhankelijke promptcompressie
LLMLingua-2: Data Distillation for Efficient and Faithful Task-Agnostic Prompt Compression
March 19, 2024
Auteurs: Zhuoshi Pan, Qianhui Wu, Huiqiang Jiang, Menglin Xia, Xufang Luo, Jue Zhang, Qingwei Lin, Victor Rühle, Yuqing Yang, Chin-Yew Lin, H. Vicky Zhao, Lili Qiu, Dongmei Zhang
cs.AI
Samenvatting
Dit artikel richt zich op taakonafhankelijke promptcompressie voor betere generaliseerbaarheid en efficiëntie. Gezien de redundantie in natuurlijke taal comprimeren bestaande benaderingen prompts door tokens of lexicale eenheden te verwijderen op basis van hun informatie-entropie, verkregen uit een causaal taalmodel zoals LLaMa-7B. De uitdaging is dat informatie-entropie een suboptimale compressiemetriek kan zijn: (i) het maakt alleen gebruik van unidirectionele context en kan essentiële informatie die nodig is voor promptcompressie missen; (ii) het is niet afgestemd op het doel van promptcompressie.
Om deze problemen aan te pakken, stellen we een datadestillatieprocedure voor om kennis af te leiden uit een LLM om prompts te comprimeren zonder cruciale informatie te verliezen, en introduceren tegelijkertijd een extractieve tekstcompressiedataset. We formuleren promptcompressie als een tokenclassificatieprobleem om de trouwheid van de gecomprimeerde prompt aan de originele te garanderen, en gebruiken een Transformer-encoder als basisarchitectuur om alle essentiële informatie voor promptcompressie uit de volledige bidirectionele context vast te leggen. Onze aanpak resulteert in lagere latentie door het compressiedoel expliciet te leren met kleinere modellen zoals XLM-RoBERTa-large en mBERT.
We evalueren onze methode op zowel in-domein als out-of-domein datasets, waaronder MeetingBank, LongBench, ZeroScrolls, GSM8K en BBH. Ondanks zijn kleine omvang toont ons model significante prestatieverbeteringen ten opzichte van sterke baselinemodellen en demonstreert het robuuste generalisatievermogen over verschillende LLMs. Daarnaast is ons model 3x-6x sneller dan bestaande promptcompressiemethoden, terwijl het de end-to-end latentie versnelt met 1.6x-2.9x bij compressieverhoudingen van 2x-5x.
English
This paper focuses on task-agnostic prompt compression for better
generalizability and efficiency. Considering the redundancy in natural
language, existing approaches compress prompts by removing tokens or lexical
units according to their information entropy obtained from a causal language
model such as LLaMa-7B. The challenge is that information entropy may be a
suboptimal compression metric: (i) it only leverages unidirectional context and
may fail to capture all essential information needed for prompt compression;
(ii) it is not aligned with the prompt compression objective.
To address these issues, we propose a data distillation procedure to derive
knowledge from an LLM to compress prompts without losing crucial information,
and meantime, introduce an extractive text compression dataset. We formulate
prompt compression as a token classification problem to guarantee the
faithfulness of the compressed prompt to the original one, and use a
Transformer encoder as the base architecture to capture all essential
information for prompt compression from the full bidirectional context. Our
approach leads to lower latency by explicitly learning the compression
objective with smaller models such as XLM-RoBERTa-large and mBERT.
We evaluate our method on both in-domain and out-of-domain datasets,
including MeetingBank, LongBench, ZeroScrolls, GSM8K, and BBH. Despite its
small size, our model shows significant performance gains over strong baselines
and demonstrates robust generalization ability across different LLMs.
Additionally, our model is 3x-6x faster than existing prompt compression
methods, while accelerating the end-to-end latency by 1.6x-2.9x with
compression ratios of 2x-5x.