Enhancing Transformer RNNs with Multiple Temporal Perspectives

Razvan-Gabriel Dumitru, Darius Peteleaza, Mihai Surdeanu
2/4/2024
cs.LGcs.AIcs.CL

Official code: RazvanDu/TemporalRNNs (7 stars, last commit 2024-07-16).

Abstract

We introduce the concept of multiple temporal perspectives, a novel approach applicable to Recurrent Neural Network (RNN) architectures for enhancing their understanding of sequential data. This method involves maintaining diverse temporal views of previously encountered text, significantly enriching the language models' capacity to interpret context. To show the efficacy of this approach, we incorporate it into the Receptance Weighted Key Value (RWKV) architecture, addressing its inherent challenge of retaining all historical information within a single hidden state. Notably, this improvement is achieved with a minimal increase in the number of parameters --even as little as $0.04\%$ of the original number of parameters. Further, the additional parameters necessary for the multiple temporal perspectives are fine-tuned with minimal computational overhead, avoiding the need for a full pre-training. The resulting model maintains linear computational complexity during prompt inference, ensuring consistent efficiency across various sequence lengths. The empirical results and ablation studies included in our research validate the effectiveness of our approach, showcasing improved performance across multiple benchmarks. The code, model weights and datasets are open-sourced at: https://github.com/RazvanDu/TemporalRNNs.

View on arXivView PDF

Code Implementations(1)

Research project on the capabilities of RNNs.

70C++, CudaAug 20, 20232 years ago

Cite this paper

@article{dumitru2024enhancing,
  title  = {Enhancing Transformer RNNs with Multiple Temporal Perspectives},
  author = {Razvan-Gabriel Dumitru and Darius Peteleaza and Mihai Surdeanu},
  year   = {2024},
  eprint = {2402.02625},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.02625v2}
}

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

Discussion