Geometric Capacity of Top- and Sliding-Window Attention: A Theoretical Analysis via Tropical Geometry
Abstract
Top- attention and sliding-window attention are two widely used sparse attention mechanisms for reducing the computation and memory cost of long-context models. Although both mechanisms restrict the number of key–value pairs processed by each query, they generate different sets of routing outputs. In this paper, we present the first unified tropical-geometric comparison of their routing capacities under the same post-routing KV activation-memory budget. With fixed keys, we show that both mechanisms partition query space into polyhedral regions in which the selected KV indices remain unchanged. These partitions admit power-diagram representations: global Top- produces a power diagram indexed by -element support sets, whereas sliding-window hardmax produces position-dependent local power diagrams indexed by accessible keys. Given candidate keys and under the stated dimension conditions, the maximum numbers of single-query routing regions are for global Top- and for a sliding window of width . For independently varying queries with full windows, the corresponding sequence-level capacities are and . When the two mechanisms have the same budget , their capacity ratio is per query and at the sequence level. The proposed geometric framework provides a theoretical basis for comparing and designing sparse attention mechanisms for memory-efficient long-context models.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.