DLP-LoRA: Efficient Task-Specific LoRA Fusion with a Dynamic, Lightweight Plugin for Large Language Models

Yuxuan Zhang, Ruizhe Li · DOI

Abstract

Large Language Models (LLMs) are increasingly fine-tuned for specialized tasks using Low-Rank Adaptation (LoRA). However, effectively combining multiple task-specific LoRAs without significant inference overhead remains a challenge. We introduce DLP-LoRA (Dynamic Lightweight Plugin), a framework that utilizes a 5-million-parameter plugin to dynamically fuse multiple adapters at the sentence level. By shifting decision-making from token-level to sentence-level and leveraging parallel CUDA acceleration, DLP-LoRA achieves state-of-the-art multi-task performance with inference speeds nearly identical to single-task models.

Introduction

Low-Rank Adaptation (LoRA) has become the standard for efficient LLM fine-tuning. While individual LoRAs excel at specific tasks, real-world applications often require a model to handle diverse domains simultaneously. Existing "Mixture-of-LoRAs" (MoE) methods typically rely on token-level gating, where a routing decision is made for every generated word. This approach is computationally expensive, redundant for intra-sentence tokens, and introduces a significant "inference tax."

DLP-LoRA addresses these inefficiencies by implementing a sentence-level routing mechanism. This allows the model to maintain high specialized performance across dozens of tasks while scaling without the latency penalties common in current dynamic fusion methods.

Methods

The core of DLP-LoRA is a shift in the granularity of adaptation from individual tokens to full sentences.

The DLP-LoRA architecture featuring the Mini-MLP plugin and sentence-level routing mechanism.

1. Mini-MLP Plugin ($C_{MLP}$)

The system employs a lightweight 4-layer MLP with only 5 million parameters. This plugin acts as a router, classifying input sentences into task categories based on initial context.

2. Sentence-Level Routing

Unlike token-level routers, the DLP-LoRA plugin activates only at the first token of a new sentence. It determines the relevance of available LoRAs for the entire upcoming sequence, drastically reducing redundant computations.

3. Top-p Sampling and Parallel Acceleration

Instead of a fixed Top-k selection, DLP-LoRA uses a probability threshold ($p$) to adaptively decide the number of LoRAs to fuse. To ensure this fusion does not slow down generation, the authors developed parallel CUDA kernels that compute the outputs of multiple selected LoRAs simultaneously, maximizing GPU utilization.

Key Results

DLP-LoRA was evaluated across 26 diverse tasks, including logic, math, summarization, and translation, using backbones such as Qwen-2, LLaMA-2, and LLaMA-3.

Comparative performance of DLP-LoRA against various baselines across Accuracy, BLEU, and ROUGE metrics.
  • Performance: DLP-LoRA achieved an average accuracy of 91.9% on multiple-choice tasks, matching or exceeding specialized models. It also showed significant improvements in BLEU (54.1%) and ROUGE scores compared to other fusion baselines.
  • Efficiency: The framework maintains a decoding latency ratio of just 1.20x compared to a base LLM. On a LLaMA-2 7B backbone, it proved to be 353.8% faster than competing dynamic LoRA methods like MeteoRA.
  • Scalability: Due to the lightweight nature of the plugin and parallel acceleration, the system can scale to over 100 LoRAs with negligible impact on inference time.

Conclusion and Future Work

DLP-LoRA demonstrates that sentence-level routing is a highly effective and efficient alternative to token-level gating for multi-task LLMs. While current evaluations focused on models up to 8B parameters, future work will explore the framework's performance on larger "frontier" models and its ability to maintain context across long-form, multi-turn conversations.

Summary updated

BibTeX
@misc{zhang2024dlp,
  author = {Yuxuan Zhang and Ruizhe Li},
  title = {{DLP-LoRA: Efficient Task-Specific LoRA Fusion with a Dynamic, Lightweight Plugin for Large Language Models}},
  year = {2024},
  eprint = {2410.01497},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.01497},
}
Figure