Pruning as a Domain-specific LLM Extractor

Nan Zhang, Yanchi Liu, Xujiang Zhao, Wei Cheng, Runxue Bao +3 more
5/10/2024
cs.CL

Official code: psunlpgroup/D-Pruner (1 star, last commit 2024-12-19). 1 more implementation below.

Abstract

Large Language Models (LLMs) have exhibited remarkable proficiency across a wide array of NLP tasks. However, the escalation in model size also engenders substantial deployment costs. While few efforts have explored model pruning techniques to reduce the size of LLMs, they mainly center on general or task-specific weights. This leads to suboptimal performance due to lacking specificity on the target domain or generality on different tasks when applied to domain-specific challenges. This work introduces an innovative unstructured dual-pruning methodology, D-Pruner, for domain-specific compression on LLM. It extracts a compressed, domain-specific, and task-agnostic LLM by identifying LLM weights that are pivotal for general capabilities, like linguistic capability and multi-task solving, and domain-specific knowledge. More specifically, we first assess general weight importance by quantifying the error incurred upon their removal with the help of an open-domain calibration dataset. Then, we utilize this general weight importance to refine the training loss, so that it preserves generality when fitting into a specific domain. Moreover, by efficiently approximating weight importance with the refined training loss on a domain-specific calibration dataset, we obtain a pruned model emphasizing generality and specificity. Our comprehensive experiments across various tasks in healthcare and legal domains show the effectiveness of D-Pruner in domain-specific compression. Our code is available at https://github.com/psunlpgroup/D-Pruner.

View on arXivView PDF

Code Implementations(2)

[NAACL Findings 2024] Pruning as a Domain-specific LLM Extractor. Support LLaMA2.

10Sep 15, 20241 years ago

[NAACL Findings 2024] Pruning as a Domain-specific LLM Extractor. Support LLaMA2.

41PythonMay 20, 20242 years ago

Similar Papers

Cite this paper

@article{zhang2024pruning,
  title  = {Pruning as a Domain-specific LLM Extractor},
  author = {Nan Zhang and Yanchi Liu and Xujiang Zhao and Wei Cheng and Runxue Bao and Rui Zhang and Prasenjit Mitra and Haifeng Chen},
  year   = {2024},
  eprint = {2405.06275},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.06275v1}
}

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

Discussion