LanguaShrink: Reducing Token Overhead with Psycholinguistics

Xuechen Liang, Meiling Tao, Yinghui Xia, Tianyu Shi, Jun Wang +1 more
9/1/2024
cs.CLstat.ML

No confident code implementation found for this paper.

Abstract

As large language models (LLMs) improve their capabilities in handling complex tasks, the issues of computational cost and efficiency due to long prompts are becoming increasingly prominent. To accelerate model inference and reduce costs, we propose an innovative prompt compression framework called LanguaShrink. Inspired by the observation that LLM performance depends on the density and position of key information in the input prompts, LanguaShrink leverages psycholinguistic principles and the Ebbinghaus memory curve to achieve task-agnostic prompt compression. This effectively reduces prompt length while preserving essential information. We referred to the training method of OpenChat.The framework introduces part-of-speech priority compression and data distillation techniques, using smaller models to learn compression targets and employing a KL-regularized reinforcement learning strategy for training.\cite{wang2023openchat} Additionally, we adopt a chunk-based compression algorithm to achieve adjustable compression rates. We evaluate our method on multiple datasets, including LongBench, ZeroScrolls, Arxiv Articles, and a newly constructed novel test set. Experimental results show that LanguaShrink maintains semantic similarity while achieving up to 26 times compression. Compared to existing prompt compression methods, LanguaShrink improves end-to-end latency by 1.43 times.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liang2024languashrink,
  title  = {LanguaShrink: Reducing Token Overhead with Psycholinguistics},
  author = {Xuechen Liang and Meiling Tao and Yinghui Xia and Tianyu Shi and Jun Wang and JingSong Yang},
  year   = {2024},
  eprint = {2409.00855},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2409.00855v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2409.00855.svg)](https://codeofpaper.com/paper/2409.00855)

Discussion