Enhancing and Accelerating Large Language Models via Instruction-Aware Contextual Compression

Haowen Hou, Fei Ma, Binwen Bai, Xinxin Zhu, Fei Yu
8/28/2024
cs.CL

No official code found. Best implementation: howard-hou/instruction-aware-contextual-compressor (1 star, Apache-2.0, last commit 2024-07-15).

Abstract

Large Language Models (LLMs) have garnered widespread attention due to their remarkable performance across various tasks. However, to mitigate the issue of hallucinations, LLMs often incorporate retrieval-augmented pipeline to provide them with rich external knowledge and context. Nevertheless, challenges stem from inaccurate and coarse-grained context retrieved from the retriever. Supplying irrelevant context to the LLMs can result in poorer responses, increased inference latency, and higher costs. This paper introduces a method called Instruction-Aware Contextual Compression, which filters out less informative content, thereby accelerating and enhancing the use of LLMs. The experimental results demonstrate that Instruction-Aware Contextual Compression notably reduces memory consumption and minimizes generation latency while maintaining performance levels comparable to those achieved with the use of the full context. Specifically, we achieved a 50% reduction in context-related costs, resulting in a 5% reduction in inference memory usage and a 2.2-fold increase in inference speed, with only a minor drop of 0.047 in Rouge-1. These findings suggest that our method strikes an effective balance between efficiency and performance.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
10Shell, PythonJul 11, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{hou2024enhancing,
  title  = {Enhancing and Accelerating Large Language Models via Instruction-Aware Contextual Compression},
  author = {Haowen Hou and Fei Ma and Binwen Bai and Xinxin Zhu and Fei Yu},
  year   = {2024},
  eprint = {2408.15491},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.15491v1}
}

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/2408.15491.svg)](https://codeofpaper.com/paper/2408.15491)

Discussion