Chunk, Align, Select: A Simple Long-sequence Processing Method for Transformers

Jiawen Xie, Pengyu Cheng, Xiao Liang, Yong Dai, Nan Du
8/25/2023
cs.CLcs.AI

No official code found. Best implementation: xjw-nlp/SimCAS (6 stars, Apache-2.0, last commit 2024-08-16).

Abstract

Although dominant in natural language processing, transformer-based models remain challenged by the task of long-sequence processing, because the computational cost of self-attention operations in transformers swells quadratically with the input sequence length. To alleviate the complexity of long-sequence processing, we propose a simple framework to enable the offthe-shelf pre-trained transformers to process much longer sequences, while the computation and memory costs remain growing linearly with the input sequence lengths. More specifically, our method divides each long-sequence input into a batch of chunks, then aligns the interchunk information during the encoding steps, and finally selects the most representative hidden states from the encoder for the decoding process. To extract inter-chunk semantic information, we align the start and end token embeddings among chunks in each encoding transformer block. To learn an effective hidden selection policy, we design a dual updating scheme inspired by reinforcement learning, which regards the decoders of transformers as environments, and the downstream performance metrics as the rewards to evaluate the hidden selection actions. Our empirical results on real-world long-text summarization and reading comprehension tasks demonstrate effective improvements compared to prior longsequence processing baselines.

View on arXivView PDF

Code Implementations(1)

xjw-nlp/SimCASCommunity100%
Apache-2.0

a simple long sequence processing method for transformers

61Shell, PythonSep 14, 20232 years agoApache-2.0

Similar Papers

Cite this paper

@article{xie2023chunk,
  title  = {Chunk, Align, Select: A Simple Long-sequence Processing Method for Transformers},
  author = {Jiawen Xie and Pengyu Cheng and Xiao Liang and Yong Dai and Nan Du},
  year   = {2023},
  eprint = {2308.13191},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.13191v2}
}

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/2308.13191.svg)](https://codeofpaper.com/paper/2308.13191)

Discussion