Prompt-prompted Adaptive Structured Pruning for Efficient LLM Generation

Harry Dong, Beidi Chen, Yuejie Chi
4/1/2024
cs.LGcs.AIcs.CL

Official code: hdong920/GRIFFIN (40 stars, last commit 2024-08-27).

Abstract

With the development of transformer-based large language models (LLMs), they have been applied to many fields due to their remarkable utility, but this comes at a considerable computational cost at deployment. Fortunately, some methods such as pruning or constructing a mixture of experts (MoE) aim at exploiting sparsity in transformer feedforward (FF) blocks to gain boosts in speed and reduction in memory requirements. However, these techniques can be very costly and inflexible in practice, as they often require training or are restricted to specific types of architectures. To address this, we introduce GRIFFIN, a novel training-free and calibration-free method that selects unique FF experts at the sequence level for efficient generation across a plethora of LLMs with different non-ReLU activation functions. This is possible due to a critical observation that many trained LLMs naturally produce highly structured FF activation patterns within a sequence, which we call flocking. Despite our method's simplicity, we show with 50% of the FF parameters, GRIFFIN maintains the original model's performance with little to no degradation on a variety of classification and generation tasks, all while improving latency (e.g. 1.29$\times$ and 1.25$\times$ speed-ups in Gemma 7B and Llama 2 13B, respectively, on an NVIDIA L40). Code is available at https://github.com/hdong920/GRIFFIN.

View on arXivView PDF

Code Implementations(1)

hdong920/GRIFFINOfficial100%
405Shell, PythonMar 31, 20242 years ago

Similar Papers

Cite this paper

@article{dong2024promptprompted,
  title  = {Prompt-prompted Adaptive Structured Pruning for Efficient LLM Generation},
  author = {Harry Dong and Beidi Chen and Yuejie Chi},
  year   = {2024},
  eprint = {2404.01365},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.01365v3}
}

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

Discussion