Efficient transformers

本文概述了Transformer模型面临的O(N^2)挑战,介绍了几种优化方法,如固定模式、组合模式和可学习模式等。Cosformer通过精准的softmax近似解决了效率问题。重点在于滑动窗口与两级注意力设计。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

读书笔记

Efficient transformers: a survey

1.挑战
Transforers O ( N 2 ) O(N^2) O(N2)的时间和空间复杂度是挑战。
2.分类
(1)fixed patterns: block patterns利用局部Attention;strided Patterns 类似于dilated cnn的操作;Compressed patterns 压缩序列长度
(2)combination of patterns:为了提高整体的交互程度
(3)learnable patterns:想利用数据自己学习一个普遍的交互pattern
(4)Neural memory,
(5)low rank :矩阵降维
(6)kernels:核
(7)recurrence
(8)downsampling,减少序列长度
(9)sparse and conditional computation:

Poolingformer(ICML2021)

  1. challenge, O ( N 2 ) O(N^2) O(N2)
  2. main idea:
    revises the full self-attention to a two-level attention.
    (1)first level: sliding window pattern focuses on neighbor tokens.
    (2)second level: increase recptive field and perform attention over pooled key and value.
  3. Although this work is easy, effective and efficient, there are no explanations to why propose this architecher and why this model works. It is a little confusing to me.

cosformer(ICLR2022)

1.challenge, O ( N 2 ) O(N^2) O(N2).
2.Previous work deficiency. introduce additional yet often impractical assumptions on attention weights. or utilize approximation of softmax.
3.main focus: accurate and efficient softmax approximation.
4.key properties to softmax: (1)non-negtive (2)non-linear reweighting.
5.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值