Papers
Topics
Authors
Recent
Search
2000 character limit reached

MTLA: Multi-head Temporal Latent Attention

Updated 26 January 2026
  • The paper introduces MTLA, a self-attention variant that compresses the key-value cache temporally to reduce memory usage and speed up inference.
  • MTLA leverages a hyper-network for dynamic temporal merging and employs a stride-aware causal mask to ensure consistent training and inference.
  • Empirical results demonstrate up to 8× GPU memory reduction and 5× speedup in applications such as speech translation, recognition, and text summarisation.

Multi-head Temporal Latent Attention (MTLA) is a self-attention variant designed to address the inference-time memory and computational bottlenecks of Transformer architectures. MTLA advances the compression paradigm introduced by Multi-Head Latent Attention (MLA) by reducing the Key-Value (KV) cache size along the temporal axis, leading to substantial improvements in inference speed and GPU memory usage without significant degradation in model quality. MTLA features dynamic temporal merging via a hyper-network and utilizes a stride-aware causal mask to reconcile the spatial-temporal compression with parallel training and consistent inference behaviour. Empirical evaluations demonstrate MTLA’s efficacy in tasks such as speech translation, speech recognition, spoken language understanding, and text summarisation (2505.13544).

1. Architectural Foundation and Motivation

MTLA is conceptually rooted in the Transformer’s multi-head attention (MHA) mechanism. MHA maintains per-head Key and Value representations for each time-step, resulting in a KV cache of size O(Tnhdh)O(T \cdot n_h \cdot d_h), where TT is sequence length, nhn_h number of heads, and dhd_h head dimension. MLA introduced low-rank latent compression by mapping input XRT×dX \in \mathbb{R}^{T \times d} to latent CRT×rC \in \mathbb{R}^{T \times r} (rnhdhr \ll n_h d_h) and reconstructing K,VK, V via learned projections.

MTLA takes further steps by compressing CC temporally: consecutive blocks of ss latent vectors are merged using a hyper-network, producing TT0 cache entries and achieving cache complexity TT1. This design directly targets the autoregressive inference KV cache growth, decreasing both temporal storage and per-step attention cost. The rationale is that adjacent tokens in long sequences (e.g., speech) carry redundant information and merging preserves key semantics with drastically reduced resource consumption.

2. Latent Space Factorization

MTLA first maps TT2 to a latent space using

TT3

At inference, TT4 is stored as the compressed KV cache. For attention computation, latent TT5 is up-projected:

TT6

More generally,

TT7

Common parameter choices include TT8 and TT9. This compression reduces KV cache storage by a factor of nhn_h0 relative to MHA.

3. Hyper-network Temporal Merging

The core distinguishing mechanism is dynamic temporal merging. MTLA deploys a compact MLP hyper-network that generates per-time-step merge weights based on latent input and positional embeddings. Specifically, for block nhn_h1, the merge weight for nhn_h2 is

nhn_h3

where nhn_h4 is the sigmoid, and nhn_h5 projects elementwise products to a scalar. During inference, each merged cache entry nhn_h6 is updated incrementally: rnhdhr \ll n_h d_h4 During parallel training, all weights nhn_h7 are generated in batch and combined with chunk masking, ensuring each latent is merged strictly within its temporal block.

4. Stride-aware Causal Masking

Temporal compression introduces cache positions that only exist at block boundaries. Standard causal masks (nhn_h8 if nhn_h9, else dhd_h0) are incompatible with MTLA’s blockwise cache. The stride-aware mask constrains query-to-key connectivity:

dhd_h1

In practice: rnhdhr \ll n_h d_h5 This design ensures that queries only attend to visible, fully (or partially) merged block vectors, maintaining causal consistency during both training and incremental inference.

5. Training and Inference Procedure

MTLA is trained end-to-end with standard cross-entropy (e.g., for translation, summarisation) or CTC+CE loss (for ASR). All components (query/key projections, low-rank mapping, hyper-network weights, stride-aware mask logic) are optimized jointly. Hyper-network gradients propagate through the attention calculation, requiring no auxiliary losses. During inference, cache updates and merging are performed incrementally on receipt of new tokens, directly paralleling the decomposed, causal structure imposed by blockwise compression. In parallel/batched training, all temporal merges and masking are executed in vectorized fashion, simulating the inference attention pattern and cache visibility.

6. Computational Complexity and Resource Efficiency

A direct big-O comparison reveals substantial efficiency gains:

  • MHA: Time dhd_h2; Memory dhd_h3
  • MLA: Time dhd_h4 (smaller constants); Memory dhd_h5
  • MTLA (stride dhd_h6): Time per step dhd_h7; Memory dhd_h8

In speech translation (English–German, dhd_h9, XRT×dX \in \mathbb{R}^{T \times d}0, XRT×dX \in \mathbb{R}^{T \times d}1, XRT×dX \in \mathbb{R}^{T \times d}2 layers):

  • MHA KV cache: XRT×dX \in \mathbb{R}^{T \times d}3 floats
  • MLA (r=XRT×dX \in \mathbb{R}^{T \times d}4): XRT×dX \in \mathbb{R}^{T \times d}5 floats
  • MTLA (s=2): XRT×dX \in \mathbb{R}^{T \times d}6 floats; XRT×dX \in \mathbb{R}^{T \times d}7 less than MHA

Empirical resource usage and quality for MuST-C En–De (BLEU, time, GPU memory):

Model Quality (BLEU) Time (s) Speedup GPU (MiB) Mem Factor
MHA 23.18 281.3 1.00× 18646 1.00×
MLA 22.97 97.0 2.90× 5065 3.68×
MTLA (s=2) 23.28 65.6 4.29× 2835 6.58×
MTLA (s=3) 23.25 52.7 5.34× 2251 8.28×
MTLA (s=4) 23.05 48.7 5.78× 1921 9.71×

7. Empirical Evaluation Across Modalities

MTLA demonstrates competitive or superior task performance to baseline MHA and MLA across diverse tasks:

  • Speech Translation (MuST-C En–De): BLEU parity or improvement, XRT×dX \in \mathbb{R}^{T \times d}8–XRT×dX \in \mathbb{R}^{T \times d}9 speedup, CRT×rC \in \mathbb{R}^{T \times r}0–CRT×rC \in \mathbb{R}^{T \times r}1 GPU memory reduction.
  • Text Summarisation (XSum): ROUGE-1/2/L CRT×rC \in \mathbb{R}^{T \times r}2 vs MHA CRT×rC \in \mathbb{R}^{T \times r}3 with CRT×rC \in \mathbb{R}^{T \times r}4 speedup and CRT×rC \in \mathbb{R}^{T \times r}5 lower memory.
  • Speech Recognition (AMI ASR): WER CRT×rC \in \mathbb{R}^{T \times r}6 (MHA CRT×rC \in \mathbb{R}^{T \times r}7), CRT×rC \in \mathbb{R}^{T \times r}8 faster, CRT×rC \in \mathbb{R}^{T \times r}9 memory reduction.
  • Spoken-LU (SLURP IC): Accuracy rnhdhr \ll n_h d_h0 (MHA rnhdhr \ll n_h d_h1), rnhdhr \ll n_h d_h2 faster, rnhdhr \ll n_h d_h3 memory reduction.

This suggests that temporal latent compression, as instantiated by MTLA, maintains semantic representation effectiveness while providing substantial engineering and resource efficiencies. A plausible implication is that further exploration of dynamic merge strategies or hierarchy-aware masking may yield additional benefits for long-context or low-latency applications.

(2505.13544)

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Multi-head Temporal Latent Attention (MTLA).