HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Segmented Recurrent Transformer: An Efficient Sequence-to-Sequence Model

Yinghan Long Sayeed Shafayet Chowdhury Kaushik Roy

Segmented Recurrent Transformer: An Efficient Sequence-to-Sequence Model

Abstract

Transformers have shown dominant performance across a range of domains including language and vision. However, their computational cost grows quadratically with the sequence length, making their usage prohibitive for resource-constrained applications. To counter this, our approach is to divide the whole sequence into segments and apply attention to the individual segments. We propose a segmented recurrent transformer (SRformer) that combines segmented (local) attention with recurrent attention. The loss caused by reducing the attention window length is compensated by aggregating information across segments with recurrent attention. SRformer leverages Recurrent Accumulate-and-Fire (RAF) neurons' inherent memory to update the cumulative product of keys and values. The segmented attention and lightweight RAF neurons ensure the efficiency of the proposed transformer. Such an approach leads to models with sequential processing capability at a lower computation/memory cost. We apply the proposed method to T5 and BART transformers. The modified models are tested on summarization datasets including CNN-dailymail, XSUM, ArXiv, and MediaSUM. Notably, using segmented inputs of varied sizes, the proposed model achieves $6-22\%$ higher ROUGE1 scores than a segmented transformer and outperforms other recurrent transformer approaches. Furthermore, compared to full attention, the proposed model reduces the computational complexity of cross attention by around $40\%$.

Code Repositories

yinghanlong/SRtransformer
jax
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
abstractive-text-summarization-on-cnn-dailySRformer-BART
ROUGE-1: 43.19
ROUGE-2: 19.80
ROUGE-L: 40.40
text-summarization-on-arxivSRformer-BART
ROUGE-1: 42.99
text-summarization-on-mediasumSRformer-BART
ROUGE-1: 32.36
text-summarization-on-xsum-2SRformer-BART
ROUGE-1: 39.02

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Segmented Recurrent Transformer: An Efficient Sequence-to-Sequence Model | Papers | HyperAI