Skip to main content
QUICK REVIEW

[论文解读] On the Role of Attention in Prompt-tuning

Samet Oymak, Ankit Singh Rawat|arXiv (Cornell University)|Jun 6, 2023
Topic Modeling被引用 4
一句话总结

本文提供了对基于注意力机制模型中提示调优(prompt-tuning)的首个理论分析,表明在上下文混合模型下,softmax提示注意力机制在表达能力上严格优于自注意力机制或线性提示注意力机制。研究证明,对提示注意力机制进行梯度下降可实现接近最优的样本复杂度,并能实现对稀疏、上下文相关标记的精确注意力,且测试误差随上下文强度增加呈指数下降。

ABSTRACT

Prompt-tuning is an emerging strategy to adapt large language models (LLM) to downstream tasks by learning a (soft-)prompt parameter from data. Despite its success in LLMs, there is limited theoretical understanding of the power of prompt-tuning and the role of the attention mechanism in prompting. In this work, we explore prompt-tuning for one-layer attention architectures and study contextual mixture-models where each input token belongs to a context-relevant or -irrelevant set. We isolate the role of prompt-tuning through a self-contained prompt-attention model. Our contributions are as follows: (1) We show that softmax-prompt-attention is provably more expressive than softmax-self-attention and linear-prompt-attention under our contextual data model. (2) We analyze the initial trajectory of gradient descent and show that it learns the prompt and prediction head with near-optimal sample complexity and demonstrate how prompt can provably attend to sparse context-relevant tokens. (3) Assuming a known prompt but an unknown prediction head, we characterize the exact finite sample performance of prompt-attention which reveals the fundamental performance limits and the precise benefit of the context information. We also provide experiments that verify our theoretical insights on real datasets and demonstrate how prompt-tuning enables the model to attend to context-relevant information.

研究动机与目标

  • 为了从理论上理解提示调优在基于注意力机制模型中的表达能力与优化动态。
  • 为了分离softmax注意力机制在实现对上下文相关标记的有效、稀疏注意力中的作用。
  • 为了刻画当提示已知但预测头未知时,提示注意力机制的有限样本性能。
  • 为了在受控数据模型下,将提示调优的泛化与优化行为与自注意力机制和线性提示注意力机制进行比较。
  • 为了通过在合成数据集和真实世界图像分类数据集上的实验验证理论洞察。

提出的方法

  • 提出了一种基于单层注意力架构的自包含提示注意力模型,包含软提示和线性分类头。
  • 引入了一种上下文混合模型,将输入标记划分为相关(R)和无关(R^c)两组,以实现对注意力行为的受控分析。
  • 利用总体水平模型分析梯度下降的初始轨迹,表明早期步骤中能以接近最优的样本复杂度学习提示和分类头。
  • 推导出一个总体水平定理(定理2),证明在足够强的上下文强度Q和步长γ下,测试误差以 e^{-cQ²/σ²} 的速度指数衰减。
  • 提供有限样本分析(定理3),通过去偏处理纠正上下文向量的影响,表明模型能以高概率关注相关标记并实现低测试误差。
  • 在训练中引入去偏步骤,以隔离提示在标记选择中的作用与最终预测的关系,从而简化泛化分析。

实验结果

研究问题

  • RQ1在受控数据模型下,提示调优结合softmax注意力机制与自注意力机制或线性提示注意力机制相比,其表达能力如何?
  • RQ2在早期训练阶段,能否通过梯度下降在提示注意力机制上实现对稀疏、上下文相关标记的可证明注意力,同时忽略无关标记?
  • RQ3当提示已知但预测头未知时,提示注意力机制的有限样本性能如何?其与上下文强度和稀疏性的关系如何?
  • RQ4注意力机制中的softmax非线性如何促进提示调优在高维、稀疏设置下的优化与泛化?
  • RQ5在稀疏性(相关标记的比例)、上下文强度以及提示向量与分类器向量之间相关性之间,存在哪些根本性权衡?

主要发现

  • 在上下文混合模型下,softmax提示注意力机制在表达能力上严格优于自注意力机制和线性提示注意力机制。
  • 梯度下降的初始轨迹能以接近最优的样本复杂度学习提示和分类头,仅在少数步骤内即达到高准确率。
  • 当上下文强度Q和步长γ足够大时,测试误差以 e^{-cα²Q²/σ²} 的速度指数衰减,实现对相关标记的近乎完美注意力。
  • 在有限样本设置下,当 n ≳ d(Q/ζW)^4 log⁵(nd) 时,模型能以高概率关注相关标记:对 t ∈ R 有 aₜ ≥ (1−ε)/(ζT),对 t ∉ R 有 aₜ ≤ ε/((1−ζ)T)。
  • 模型的测试误差被限制在 2Te^{-cα²Q²} 以内,表明在稀疏设置下(ζ = O(1/√T))相比线性模型具有指数级改进。
  • 分析表明,对相关标记实现有效注意力的关键在于提示向量在能量上必须显著主导分类器向量,尤其当 ρ ≠ 0 时。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。