arXiv:2410.14766cs.SEcs.AI2024-10被引 17

4-bit量化让70亿参数模型在低资源语言上运行,兼顾性能与设备兼容性。

Evaluating Quantized Large Language Models for Code Generation on Low-Resource Language Benchmarks

  • 用2/4/8位整数量化70亿参数代码大模型,在消费级笔记本上测试表现。
  • 4比特精度下模型性能最优,且显著优于小参数非量化模型。
  • 虽提升可部署性,但整体生成能力仍远低于GPT-4o等主流模型。

人工智能的普及是数字鸿沟议题的重要组成部分。大型语言模型(LLM)作为智能助手日益流行,但其高算力需求限制了可访问性。本研究评估量化是否可使LLM在通用消费设备上运行。实验测试了五个量化后的代码生成模型在Lua语言任务中的表现。采用70亿参数模型分别在2、4、8位整数精度下运行,并与13亿、20亿、30亿参数的非量化模型对比。选择低资源语言Lua以避免对高资源语言的偏差。结果表明,4位整数量化模型在性能与模型大小间取得最佳平衡,可在无专用显卡的普通笔记本上流畅运行。2位量化性能显著下降,8位量化推理时间更长但未带来性能提升。4位量化模型尽管参数量达70亿,存储与内存占用与较小模型相当,却仍大幅超越参数更低的非量化模型。量化确实提升了70亿参数模型的可访问性,但在高精度、低资源任务如Lua代码生成中整体性能不足50%,实用性仍未达到GPT-4o或Llama 3.1 405B等基础模型水平。

原文摘要 · Abstract (English)

Democratization of AI is an important topic within the broader topic of the digital divide. This issue is relevant to LLMs, which are becoming popular as AI co-pilots but suffer from a lack of accessibility due to high computational demand. In this study, we evaluate whether quantization is a viable approach toward enabling LLMs on generic consumer devices. The study assesses the performance of five quantized code LLMs in Lua code generation tasks. To evaluate the impact of quantization, the models with 7B parameters were tested on a consumer laptop at 2-, 4-, and 8-bit integer precisions and compared to non-quantized code LLMs with 1.3, 2, and 3 billion parameters. Lua is chosen as a low-level resource language to avoid models' biases related to high-resource languages. The results suggest that the models quantized at the 4-bit integer precision offer the best trade-off between performance and model size. These models can be comfortably deployed on an average laptop without a dedicated GPU. The performance significantly drops at the 2-bit integer precision. The models at 8-bit integer precision require more inference time that does not effectively translate to better performance. The 4-bit models with 7 billion parameters also considerably outperform non-quantized models with lower parameter numbers despite having comparable model sizes with respect to storage and memory demand. While quantization indeed increases the accessibility of smaller LLMs with 7 billion parameters, these LLMs demonstrate overall low performance (less than 50\%) on high-precision and low-resource tasks such as Lua code generation. While accessibility is improved, usability is still not at the practical level comparable to foundational LLMs such as GPT-4o or Llama 3.1 405B.

量化代码生成低资源LLM部署

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。