Sliding window attention: प्रत्येक token केवल एक fixed window (जैसे 4096 tokens) के भीतर tokens पर attend करता है। पहले के tokens से जानकारी layers के माध्यम से propagate होती है — layer 1 4096 tokens देखता है, layer 2 effectively 8192 (दो windows) देखता है, और final layer तक, पूरे sequence से जानकारी propagate होने का मौका मिल जाता है। Mistral-7B अपनी 32 layers में 4096-token sliding window का उपयोग करता है।
Longformer sliding window (local) attention को selected tokens (जैसे [CLS] या user-defined positions) पर global attention के साथ combine करता है। BigBird local और global patterns के ऊपर random attention connections जोड़ता है। ये hybrid approaches models को subquadratic cost के साथ 4K–16K tokens संभालने देते हैं जबकि global positions के माध्यम से distant tokens connect करने की ability बनाए रखते हैं।
Sparse attention कई tasks के लिए अच्छे काम करता है लेकिन precise long-range dependencies की आवश्यकता वाले tasks पर degrade हो सकता है — लंबे document की शुरुआत से specific fact reference करना, लंबी conversation में consistency बनाए रखना, या कई tokens में span करने वाले complex instructions follow करना। Dense attention (full quadratic) Flash Attention के साथ इन cases के लिए अधिक robust रहता है, यही कारण है कि अधिकांश frontier models अभी भी dense attention का उपयोग करते हैं और sparsity के बजाय efficiency के लिए Flash Attention पर rely करते हैं।