Tensor Product Attention Is All You Need
11 Jan · Yifan Zhang, Yifeng Liu, Huizhuo Yuan +4 · arXiv:2501.06425
Scaling language models to handle longer input sequences typically necessitates large key-value (KV) caches, resulting in substantial memory overhead during inference. In this paper, we propose Tensor Product Attention (TPA), a novel attention mechanism that uses tensor decompositions to represent queries, keys, and values compactly, substantially shrinking the KV cache size at inference time. By factorizing these…