用向量检索动态组合LoRA适配器,零样本搞定新任务
Task-Aware LoRA Adapter Composition via Similarity Retrieval in Vector Databases
- 从22个数据集构建任务向量库,通过相似度检索匹配目标任务
- 线性融合在PIQA上达70.95%、RTE上达77.62%,超越单任务基线
- 无需训练检索器,冻结嵌入,可解释且适合快速部署新任务
参数高效微调方法如LoRA已实现大模型的任务特化,但如何高效组合多个专用适配器应对未见任务仍具挑战。本文提出一种动态LoRA适配器组合框架,利用向量数据库中的相似度检索,实现跨多样NLP任务的零样本泛化。通过22个数据集(涵盖常识推理、问答、自然语言推断、情感分析)的训练样本构建任务感知向量库,在推理时检索最相似样本,通过核采样计算任务相似度分布,并使用检索加权融合策略动态合并相关LoRA适配器。评估了四种融合方法(线性、拼接、TIES、幅度剪枝),结果表明,基于数据集的检索方法通常达到或超过单独微调的专用适配器性能。其中线性融合在PIQA上达70.95%、RTE上达77.62%,显著优于单任务基线(46%和52%)。该框架无需额外训练检索器,嵌入冻结,实现高效、可解释的适配器组合,为无需全模型重训练的可扩展参数高效多任务学习提供了新方向。
原文摘要 · Abstract (English)
Parameter efficient fine tuning methods like LoRA have enabled task specific adaptation of large language models, but efficiently composing multiple specialized adapters for unseen tasks remains challenging. We present a novel framework for dynamic LoRA adapter composition that leverages similarity retrieval in vector databases to enable zero-shot generalization across diverse NLP tasks. Our approach constructs a task-aware vector database by embedding training examples from 22 datasets spanning commonsense reasoning, question answering, natural language inference, and sentiment analysis. At inference time, we retrieve the most similar training examples, compute task similarity distributions via nucleus sampling, and dynamically merge relevant LoRA adapters using retrieval weighted fusion strategies. We evaluated four merging methods Linear, Concatenation, TIES, and Magnitude Prune demonstrating that our dataset centric retrieval approach often matches or exceeds the performance of individually fine-tuned task-specific adapters. Notably, Linear merging achieves 70.95% on PIQA and 77.62% on RTE, substantially outperforming single-task baselines (46% and 52%, respectively). Our framework requires no additional retriever training, operates with frozen embeddings, and enables efficient, interpretable adapter composition. These results suggest that retrieval based dynamic merging offers a promising direction for scalable, parameter-efficient multitask learning without requiring full model retraining for each new task.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。