The paper “MiniMax-01: Scaling Foundation Models with Lightning Attention“ presents a groundbreaking framework for large language models (LLMs) capable of processing ultra-long contexts—up to 4 million tokens—with high computational efficiency. By employing a hybrid linear-softmax attention mechanism called “Lightning Attention,” the researchers transcend the quadratic bottleneck of traditional transformers. Their models, MiniMax-Text-01 (text-focused) and MiniMax-VL-01 (vision-language), excel in long-context benchmarks such as document retrieval and multi-modal analysis, showcasing transformative applications in domains requiring extensive contextual understanding. Open-source resources, including code and interactive demos, are available at GitHub and Hailuo AI.
Introduction: Defying the Quadratic Barrier
As LLMs expand in complexity and utility, their ability to handle extensive token sequences remains constrained by the quadratic scaling inherent in standard softmax attention (Vaswani et al., 2017). The quadratic cost of attention grows exponentially as sequence lengths increase, limiting existing models to context windows of 8k to 32k tokens in most cases.
However, the MiniMax-01 framework fundamentally redefines these limits. Leveraging the Lightning Attention mechanism—an advanced linear attention design—the researchers reduce memory overhead and computational demand to nearly linear complexity. This breakthrough enables context windows 10x to 100x longer than models like Longformer (Beltagy et al., 2020) and Big Bird (Zaheer et al., 2020).

Model Overview
MiniMax-Text-01
A state-of-the-art text model, MiniMax-Text-01, handles both standard benchmarks (e.g., ARC, TriviaQA) and context lengths up to 4 million tokens. By adopting a hybrid attention strategy—where 1 out of 8 layers employs softmax attention—the model maintains high retrieval performance while operating efficiently at scale.
MiniMax-VL-01
MiniMax-VL-01 expands this capability to multi-modal tasks, combining text and visual inputs. It achieves competitive performance in image captioning, document analysis, and vision-language reasoning, rivaling models such as BLIP-2 (Li et al., 2023) and CoCa (Yu et al., 2022).

Innovations in Attention Mechanisms
Lightning Attention
The core innovation lies in Lightning Attention, which replaces the expensive QK^T computation with a kernel-based transformation, achieving O(N) complexity. Unlike previous linear attention methods (Hua et al., 2022), Lightning Attention incorporates advanced tiling and recurrence strategies to handle long causal sequences efficiently.
Hybrid Architecture
Recognizing the limitations of purely linear attention in retrieval-heavy tasks, the researchers introduce hybrid layers. These strategically deploy softmax attention in select layers, preserving global weighting while maintaining scalability.


Scaling Context to 4 Million Tokens
Traditional LLMs cap their context lengths at hundreds of thousands of tokens, but MiniMax-01 achieves 4 million tokens through a meticulous multi-stage training strategy:
- Stage 1: Short and medium contexts up to 128k tokens.
- Stage 2: Contexts up to 512k tokens, gradually introducing longer sequences.
- Stage 3: Very long contexts exceeding 1 million tokens.
This progressive training prevents catastrophic forgetting and allows the model to extrapolate beyond the training window.
Experimental Validation
Benchmark Performance
Across tasks such as document retrieval, dialogue analysis, and codebase summarization, MiniMax-Text-01 achieves superior performance. For instance:
- On a needle-in-a-haystack retrieval task with 4M tokens, the model consistently locates the correct snippet—a feat unattainable for traditional transformers.
Scaling Laws
The researchers establish that hybrid-linear models follow scaling laws comparable to standard transformers but with significantly reduced computational costs at long contexts.
Comparative Analysis
Models like LLaMA (Dubey et al., 2024) and Mistral (Jiang et al., 2023) excel in short-context tasks but fall short in long-context performance. MiniMax-01 bridges this gap, proving adept at both.
Alignment and Safety Protocols
To ensure user-friendly and responsible outputs, the researchers employ a robust alignment framework:
- Supervised Fine-Tuning (SFT): Curated high-quality responses from experts.
- Offline Reinforcement Learning (DPO): Preference-based optimization for reward alignment.
- Online RL: Fine-tuning via Group Relative Policy Optimization (GRPO).
Safety is reinforced through:
- Harmlessness filters: Constitutional AI guidelines ensure compliance with ethical norms.
- Data privacy safeguards: Mitigating risks of unintentional leakage during long-context analysis.
Practical Applications
- Book-Length Summarization: Efficiently distills lengthy documents into concise summaries.
- Codebase Analysis: Navigates and extracts insights from repositories containing millions of lines of code.
- Multi-Modal Reasoning: Integrates textual and visual inputs for tasks like diagram interpretation.
Open Resources and Future Directions
The researchers provide open-source code (GitHub), demos (Hailuo AI), and API endpoints (Intl MiniMax).
Future work aims to:
- Extend context lengths beyond 4 million tokens.
- Refine the training pipeline for domain-specific tasks, such as coding and legal analysis.
In redefining scalability, MiniMax-01 opens new horizons for AI, from tackling entire libraries to seamlessly combining text and visuals in multi-modal problem-solving. This work marks a pivotal step toward the future of unbounded-context language models.