Fast Monte-Carlo Approximation of the Attention Mechanism

被引:0
|
作者
Kim, Hyunjun [1 ]
Ko, JeongGil [1 ]
机构
[1] Yonsei Univ, Sch Integrated Technol, Seoul, South Korea
关键词
D O I
暂无
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
We introduce Monte-Carlo Attention (MCA), a randomized approximation method for reducing the computational cost of self-attention mechanisms in Transformer architectures. MCA exploits the fact that the importance of each token in an input sequence vary with respect to their attention scores; thus, some degree of error can be tolerable when encoding tokens with low attention. Using approximate matrix multiplication, MCA applies different error bounds to encode input tokens such that those with low attention scores are computed with relaxed precision, whereas errors of salient elements are minimized MCA can operate in parallel with other attention optimization schemes and does not require model modification. We study the theoretical error bounds and demonstrate that MCA reduces attention complexity (in FLOPS) for various Transformer models by up to 11 x in GLUE benchmarks without compromising model accuracy. Source code and appendix: https://github.com/eis-lab/monte-carlo-attention
引用
收藏
页码:7185 / 7193
页数:9
相关论文
共 50 条
  • [1] A Monte-Carlo AIXI Approximation
    Veness, Joel
    Kee Siong Ng
    Hutter, Marcus
    Uther, William
    Silver, David
    JOURNAL OF ARTIFICIAL INTELLIGENCE RESEARCH, 2011, 40 : 95 - 142
  • [2] PROJECTOR APPROXIMATION AND QUANTUM MONTE-CARLO
    FYE, RM
    INTERNATIONAL JOURNAL OF MODERN PHYSICS C-PHYSICS AND COMPUTERS, 1994, 5 (03): : 483 - 488
  • [3] MONTE-CARLO APPROXIMATION AND THE ITERATED BOOTSTRAP
    BOOTH, JG
    HALL, P
    BIOMETRIKA, 1994, 81 (02) : 331 - 340
  • [4] A FAST PROCESSOR FOR MONTE-CARLO SIMULATION
    PEARSON, RB
    RICHARDSON, JL
    TOUSSAINT, D
    JOURNAL OF COMPUTATIONAL PHYSICS, 1983, 51 (02) : 241 - 249
  • [5] FAST ALGORITHMS FOR FERMIONIC MONTE-CARLO
    DEFORCRAND, P
    STAMATESCU, IO
    NUCLEAR PHYSICS B, 1985, 261 (04) : 613 - 632
  • [6] MONTE-CARLO APPROXIMATION ALGORITHMS FOR ENUMERATION PROBLEMS
    KARP, RM
    LUBY, M
    MADRAS, N
    JOURNAL OF ALGORITHMS, 1989, 10 (03) : 429 - 448
  • [7] Monte-Carlo approximation of minimum entropy measures
    Jourdain, B
    Nguyen, L
    COMPTES RENDUS DE L ACADEMIE DES SCIENCES SERIE I-MATHEMATIQUE, 2001, 332 (04): : 345 - 350
  • [8] FAST MONTE-CARLO SIMULATION USING A SUPERCOMPUTER
    HIDAKA, T
    HASEGAWA, S
    IDA, Y
    NEC RESEARCH & DEVELOPMENT, 1987, (85): : 23 - 28
  • [9] FAST MONTE-CARLO ALGORITHMS FOR KNOTTED POLYMERS
    QUAKE, SR
    PHYSICAL REVIEW E, 1995, 52 (01) : 1176 - 1180
  • [10] FAST MONTE-CARLO SIMULATION OF MBE GROWTH
    MAKSYM, PA
    SEMICONDUCTOR SCIENCE AND TECHNOLOGY, 1988, 3 (06) : 594 - 596