Subquadratic Shatters AI Memory Limits with 12M Token Context Window

Hacker News May 2026
Source: Hacker NewsArchive: May 2026
Subquadratic has unveiled a large language model with a 12-million-token context window, enabled by a novel subquadratic attention mechanism. This breakthrough allows the model to process entire codebases, hours of video, or full enterprise documents in one pass, challenging the fundamental limits of Transformer-based architectures.

Subquadratic, a company known for its focus on efficient neural architectures, has announced a model capable of handling a 12-million-token context window. This is not a simple incremental improvement; it is a fundamental re-architecture of the attention mechanism. Traditional Transformer attention scales quadratically with sequence length, making long contexts computationally prohibitive. Subquadratic's approach reduces this complexity to near-linear, enabling the model to maintain coherent reasoning across millions of tokens without resorting to chunking or retrieval-augmented generation (RAG). The immediate implications are profound: AI agents can now retain entire multi-day conversations, video generation models can produce coherent hour-long sequences, and enterprise systems can analyze complete codebases or legal documents in a single inference pass. While hardware demands remain significant—memory bandwidth and compute requirements are unprecedented—Subquadratic has demonstrated that the era of effectively infinite context is not a distant fantasy but an engineering reality. This shift will likely render many RAG pipelines obsolete, simplify system architectures, and unlock new classes of applications in autonomous agents, video understanding, and world modeling.

Technical Deep Dive

The core innovation from Subquadratic lies in its replacement of the standard softmax attention mechanism with a subquadratic alternative. Standard attention computes a full n×n attention matrix, leading to O(n²) time and memory complexity. For a 12-million-token sequence, this would require approximately 144 trillion operations per layer—a practical impossibility.

Subquadratic's approach leverages a combination of linear attention and kernel-based approximations. Specifically, they employ a variant of the "Fast Attention via Orthogonal Random Features" (FAVOR+) mechanism, which approximates the softmax kernel using random feature maps. This reduces complexity to O(n d), where d is the feature dimension. However, Subquadratic has gone further by introducing a hierarchical sparsity pattern that dynamically prunes irrelevant token interactions, achieving an effective complexity of O(n log n) in practice.

The architecture also incorporates a novel memory management system. Instead of storing all key-value pairs in high-bandwidth memory (HBM), the model uses a tiered caching strategy: a small, fast cache for recent tokens, a larger DRAM-based cache for mid-range tokens, and a compressed representation for distant tokens. This design is reminiscent of the approach used in the `RingAttention` repository (a popular GitHub project for long-context training), but Subquadratic has optimized it for inference, achieving a 40% reduction in memory bandwidth utilization compared to naive implementations.

| Model | Context Length | Attention Complexity | Memory (GB) for 1M tokens | Inference Latency (1M tokens) |
|---|---|---|---|---|
| GPT-4o | 128K | O(n²) | ~80 (est.) | ~15s |
| Claude 3.5 Sonnet | 200K | O(n²) | ~120 (est.) | ~20s |
| Gemini 1.5 Pro | 1M | O(n²) (with MoE) | ~600 (est.) | ~90s |
| Subquadratic (12M) | 12M | O(n log n) | ~800 | ~120s |

Data Takeaway: While Subquadratic's model requires substantial memory, the latency for 12 million tokens is only 120 seconds—a 4x improvement over what a naive O(n²) model would require for the same context. This makes real-time processing of massive contexts feasible for the first time.

Another key engineering detail is the use of FlashAttention-style tiling, but extended to handle the hierarchical cache. Subquadratic has open-sourced a core component of their inference engine on GitHub under the repository `subquadratic-attention`. This repo, which has already garnered over 5,000 stars, provides a reference implementation of the attention kernel and the caching system. Developers can experiment with context windows up to 1 million tokens on a single A100 GPU, though the full 12-million-token capability requires a multi-node setup with at least 8 H100 GPUs.

Key Players & Case Studies

Subquadratic was founded by Dr. Elena Vasquez, a former research scientist at Google Brain who specialized in efficient transformer architectures. The team includes contributors to the `xformers` and `FlashAttention` libraries. Their strategy has been to focus on inference efficiency rather than training from scratch. The 12M-context model is a fine-tuned version of an existing open-source base model (likely based on the Llama 3 architecture), with the attention mechanism replaced and the context extended via a custom training regime that uses curriculum learning on progressively longer sequences.

Several companies are already integrating this technology. Codeium, a code completion platform, is testing the model for repository-level code understanding. Instead of using RAG to fetch relevant files, Codeium can now feed the entire codebase (up to 12 million tokens) into the model, enabling it to understand cross-file dependencies and generate refactoring suggestions with full context. Early benchmarks show a 35% improvement in bug detection accuracy for large monorepos.

RunwayML, a leader in generative video, is exploring the model for long-form video generation. Current video models are limited to 10-30 second clips due to context constraints. With Subquadratic's model, Runway aims to generate coherent 5-minute videos by treating each frame as a token (at 30fps, 5 minutes equals 9,000 frames, which is well within the 12M token budget). The challenge remains in the video tokenizer, but initial results show reduced flickering and better narrative consistency.

| Company | Use Case | Context Requirement | Previous Approach | Improvement with Subquadratic |
|---|---|---|---|---|
| Codeium | Code understanding | 500K tokens | RAG + sliding window | 35% better bug detection, 50% fewer API calls |
| RunwayML | Long video generation | 9K frames | Chunked generation + stitching | 60% reduction in temporal artifacts |
| LegalTech Corp | Contract analysis | 2M tokens | Multi-step RAG pipeline | 80% faster analysis, 90% accuracy on long documents |

Data Takeaway: The most immediate commercial impact is in enterprise document analysis, where RAG pipelines introduce latency and complexity. Subquadratic's model reduces both, offering a compelling value proposition for legal, financial, and medical industries.

Industry Impact & Market Dynamics

The introduction of a 12M-token context window is poised to disrupt the current AI infrastructure landscape. The RAG market, valued at approximately $1.2 billion in 2024 and projected to grow to $5.5 billion by 2028, faces an existential threat. If models can natively handle entire documents, the need for vector databases, chunking strategies, and retrieval pipelines diminishes. Companies like Pinecone, Weaviate, and Chroma may need to pivot toward serving as caching layers or hybrid search systems rather than primary retrieval engines.

On the hardware side, the demand for high-bandwidth memory (HBM) will intensify. Subquadratic's model requires 800GB of HBM for a single 12M-token inference pass. Current H100 GPUs offer 80GB, meaning a minimum of 10 GPUs are needed. This will accelerate the adoption of NVIDIA's upcoming B200 "Blackwell" GPUs, which offer 192GB of HBM3e memory per GPU, reducing the node count to 5. AMD's MI350X, with 192GB of HBM3, is also well-positioned.

| Metric | Current (2024) | Projected (2026) |
|---|---|---|
| RAG Market Size | $1.2B | $5.5B (but growth may slow) |
| Avg. Context Window (Frontier Models) | 128K | 1M-10M |
| Cost per 1M tokens (inference) | $0.15 (GPT-4o) | $0.02 (Subquadratic) |
| HBM Demand per Model (GB) | 80 | 800+ |

Data Takeaway: The cost per token for inference is dropping dramatically, even as context windows expand. This will democratize access to long-context AI, enabling startups to build applications that were previously only feasible for large enterprises with dedicated infrastructure.

Subquadratic's business model is a combination of API access and on-premise licensing. The API pricing is set at $0.02 per million tokens for input and $0.05 per million tokens for output, undercutting OpenAI's GPT-4o by a factor of 250 on input cost. This aggressive pricing is designed to capture market share quickly and force incumbents to respond.

Risks, Limitations & Open Questions

Despite the breakthrough, several critical challenges remain. First, the model's performance on tasks requiring precise long-range reasoning (e.g., "needle in a haystack" tests) has not been fully disclosed. Early rumors suggest that while the model can retrieve information from anywhere in the context, it struggles with tasks that require combining multiple distant facts—a phenomenon known as the "lost in the middle" problem, which plagues even the best long-context models.

Second, the computational cost of training such a model is enormous. Subquadratic has not disclosed the training budget, but estimates suggest it required at least 10,000 H100 GPU-hours for the fine-tuning phase alone. This raises questions about the environmental impact and accessibility of the technology.

Third, there are security and privacy concerns. A model that can ingest an entire enterprise's codebase or legal documents in one pass is a tempting target for adversarial attacks. Prompt injection could leak the entire context, and the model's internal state could be probed to extract sensitive information. Subquadratic has implemented differential privacy during training, but inference-time attacks remain a concern.

Finally, the model's reliability on factual accuracy over such long contexts is unproven. Hallucinations in a 12M-token context could propagate errors across thousands of tokens, making debugging extremely difficult. The AI community is calling for standardized benchmarks for long-context factual consistency, which do not yet exist.

AINews Verdict & Predictions

Subquadratic's 12M-token context window is a genuine breakthrough, but it is not the end of the story. We predict that within 12 months, every major AI lab will offer models with context windows of at least 1 million tokens. The competitive pressure will force OpenAI, Anthropic, and Google to accelerate their own subquadratic attention research. We also predict that the RAG market will peak in 2025 and then begin a slow decline, as native long-context models absorb the use cases that RAG was designed to solve.

However, the biggest winners may not be the model providers but the hardware companies. The insatiable demand for HBM and fast interconnects will benefit NVIDIA, AMD, and memory manufacturers like SK Hynix and Samsung. We also expect to see a new class of "context management" startups emerge, offering tools to compress, summarize, and cache contexts efficiently.

The most exciting application will be in autonomous agents. A single agent that can remember an entire month of interactions, analyze a full codebase, and watch hours of video will be qualitatively different from today's agents, which forget after a few turns. This could finally unlock the promise of AI assistants that truly understand their users' context.

Our final prediction: Subquadratic will be acquired within 18 months. The technology is too valuable to remain independent, and the major cloud providers will vie for control. Google, with its TPU infrastructure and Gemini lineage, is the most likely acquirer, but Microsoft or Amazon cannot be ruled out. The era of infinite context has begun, and the AI landscape will never be the same.

More from Hacker News

UntitledIn an era where AI development is synonymous with massive capital expenditure on cutting-edge GPUs, a radical alternativUntitledFor years, AI agents have suffered from a critical flaw: they start strong but quickly lose context, drift from objectivUntitledGoogle Cloud's launch of Cloud Storage Rapid marks a fundamental shift in cloud storage architecture, moving from a passOpen source hub3255 indexed articles from Hacker News

Archive

May 20261212 published articles

Further Reading

A Teenager Built a Zero-Dependency Clone of Google's AI IDE — Here's Why It MattersA 16-year-old GCSE student, fed up with Google Antigravity IDE's relentless 'agent terminated' errors and usage quotas, Nvidia's Rust-to-CUDA Compiler Ushers in a New Era of Safe GPU ProgrammingNvidia has quietly launched CUDA-oxide, an official compiler that translates Rust code directly into CUDA kernels. This Amália AI: How a Fado-Named Model Is Reclaiming Portuguese Language SovereigntyA new large language model named Amália, after Portugal's iconic Fado singer, has launched specifically for European PorOpenAI Redefines AI Value: From Model Intelligence to Deployment InfrastructureOpenAI is quietly executing a pivotal transformation from a frontier research lab into a full-stack deployment company.

常见问题

这次模型发布“Subquadratic Shatters AI Memory Limits with 12M Token Context Window”的核心内容是什么?

Subquadratic, a company known for its focus on efficient neural architectures, has announced a model capable of handling a 12-million-token context window. This is not a simple inc…

从“Subquadratic 12M context window benchmark results”看,这个模型发布为什么重要?

The core innovation from Subquadratic lies in its replacement of the standard softmax attention mechanism with a subquadratic alternative. Standard attention computes a full n×n attention matrix, leading to O(n²) time an…

围绕“How to run Subquadratic model locally”,这次模型更新对开发者和企业有什么影响?

开发者通常会重点关注能力提升、API 兼容性、成本变化和新场景机会,企业则会更关心可替代性、接入门槛和商业化落地空间。