FlattenGPT: Transformer中基于层扁平化的深度压缩
FlattenGPT: Depth Compression for Transformer with Layer Flattening
AI总结:
FlattenGPT通过层扁平化技术实现Transformer模型的深度压缩,有效提升效率并保持性能,适用于多种模型类型和参数规模。
摘要:
最近的研究表明,在Transformer块中存在冗余,这促使了深度压缩的研究,以修剪不那么关键的块。然而,当前的整个块修剪方法存在风险,即在这些块中丢弃了有意义的线索,导致性能显著下降。作为另一种模型压缩方法,通道修剪可以更好地保持性能,但无法减少模型深度,并面临对单个层进行不一致修剪比例的挑战。为了追求更好的模型压缩和加速,本文提出了FlattenGPT,一种新的方法来检测和减少深度方向的冗余。通过将两个相邻块合并为一个,它压缩了网络深度,同时使参数冗余检测和去除更加有效。FlattenGPT允许保留所有块中学习到的知识,并保持与原始Transformer架构的一致性。广泛的实验表明,FlattenGPT在性能与效率之间取得了良好的权衡。它在各种模型类型和参数规模下,在零样本准确率和WikiText-2困惑度方面均优于现有的修剪方法。在LLaMA-2/3和Qwen-1.5模型上,FlattenGPT在压缩比为20%的情况下保留了90-96%的零样本性能。它还优于其他修剪方法,在加速LLM推理方面表现突出,使其在提升Transformer效率方面具有前景。
英文摘要:
Recent works have indicated redundancy across transformer blocks, prompting the research of depth compression to prune less crucial blocks. However, current ways of entire-block pruning suffer from risks of discarding meaningful cues learned in those blocks, leading to substantial performance degradation. As another line of model compression, channel pruning can better preserve performance, while it cannot reduce model depth and is challenged by inconsistent pruning ratios for individual layers. To pursue better model compression and acceleration, this paper proposes \textbf{FlattenGPT}, a novel way to detect and reduce depth-wise redundancies. By flatting two adjacent blocks into one, it compresses the network depth, meanwhile enables more effective parameter redundancy detection and removal. FlattenGPT allows to preserve the knowledge learned in all blocks, and remains consistent with the original transformer architecture. Extensive experiments demonstrate that FlattenGPT enhances model efficiency with a decent trade-off to performance. It outperforms existing pruning methods in both zero-shot accuracies and WikiText-2 perplexity across various model types and parameter sizes. On LLaMA-2/3 and Qwen-1.5 models, FlattenGPT retains 90-96\% of zero-shot performance with a compression ratio of 20\%. It also outperforms other pruning methods in accelerating LLM inference, making it promising for enhancing the efficiency of transformers.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。