Enhancing Learned Knowledge in LoRA Adapters Through Efficient Contrastive Decoding on Ascend NPUs

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Heisler, Morgan Lindsay, Xing, Linzi, Shi, Ge, Sadri, Hanieh, Singh, Gursimran, Zhang, Weiwei, Ye, Tao, Xiong, Ying, Zhang, Yong, Fan, Zhenan
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915529917202432
author Heisler, Morgan Lindsay
Xing, Linzi
Shi, Ge
Sadri, Hanieh
Singh, Gursimran
Zhang, Weiwei
Ye, Tao
Xiong, Ying
Zhang, Yong
Fan, Zhenan
author_facet Heisler, Morgan Lindsay
Xing, Linzi
Shi, Ge
Sadri, Hanieh
Singh, Gursimran
Zhang, Weiwei
Ye, Tao
Xiong, Ying
Zhang, Yong
Fan, Zhenan
contents Huawei Cloud users leverage LoRA (Low-Rank Adaptation) as an efficient and scalable method to fine-tune and customize large language models (LLMs) for application-specific needs. However, tasks that require complex reasoning or deep contextual understanding are often hindered by biases or interference from the base model when using typical decoding methods like greedy or beam search. These biases can lead to generic or task-agnostic responses from the base model instead of leveraging the LoRA-specific adaptations. In this paper, we introduce Contrastive LoRA Decoding (CoLD), a novel decoding framework designed to maximize the use of task-specific knowledge in LoRA-adapted models, resulting in better downstream performance. CoLD uses contrastive decoding by scoring candidate tokens based on the divergence between the probability distributions of a LoRA-adapted expert model and the corresponding base model. This approach prioritizes tokens that better align with the LoRA's learned representations, enhancing performance for specialized tasks. While effective, a naive implementation of CoLD is computationally expensive because each decoding step requires evaluating multiple token candidates across both models. To address this, we developed an optimized kernel for Huawei's Ascend NPU. CoLD achieves up to a 5.54% increase in task accuracy while reducing end-to-end latency by 28% compared to greedy decoding. This work provides practical and efficient decoding strategies for fine-tuned LLMs in resource-constrained environments and has broad implications for applied data science in both cloud and on-premises settings.
format Preprint
id arxiv_https___arxiv_org_abs_2505_14620
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Enhancing Learned Knowledge in LoRA Adapters Through Efficient Contrastive Decoding on Ascend NPUs
Heisler, Morgan Lindsay
Xing, Linzi
Shi, Ge
Sadri, Hanieh
Singh, Gursimran
Zhang, Weiwei
Ye, Tao
Xiong, Ying
Zhang, Yong
Fan, Zhenan
Machine Learning
Computation and Language
Huawei Cloud users leverage LoRA (Low-Rank Adaptation) as an efficient and scalable method to fine-tune and customize large language models (LLMs) for application-specific needs. However, tasks that require complex reasoning or deep contextual understanding are often hindered by biases or interference from the base model when using typical decoding methods like greedy or beam search. These biases can lead to generic or task-agnostic responses from the base model instead of leveraging the LoRA-specific adaptations. In this paper, we introduce Contrastive LoRA Decoding (CoLD), a novel decoding framework designed to maximize the use of task-specific knowledge in LoRA-adapted models, resulting in better downstream performance. CoLD uses contrastive decoding by scoring candidate tokens based on the divergence between the probability distributions of a LoRA-adapted expert model and the corresponding base model. This approach prioritizes tokens that better align with the LoRA's learned representations, enhancing performance for specialized tasks. While effective, a naive implementation of CoLD is computationally expensive because each decoding step requires evaluating multiple token candidates across both models. To address this, we developed an optimized kernel for Huawei's Ascend NPU. CoLD achieves up to a 5.54% increase in task accuracy while reducing end-to-end latency by 28% compared to greedy decoding. This work provides practical and efficient decoding strategies for fine-tuned LLMs in resource-constrained environments and has broad implications for applied data science in both cloud and on-premises settings.
title Enhancing Learned Knowledge in LoRA Adapters Through Efficient Contrastive Decoding on Ascend NPUs
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2505.14620