用剪枝法从大模型中高效提取专精编程的轻量子模型。
Deriving Coding-Specific Sub-Models from LLMs using Resource-Efficient Pruning
- 通过无结构剪枝+领域校准数据,提取代码专用子模型。
- 在4种编程语言上保持接近完整模型的准确率。
- 首次证明代码任务激活模型不同区域,适合本地部署开发。
大型语言模型(LLMs)在复杂代码生成任务中表现卓越,但其广泛应用受限于巨大的计算需求和资源消耗,尤其体现在内存与算力方面。为缓解这一问题,模型剪枝技术被用于创建参数更少的紧凑模型。然而,现有方法未聚焦于高效提取针对编程语言的专用子模型。本文探索通过无结构剪枝(即Wanda)高效衍生编程语言特定的子模型。我们研究了不同领域校准数据集对三类不同领域剪枝效果的影响,并扩展分析至提取四种语言专用子模型:Python、Java、C++ 和 JavaScript。我们首次在使用合适校准数据集的前提下,高效提取出编程语言专用子模型,同时保持与全模型相当的准确性。我们还首次提供分析证据,表明领域特定任务会激活LLM中不同的神经区域,支持通过无结构剪枝构建专业化子模型。该工作有望显著提升代码类LLM的可访问性,降低计算开销,使其可在消费级硬件上本地运行,并支持实时开发反馈所需的快速推理。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated their exceptional performance in various complex code generation tasks. However, their broader adoption is limited by significant computational demands and high resource requirements, particularly memory and processing power. To mitigate such requirements, model pruning techniques are used to create more compact models with significantly fewer parameters. However, current approaches do not focus on the efficient extraction of programming-language-specific sub-models. In this work, we explore the idea of efficiently deriving coding-specific sub-models through unstructured pruning (i.e., Wanda). We investigate the impact of different domain-specific calibration datasets on pruning outcomes across three distinct domains and extend our analysis to extracting four language-specific sub-models: Python, Java, C++, and JavaScript. We are the first to efficiently extract programming-language-specific sub-models using appropriate calibration datasets while maintaining acceptable accuracy w.r.t. full models. We are also the first to provide analytical evidence that domain-specific tasks activate distinct regions within LLMs, supporting the creation of specialized sub-models through unstructured pruning. We believe that this work has significant potential to enhance LLM accessibility for coding by reducing computational requirements to enable local execution on consumer-grade hardware, and supporting faster inference times critical for real-time development feedback.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。