Recurrent Memory-Augmented Transformers with Chunked Attention for Long-Context Language Modeling

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
1. Verfasser: Kashyap, Ankit
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866908428901810176
author Kashyap, Ankit
author_facet Kashyap, Ankit
contents We present a Transformer architecture for long-context language modeling that combines global attention with two biologically inspired components: chunked local attention and a gated FIFO memory mechanism. This unified attention block allows the model to efficiently handle both short-range and long-range dependencies without increasing attention cost quadratically. The memory module persistently stores past token representations using a gated update mechanism inspired by recurrent networks. Rotary positional encoding is applied per attention head to enable directionally disentangled, scale-invariant positional signals. The architecture is implemented entirely from scratch in PyTorch, with no reliance on high-level libraries, enabling transparent and modular experimentation. Our model offers a lightweight and extensible design for tasks such as dialogue modeling, code completion, and document understanding.
format Preprint
id arxiv_https___arxiv_org_abs_2507_00453
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Recurrent Memory-Augmented Transformers with Chunked Attention for Long-Context Language Modeling
Kashyap, Ankit
Machine Learning
F.2.2; I.2.6; I.2.7
We present a Transformer architecture for long-context language modeling that combines global attention with two biologically inspired components: chunked local attention and a gated FIFO memory mechanism. This unified attention block allows the model to efficiently handle both short-range and long-range dependencies without increasing attention cost quadratically. The memory module persistently stores past token representations using a gated update mechanism inspired by recurrent networks. Rotary positional encoding is applied per attention head to enable directionally disentangled, scale-invariant positional signals. The architecture is implemented entirely from scratch in PyTorch, with no reliance on high-level libraries, enabling transparent and modular experimentation. Our model offers a lightweight and extensible design for tasks such as dialogue modeling, code completion, and document understanding.
title Recurrent Memory-Augmented Transformers with Chunked Attention for Long-Context Language Modeling
topic Machine Learning
F.2.2; I.2.6; I.2.7
url https://arxiv.org/abs/2507.00453