Punctuation-aware Hybrid Trainable Sparse Attention for Large Language Models
Abstract
Attention serves as the fundamental mechanism for long-context modeling in large language models (LLMs), yet dense attention becomes structurally prohibitive for long sequences due to its quadratic complexity. Consequently, sparse attention has received increasing attention as a scalable alternative. However, sparse attention can miss relevant context, especially when very few tokens are selected. One possible reason is that averaging token representations within a block can dilute signals from important tokens, making relevant context harder to identify. To address this issue, we propose Punctuation-aware Hybrid Sparse Attention (PHSA), a trainable sparse attention mechanism. PHSA uses punctuation tokens, which often mark the ends of clauses and sentences, as an additional source of contextual information. It combines the average representation of all tokens in each block with a separate average over its punctuation tokens to guide context selection. We further study how training sparsity affects performance when only a small fraction of tokens is selected during inference. Experiments show that PHSA achieves a higher average LongBench score than both dense attention and InfLLM v2, while reducing retrieval errors by 10.8\% relative to InfLLM v2 at 97.3\% sparsity on 32k-token inputs.