TensorX
返回文献探索

Paper · arXiv 2402.02834

Shortened LLaMA: A Simple Depth Pruning for Large Language Models

Bo-Kyeong Kim, Geonmin Kim, Tae-Ho Kim, Thibault Castells, Shinkook Choi, Junho Shin, Hyoung-Kyu Song

17 upvotesFebruary 5, 2024arXiv 预印本
AI 摘要

A depth pruning method for large language models matches width pruning in zero-shot task performance and improves inference speed under memory constraints.

structured pruninglarge language modelswidth pruningdepth pruningprojection weight matricesattention headslayersblockszero-shot task performanceinference efficiencymemory-constrained conditionsbatch sizeslocal devicesedge devices

Abstract

Structured pruning of modern large language models (LLMs) has emerged as a way of decreasing their high computational needs. Width pruning reduces the size of projection weight matrices (e.g., by removing attention heads) while maintaining the number of layers. Depth pruning, in contrast, removes entire layers or blocks, while keeping the size of the remaining weights unchanged. Most current research focuses on either width-only or a blend of width and depth pruning, with little comparative analysis between the two units (width vs. depth) concerning their impact on LLM inference efficiency. In this work, we show that a simple depth pruning approach can compete with recent width pruning methods in terms of zero-shot task performance. Our pruning method boosts inference speeds, especially under memory-constrained conditions that require limited batch sizes for running LLMs, where width pruning is ineffective. We hope this work can help deploy LLMs on local and edge devices.

北京市昌平区探索星信息技术及软件开发工作室

京ICP备2026059466号