引导式测验 · 硬 等级
线性注意力和表演者内核测验
检查 softmax 注意力的序列成本、关联重排、FAVOR+ 核近似、随机特征和线性复杂度。
问题 1 的 8
为什么标准的 softmax 注意力随序列长度的变化很差?
预览每个问题8 问题
当您参加测验时,就会出现答案和解释。
- 为什么标准的 softmax 注意力随序列长度的变化很差?
- 它的时间和内存随着序列长度的平方而增长
- 它需要按字母顺序对所有标记进行排序
- 它一次只能处理一个令牌
- 每个令牌需要一个单独的神经网络
- 什么数学属性可以让线性注意力避免 n×n 矩阵?
- 加法的交换律
- 矩阵乘法的结合性
- softmax的分配律
- 特征值分解
- Performer的FAVOR+机制大概是怎样的?
- 梯度下降更新
- 分词器词汇
- Softmax注意力内核
- 层归一化统计
- 为什么 Performer 使用正随机特征而不是早期的三角特征?
- 它们仅在 CPU 上运行速度更快
- 它们消除了任何随机性的需要
- 他们使模型完全可解释
- 它们保证非负注意力权重并提高数值稳定性
- 序列长度 n 中表演者式线性注意力的近似复杂度是多少?
- O(n)
- O(n^2)
- O(n log n)
- O(2^n)
- 与完整的 softmax 注意力相比,纯线性注意力的常见限制是什么?
- 它无法在 GPU 上运行
- 它通常会获得稍低的建模质量
- 它仅适用于图像
- 它需要每个令牌的标记数据
- For attention written as phi(Q)(phi(K)^T V), which multiplication can be done first to avoid creating an n-by-n matrix?
- Compute QK^T and store every pairwise score
- Apply softmax to the full n-by-n matrix first
- Compute phi(K)^T V before multiplying by phi(Q)
- Multiply the final output by the sequence length
- What benefit does using orthogonal random features provide in Performer’s FAVOR+ approximation?
- It guarantees exact softmax for every sequence
- It removes the need for query and key vectors
- It makes attention quadratic in sequence length
- It reduces variance in the random-feature estimate