跳到正文
原文
Hugging Face Blog·· 2022-08-02AI 评分22

Nyströmformer:用 Nyström 方法以线性时间与内存近似自注意力

Nyströmformer: Approximating self-attention in linear time and memory via the Nyström method

AI 导读

Nyströmformer 通过 Nyström 方法近似标准自注意力,将时间和内存复杂度从 O(n²) 降至 O(n)。它不直接对 softmax 矩阵采样,而是从 query 和 key 中选取 landmark,用分段均值构造 Q̃、K̃,并据此构建三个矩阵完成近似。实验显示仅选 32 或 64 个 landmark 即可在 n=4096 或 8192 的长序列上取得有竞争力的性能。

来源:Hugging Face Blog · huggingface.co