Longformer's attention mechanism combines fixed-size sliding windows for capturing local context and syntactic structure, with strategically chosen "global tokens" (e.g., CLS tokens for classification or question tokens for QA) that attend to the entire sequence for critical document-level information.