让大模型根据输入动态生成任务向量,提升少样本学习效果。
Adaptive Task Vectors for Large Language Models
- 用小模型动态生成适配当前输入的任务向量
- 在未见过的任务上仍保持高准确率,优于传统方法
- 理论证明其表达能力强于LoRA和Prefix-Tuning
上下文学习(ICL)使大语言模型在不更新参数的情况下,仅通过提示中的少量示例即可完成任务。尽管成功,但ICL存在对示例顺序敏感、上下文长度受限及计算效率低等问题。任务向量方法将任务信息压缩为单一向量,但通常基于固定示例集生成,且对所有输入复用,无法根据具体输入调整。这导致当输入与示例不匹配时,泛化性能下降。为此,我们提出自适应任务向量(ATV),一种简单有效的框架:利用小型语言模型动态生成针对每个输入查询的任务向量,并将其转换为适配目标大模型架构的形式,用于引导输出生成。相比ICL和以往向量方法依赖固定示例集与向量,ATV能为每个输入定制化生成任务向量。实验表明,ATV在未见任务上表现出色,具备强大泛化能力。此外,理论分析显示,在相同秩预算下,ATV与LoRA表达等价,且比Prefix-Tuning更具表达力,为其优势提供形式化支持。
原文摘要 · Abstract (English)
In-Context Learning (ICL) enables Large Language Models (LLMs) to perform tasks without parameter updates by conditioning on a few demonstrations provided in the prompt. Despite its success, ICL suffers from several limitations, including sensitivity to demonstration order, context length constraints, and computational inefficiency. To address these challenges, task vector-based approaches compress task information into a single vector. However, these methods typically construct task vectors from fixed sets of demonstrations and reuse them across input queries, without conditioning on the specific input. This limitation can lead models to struggle with effective adaptation when the input query is not well aligned with the underlying demonstrations, consequently degrading their generalization performance on unseen tasks. To overcome this limitation, we propose Adaptive Task Vectors (ATV), a simple and effective framework that dynamically generates task vectors conditioned on each input query. ATV employs a small language model to generate task vectors, which are then transformed to match the target LLM's architecture and applied to guide its output generation. In contrast to ICL and previous vector-based approaches, which rely on fixed demonstration sets and their corresponding vectors, ATV dynamically generates task vectors tailored to each specific input query and task. Consequently, ATV demonstrates strong performance and generalization capabilities, even for unseen tasks. Furthermore, we provide a theoretical analysis indicating that ATV is expressively equivalent to LoRA under equal rank budgets and more expressive than Prefix-Tuning, thereby offering formal support for its representational advantage.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。