ChatPaper.aiChatPaper

LoftQ: Quantização Consciente de Fine-Tuning LoRA para Modelos de Linguagem de Grande Escala

LoftQ: LoRA-Fine-Tuning-Aware Quantization for Large Language Models

October 12, 2023
Autores: Yixiao Li, Yifan Yu, Chen Liang, Pengcheng He, Nikos Karampatziakis, Weizhu Chen, Tuo Zhao
cs.AI

Resumo

A quantização é uma técnica indispensável para o serviço de Grandes Modelos de Linguagem (LLMs) e recentemente encontrou seu caminho no ajuste fino LoRA. Neste trabalho, focamos no cenário em que a quantização e o ajuste fino LoRA são aplicados juntos em um modelo pré-treinado. Nesses casos, é comum observar uma lacuna consistente no desempenho em tarefas subsequentes entre a abordagem de ajuste fino completo e a abordagem de quantização mais ajuste fino LoRA. Em resposta, propomos o LoftQ (Quantização Consciente do Ajuste Fino LoRA), uma nova estrutura de quantização que simultaneamente quantiza um LLM e encontra uma inicialização de baixa classificação adequada para o ajuste fino LoRA. Tal inicialização alivia a discrepância entre o modelo quantizado e o modelo de precisão completa e melhora significativamente a generalização em tarefas subsequentes. Avaliamos nosso método em tarefas de compreensão de linguagem natural, resposta a perguntas, sumarização e geração de linguagem natural. Os experimentos mostram que nosso método é altamente eficaz e supera os métodos de quantização existentes, especialmente nos regimes desafiadores de precisão mista de 2 bits e 2/4 bits. Liberaremos nosso código.
English
Quantization is an indispensable technique for serving Large Language Models (LLMs) and has recently found its way into LoRA fine-tuning. In this work we focus on the scenario where quantization and LoRA fine-tuning are applied together on a pre-trained model. In such cases it is common to observe a consistent gap in the performance on downstream tasks between full fine-tuning and quantization plus LoRA fine-tuning approach. In response, we propose LoftQ (LoRA-Fine-Tuning-aware Quantization), a novel quantization framework that simultaneously quantizes an LLM and finds a proper low-rank initialization for LoRA fine-tuning. Such an initialization alleviates the discrepancy between the quantized and full-precision model and significantly improves the generalization in downstream tasks. We evaluate our method on natural language understanding, question answering, summarization, and natural language generation tasks. Experiments show that our method is highly effective and outperforms existing quantization methods, especially in the challenging 2-bit and 2/4-bit mixed precision regimes. We will release our code.
PDF284December 14, 2025