IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs

Yuzhen Mao, Martin Ester, Ke Li
5/5/2024
cs.LG

No official code found. Best implementation: yuzhenmao/IceFormer (25 stars, MPL-2.0, last commit 2026-02-22).

Abstract

One limitation of existing Transformer-based models is that they cannot handle very long sequences as input since their self-attention operations exhibit quadratic time and space complexity. This problem becomes especially acute when Transformers are deployed on hardware platforms equipped only with CPUs. To address this issue, we propose a novel method for accelerating self-attention at inference time that works with pretrained Transformer models out-of-the-box without requiring retraining. We experiment using our method to accelerate various long-sequence Transformers, including a leading LLaMA 2-based LLM, on various benchmarks and demonstrate a greater speedup of 2.73x - 7.63x while retaining 98.6% - 99.6% of the accuracy of the original pretrained models. The code is available on our project website at https://yuzhenmao.github.io/IceFormer/.

View on arXivView PDF

Code Implementations(1)

MPL-2.0

Implementation for IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs (ICLR 2024).

252C, C++Jan 28, 20248 months agoMPL-2.0

Similar Papers

Cite this paper

@article{mao2024iceformer,
  title  = {IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs},
  author = {Yuzhen Mao and Martin Ester and Ke Li},
  year   = {2024},
  eprint = {2405.02842},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.02842v1},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.02842.svg)](https://codeofpaper.com/paper/2405.02842)

Discussion