Transformer key value caches show varied compressible structures
Tensor Decomposition of Transformer Key-Value Caches: Spectral Structure and Format Comparison
Summary
Transformer models keep track of information in a big, four-way table spanning features like attention heads and tokens. The authors studied how this table can be squished down without losing much detail, using methods that break it apart in different ways. They found that some parts, like tokens and features, can be compressed well, but others, such as attention heads and layers, cannot. A particular approach called Tucker decomposition works best at storing the information compactly while keeping accuracy. Also, the ability to compress changes depending on whether the data represents keys or values, and certain model features reduce compressibility.
What this means in practice
- •For machine learning engineers: Store transformer key-value caches more efficiently at different compression levels using Tucker decomposition for improved memory use.
- •For natural language processing developers: Choose tensor compression formats suited to keys or values to optimize transformer performance in NLP models.