← Home

BCMT: Efficient Long-Context Transformers via Block Memory

By James Trappett · 18 August 2026

5 min read

The quadratic scaling of self-attention with sequence length remains one of the most consequential bottlenecks in modern language modeling. As context windows grow, the memory and compute demands of dense attention become prohibitive, motivating a steady stream of architectural alternatives. BCMT (Blockwise Causal Memory Transformer) takes a distinct approach to this problem: rather than modifying the attention mechanism itself or introducing learned recurrent states, it separates the jobs of local token interaction and long-range context propagation into two distinct, complementary components.

The central observation is that not every token needs to attend to every other token directly. Short-range dependencies, which tend to dominate in practice, can be handled by dense causal self-attention applied within fixed local blocks. What gets lost in this partitioning is the cross-block context. BCMT recovers it through an exponential causal memory built from adaptive block summaries, injected back into token representations via a gating mechanism. The result is an architecture that remains fully parallelizable and compatible with standard GPU kernels, without requiring learned hidden states or persistent memory tokens.

Key Contributions

The paper makes three concrete claims:

The memory mechanism itself is worth dwelling on. Unlike Transformer-XL's segment-level recurrence or the persistent memory tokens used in Recurrent Memory Transformer (RMT), BCMT's inter-block memory is constructed deterministically from block summaries via normalized exponential causal aggregation. There are no learned recurrent parameters. This is a meaningful design choice: it avoids the optimization instabilities that can accompany recurrent memory training, and it keeps the overall system fully parallelizable at training time.

Methodology

The architecture processes a sequence of length T by partitioning it into non-overlapping local blocks. Within each block, standard dense causal self-attention is applied. Each block then produces an adaptive summary, which is aggregated into an exponential causal memory. This memory is subsequently injected back into the token representations before the next block is processed, allowing information from earlier blocks to influence later token representations without any direct cross-block attention.

The block size is an explicit hyperparameter, and the paper evaluates four variants: BCMT-64, BCMT-128, BCMT-256, and BCMT-512, where the number refers to the block size in tokens. Smaller blocks increase computational efficiency but reduce the amount of context available to local attention, placing more burden on the memory mechanism. Larger blocks recover more of the Dense Transformer's modeling capacity at the cost of reduced efficiency gains.

Experiments are conducted on WikiText corpora at context lengths of 128, 256, 512, and 1024 tokens, using a small but controlled model configuration (hidden dimension 128, 6 layers, 8 attention heads). The evaluation metrics include validation loss, perplexity, training throughput in tokens per second, time per epoch, and peak GPU memory usage. Crucially, the paper also includes an ablation study comparing full BCMT against an HOnly variant that applies block-wise attention without any inter-block memory propagation.

Results

The headline numbers are compelling, particularly at longer context lengths. At 1024 tokens, BCMT-128 achieves a training throughput of 204.2K tokens/s versus 119.9K for the Dense Transformer, a 70.3% improvement, while reducing peak GPU memory from 14.37 GB to 10.48 GB. The validation loss increases modestly from 4.5752 to 4.6130. BCMT-256, identified as the best overall trade-off, closes much of that performance gap (validation loss 4.5931) while still delivering 57.4% higher throughput and 23.1% lower memory usage.

These trends hold when the training corpus is tripled to approximately 38 million tokens (WikiText600k). BCMT-256 maintains a 57.8% throughput advantage and reduces training time per epoch from 633 to 401 seconds, with a validation loss gap of only 0.036 nats relative to the Dense Transformer. The very small standard deviations across seeds, especially for BCMT-256 (±0.0003), suggest that the exponential causal memory does not introduce meaningful optimization instability.

The ablation study is the most analytically interesting part of the paper. Removing the inter-block memory consistently increases validation loss across all block sizes, confirming that the gains are not simply an artifact of reduced sequence length in local attention. The effect is strongest at small block sizes: for BCMT-64, removing the memory increases validation loss by 0.0682; for BCMT-512, the effect shrinks to 0.0055. This is exactly what you would expect. When blocks are small, local attention covers little of the sequence history, so the memory mechanism carries more of the long-range modeling load. As block size grows, local attention absorbs more dependencies directly, and the memory becomes a smaller marginal contributor.

Limitations and Open Questions

The authors are candid about several significant constraints. The exponential causal aggregation naturally down-weights distant blocks, which means BCMT cannot faithfully retrieve specific information from the distant past. Tasks requiring precise recall of earlier context, such as document-level question answering or long-range coreference resolution, may be poorly served by this design.

The experimental scope is also deliberately narrow. All evaluations use a single small model configuration and a single dataset family (WikiText). There is no direct comparison with Transformer-XL, RMT, RetNet, RWKV, or Mamba, which are the most natural points of comparison given the paper's positioning. This makes it difficult to assess where BCMT sits relative to the broader field of efficient long-context architectures. The authors acknowledge this and frame it as future work, but it remains a gap that limits the strength of the empirical claims.

The fixed exponential decay factor is another potential weakness. A single decay rate cannot simultaneously represent short-term and long-term dependencies well. Adaptive or hierarchical decay, or multi-scale memory structures, could improve expressiveness without sacrificing parallelizability, and this seems like a natural next step.

Finally, the model scale is small by current standards. Whether the efficiency gains and performance trade-offs hold at the scale of hundreds of millions or billions of parameters, and at context lengths of tens of thousands of tokens, is an open question. The linear-in-context-length complexity of block-wise local attention is theoretically appealing at large scales, but empirical validation at that regime is absent here.

Despite these limitations, BCMT presents a clean and well-motivated architectural idea. The separation of local interaction from global context propagation is a principled design choice, and the fully parallelizable, parameter-free memory mechanism is an elegant way to avoid the complications of learned recurrent dynamics. The paper is worth reading for anyone working on efficient sequence modeling, even if the evaluation leaves room for a more comprehensive follow-up study.

Read the full paper on arXiv. The official implementation is available at github.com/rachidlabs/BCMT.

TransformersEfficient NLPLanguage ModelingAttention MechanismsArchitecture

Related Articles

SELR: Self-Explainable Latent Reasoning Without Extra ModelsA Year of LLM Serving Traces: Workload Evolution at ScaleMicrosoft's 398-Vulnerability Patch Tuesday: AI's Double-Edged Sword