How DeepSeek’s open weights, architecture, and serving stack reshape the economics of AI, shifting competition from raw capability to the cost of intelligence per token.
By Farida Khalaf
Published: 2026-06-29
URL: https://fafi25.substack.com/p/deepseek-open-weight-ai-the-what
TL;DR: The cost of AI intelligence is collapsing, and the AI race is now about inference cost, pricing, and efficiency.
The New Frontier Is the Invoice
How DeepSeek V4 Proved That the AI Race Is Now About the Cost of Intelligence
On January 27, 2025, Nvidia lost $593 billion in market value before the closing bell. Not because of a product failure. Not because of a regulatory ruling. Because a team in Hangzhou had published a paper three days earlier describing a model that matched the performance of America’s most expensive AI systems, and revealed, in technical detail, exactly how cheaply it had been built. The paper was titled DeepSeek-R1. The single-day loss was, at the time, the largest ever recorded for any U.S. company in stock market history.
That team has since continued. In April 2026, they released V4 Pro, a 1.6 trillion parameter model with a one-million-token context window, reportedly trained on 4,000 Huawei Ascend GPUs at a cost some reports put under $20 million, built without legal access to NVIDIA’s highest-performance chips, by a roughly 160-person operation spun out of a quantitative hedge fund. That figure is disputed; the dispute, as we will see, lands on the wrong number. On May 22, 2026, DeepSeek confirmed that when the 75% promotional discount on V4 Pro output pricing expired at the end of the month, the price would not revert. The post-promotion rate, one quarter of the original, would stand: $0.87 per million output tokens. The announcement was brief. The language was precise. It is not a discount.
Those four words contain the argument this article is about. The price did not fall because DeepSeek chose to absorb a loss. It fell because the architecture made it structurally cheaper to run. Every design decision in V4, in the attention system, in the training stability mechanisms, in the infrastructure layer, was simultaneously a technical decision and a cost decision. The $0.87 is not what the company chose to charge. It is what the model costs to run. And the race that produced it is no longer about who can build the most capable model. It is about who can build the most capable model at the lowest cost of operation. Those are different competitions. V4 is evidence that the second one has already started.
Part One: The Attention Tax
The foundation of every large language model is a mechanism introduced in a 2017 Google research paper, “Attention Is All You Need.” When a model processes a new token, a word, a fragment of code, a number, it does not treat that token in isolation. It asks, for every token that has preceded it: how does this one relate to that one? The resulting network of relationships is what allows the model to understand that a pronoun refers to a subject three paragraphs earlier, or that a constraint stated in an opening clause governs the resolution of an argument several pages later.
Without attention, there is no coherence across distance. With it, there is a cost.
The number of comparisons a model must perform scales with the square of the sequence length. Double the input, quadruple the computation. At one hundred thousand tokens, a long technical document, a dense research paper, the model performs ten billion pairwise comparisons per attention layer. At one million tokens, it performs one trillion. These numbers translate directly into FLOPs, which translate directly into GPU time, which translates directly into dollars. A one-million-token context window, processed through full attention, costs orders of magnitude more to run than a thirty-two-thousand-token window. At the scale of commercial deployment, millions of API calls per day, that difference is not a technical footnote. It is the primary variable in whether the product can be priced at a number anyone will pay.
Alongside the computation is the memory problem. Every token the model has processed must be stored in a Key-Value cache, the KV cache, which preserves, for each past token, the information about what that token meant in context. This cache is the model’s working memory. At one million tokens, it requires gigabytes of GPU memory per active query, some of the most expensive memory in any computing stack. When those gigabytes are occupied by one conversation’s context, they are unavailable for anything else. The KV cache is not just a cost to fill. It is a cost in everything it forecloses.
This is the attention tax. And it is the tax that every serious attempt at long-context inference must find a way to reduce without destroying the capability that makes long-context valuable in the first place.
Part Two: The Hardware Wall
In October 2022, the United States Commerce Department placed NVIDIA’s A100 and H100 chips, the dominant hardware for large-scale AI training, on an export control list that effectively barred their sale to Chinese companies. A subsequent rule in October 2023 closed the workarounds. DeepSeek, operating in Hangzhou as a research division of High-Flyer Capital Management, had been building with a cluster of roughly 10,000 A100 GPUs acquired before the controls took effect. For V4, that option was gone. The training run ran on 4,000 Huawei Ascend GPUs, domestic Chinese chips, a generation behind the hardware their competitors were using freely. At the model’s April 2026 release, Huawei announced that its new Ascend 950 supernode would support V4 natively, completing a stack built entirely from Chinese silicon.
The consequence was structurally simple. When you cannot resolve a cost problem by purchasing around it, when the hardware ceiling is imposed from outside the company and largely outside the industry, what remains is the software. Specifically, the question of how much can be extracted from constrained hardware by redesigning what that hardware is being asked to do.
Every major architectural innovation in V4 Pro should be read in this context. Not as elegant solutions to interesting research problems, though they are that, but as responses to a precise constraint. When you cannot add more chips, you must reduce what each chip has to do. When you cannot expand memory, you must reduce what the model needs to store. When you cannot afford a failed training run, at this parameter count, a crashed run represents millions of dollars in wasted GPU hours, you must build a system that cannot crash.
The architecture is not a list of features. It is a budget enforced from the outside, turned into engineering on the inside.
Figure 1. Overall DeepSeek V4 architecture showing alternating CSA/HCA attention layers and manifold-constrained hyperconnections. Source: Hugging Face, based on the DeepSeek V4 Technical Report.
Part Three: The Architecture
The hybrid attention system at the core of V4 Pro distributes the computation across three parallel pathways, interleaved through every layer of the network. DeepSeek’s umbrella name for this sparse-attention design is DSA, DeepSeek Sparse Attention, and the name is worth remembering, because it is the foundation other labs have already begun building on. Each pathway addresses a different component of the attention tax. None carries the full load. Together, they reduce the KV cache footprint by approximately ninety percent and the per-inference compute by approximately seventy-three percent, measured against DeepSeek V3.2, already considered one of the most efficient large-scale language models in the industry before V4 existed.
DeepSeek Sparse Attention combines compressed sparse attention, heavily compressed attention, and a local sliding window. Source: DeepSeek AI Technical Report.
The first pathway, Compressed Sparse Attention, begins with a structural question about what the model actually needs to store. In a traditional attention system, every token is preserved individually, one word, one entry, no aggregation. CSA groups tokens into small clusters of roughly four and compresses their combined information into a single representation. The sequence length drops by a factor of four immediately, reducing both the number of pairwise comparisons and the memory required to hold them. But compression alone does not close the problem. A one-million-token sequence, grouped into clusters of four, becomes two hundred and fifty thousand blocks, still too large to scan exhaustively without cost. The model needs a way to know which of those blocks are relevant to what it is currently processing. This is the function of what the paper calls the Lightning Indexer: when the model processes a new token, the Lightning Indexer rapidly scores every compressed block in the history and selects only the subset most likely to matter. The rest is skipped entirely. The compute is concentrated precisely where it will be used.
The second pathway compresses more aggressively. Heavily Compressed Attention groups not four tokens but approximately one hundred and twenty-eight, roughly a full paragraph, into a single representation. At that compression ratio, a one-million-token document becomes roughly eight thousand blocks, a number a model can scan exhaustively without prohibitive cost. What survives at this compression ratio is not word-level precision but structural pattern: the arc of an argument, the relationship between sections, the general geography of the document’s content. For much of what long-context reasoning requires, understanding how a conclusion follows from premises established pages earlier, this level of abstraction is sufficient. The model knows where things are. The more expensive pathways retrieve what they actually say.
The third pathway does the opposite of both. It keeps the most recent tokens, approximately the last one hundred and twenty-eight, completely uncompressed, stored with full word-level fidelity, no grouping, no summarization. This is the model’s immediate context: what it is currently processing and responding to. For this window, precision is total.
The three pathways operate in parallel through every layer of the network. The sliding window provides exact fidelity for the immediate context. The heavily compressed pathway provides broad structural understanding of the full document. The compressed sparse pathway with its Lightning Indexer provides targeted retrieval of specific details from anywhere in the history. The model does not choose between remembering everything and remembering efficiently. It does both, at different resolutions, simultaneously.
The efficiency numbers that result are not marginal. Against V3.2, V4 Pro requires 3.7 times fewer floating point operations per inference step and maintains a KV cache approximately ten times smaller. At one million tokens, the model runs on roughly twenty-seven percent of the compute that V3.2 required for the same context length. Translated from architecture into price: a seventy-three percent reduction in inference compute, at commercial scale, is a seventy-three percent reduction in the per-query infrastructure bill. That is what $0.87 per million output tokens looks like on an invoice.
Part Four: Stability as Cost Control
A model can be efficiently architected and still be untrainable. At 1.6 trillion parameters, training instability is not a theoretical risk. It is a financial one. A run that crashes after weeks of computation, because the training signal diverged, because the loss function exploded, destroys the GPU hours invested in it entirely. At this scale, those hours are worth millions of dollars. Stability is not a quality of the model. It is a line in the budget.
Modern deep networks depend on residual connections: pathways that allow a layer’s input to be added directly to its output, bypassing some of the transformation. At modest scale, these connections work reliably. At hundreds of layers and trillions of parameters, they generate a different problem. As signals flow through layer after layer, the residual additions compound. Values grow. At some point the growth becomes self-reinforcing, a feedback loop that, in acoustic systems, produces a screech from a microphone placed too close to a speaker. In a neural network, the equivalent is an exploding training signal: values become so large that the loss function diverges, the gradient becomes uninformative, and the run is over. The industry’s response had been to widen the residual stream through what are called hyperconnections, giving the signal more pathways to travel. DeepSeek’s technical report documents that even standard hyperconnections experience catastrophic spikes at V4’s parameter count.
Their solution was to impose a mathematical constraint on the residual connections rather than simply expanding them. The architecture they published, Manifold-Constrained Hyperconnections, forces the matrices governing these connections to satisfy a specific algebraic property: every row sums to exactly one, and every column sums to exactly one. A matrix with this property is called doubly stochastic. Its defining characteristic is conservation: a doubly stochastic transformation cannot change the total magnitude of the signal flowing through it. Energy entering a layer and energy leaving a layer are equal. The feedback loop has no amplification to exploit because the mathematics forbid it. The signal cannot blow up, not because the system detects the explosion and corrects it, but because the structure makes the explosion impossible.
To enforce this constraint during training, the system applies the Sinkhorn-Knopp algorithm before each layer: a sequence of alternating row and column normalizations iterated approximately twenty times until the matrix satisfies the doubly stochastic condition exactly. Twenty iterations. Per layer. In a model with hundreds of layers. The overhead sounds catastrophic. Through aggressive low-level GPU optimization, fused computation kernels, selective gradient recomputation, memory access patterns redesigned to avoid unnecessary data movement, the total cost of this process was reduced to 6.7% of training runtime. A small premium against the cost of a crashed run.
Training on more than 32 trillion tokens at this scale carries a second failure mode: loss spikes, sudden acute divergences in the training signal that, if uncorrected, terminate a run. The standard industry response is a checkpoint rollback: stop, restore earlier weights, resume. Expensive, and it does not prevent recurrence. DeepSeek’s alternative was to make routing decisions less sensitive to real-time noise. The system monitors its own internal statistics continuously. When it detects early warning signs of an impending spike, it activates what the paper calls anticipatory routing: rather than using the current parameter state to make routing decisions, it switches to slightly older parameter snapshots. The real trend in training moves slowly, toward a better model. The noise that produces loss spikes moves quickly, in no useful direction. A routing mechanism locked onto recent history filters the noise while preserving the trend, the same principle that makes a moving average more informative than a daily price. When stability returns, the system transitions gradually back to real-time routing. The run does not stop. The model corrects itself in motion.
Part Five: The Infrastructure Layer
Architecture and training stability are necessary conditions for an efficient model. They are not sufficient ones. A model can be optimally designed and still fail to run efficiently if the hardware executing it is poorly utilized. At 1.6 trillion parameters, V4 Pro cannot reside on a single chip or a single rack. Its layers are distributed across multiple racks in a data center, connected by high-speed network cables. While a GPU processes a batch of data, the data for the next computation is traveling toward it. If the GPU finishes before the data arrives, it waits. At commercial inference volumes, an idle GPU is not an abstract inefficiency. It is a measurable cost per second.
DeepSeek’s solution was to choreograph data transfer in overlapping sequential waves. As soon as the data required for the first computation arrives, the GPUs begin working. While they process it, the data for the second computation is already in transit. Computation and communication proceed simultaneously throughout the pipeline. The network cables stay saturated. The compute cores stay active. The system never waits on itself.
Implementing this coordination at the granularity of individual GPU instructions requires more precision than standard high-level programming allows. The team used Triton, a domain-specific language for GPU kernel programming, to write fused kernels: implementations that merge multiple mathematically separate operations into single GPU-level instructions, eliminating the intermediate memory reads and writes that would otherwise occur between them. Each eliminated read-write cycle is a small saving in time and memory bandwidth. Across billions of such operations in a training run or an inference call, the aggregate is significant.
The fused kernels were formally verified using a Z3 SMT solver, a theorem prover that takes code as input and produces a mathematical proof of its correctness. At the operating precision and volume of V4, an error rate of one in a billion is not rare. Testing cannot surface errors that infrequent. Proof can. The verification methodology, the kernel library, and the infrastructure code were all published openly on GitHub alongside the model weights and the technical report. DeepSeek did not just release the model. They released the proof that the model runs correctly.
The New Unit
The previous article in this series, [ [AI Chips: ]](https://fafi25.substack.com/p/after-moore-chip-industry-reinventing-physics?r=s3i91) described a chip industry that, when Moore’s Law closed the path of simple transistor shrinkage, found six simultaneous routes through new physics: new light sources, new transistor geometries, new chemistry, new vertical architectures, new materials for data transmission. No single breakthrough was sufficient. All of them together were. The lesson was that when one direction closes, the field is wide enough to hold several more.
V4 Pro is the algorithm’s answer to the same pressure applied from the other direction. The hardware constraint was imposed from outside, export controls, inaccessible chips, a compute budget that could not be expanded by purchasing. What remained was the software, and the question of how much could be extracted from constrained hardware by redesigning what that hardware was being asked to do. The hybrid attention architecture reduced per-inference computation by seventy-three percent. The compressed KV cache reduced GPU memory requirements by ninety percent. The manifold-constrained residual connections eliminated the primary cause of training instability at this parameter count. The overlapping pipeline eliminated idle time at the infrastructure level. The formal verification eliminated silent error as a risk category. None of these was sufficient alone. All of them together built a model that runs at $0.87 per million output tokens, permanently, not promotionally, because that is what it costs.
The AI race spent its first decade treating cost as downstream of capability: build the best model first, figure out the economics later. V4 inverts that sequence. The cost is not downstream of the architecture. The cost is the architecture. Every design decision that reduced a FLOPs count, shrunk a cache, stabilized a training signal, or saturated a network cable was simultaneously a technical decision and a pricing decision. The $0.87 is not what DeepSeek chose to charge. It is what the model costs to run.
This is also why the standing objection misses. Skeptics have spent more than a year disputing DeepSeek’s economics, SemiAnalysis put the company’s true server capital expenditure near $1.6 billion against a reported training figure of a few million, and they may well be right. But every one of those disputes is about the cost of building the model: a self-reported number that is genuinely hard to audit. The claim here is about the cost of running it, and that is not a disclosure to be doubted. It is an invoice. You do not have to trust DeepSeek’s accounting to verify the $0.87, you only have to send the API a million tokens and read the bill, against an architecture that is published and reproducible. Reviewing the permanent cut from the outside, Greyhound Research arrived at the same place: V4 Pro runs at roughly a quarter of the compute and a tenth of the memory of its predecessor, which is why the price is permanent rather than promotional. Not a discount. An efficiency gain passed through, the sentence at the center of this article, reached independently by a market analyst.
The race did not end. It changed its unit.
But cheaper is only half of a claim. A price that low invites the obvious suspicion, that something was given up to reach it, that the cost came out of the capability. The next piece in this series takes up that suspicion directly. Z.ai’s GLM-5.2, released in June, is the cleanest test case for whether the Chinese labs cut the price by cutting the model, or whether cost and quality were never the same variable to begin with. [forthcoming: the GLM-5.2 piece.]
Coda, Passed Through Again
The price was made permanent in May. Two months later, DeepSeek found more efficiency, not in the model this time but in how it is served, and passed that through as well. In late June it released DSpark, a speculative-decoding framework already running in V4’s live traffic. The mechanism is the one this article described in miniature: a small, fast drafter proposes a block of tokens, the full model verifies the block in a single pass, and rejection sampling keeps only the tokens the full model would have produced on its own. The output is lossless by construction, the same property that makes the $0.87 honest, now turned on speed instead of price. Per-user generation runs 60 to 85 percent faster than the MTP baseline it replaces, on the same hardware: no new chips, no new model, simply more of the bill removed. The unit did not change once and settle. It keeps shrinking.
Note, too, how they shipped it. Not as a sealed product but as a paper, the draft-model checkpoints, and DeepSpec, the MIT-licensed training framework itself, the machinery to build the speedup, open for anyone to inspect, reproduce, or retrain against their own systems; DeepSeek showed it working on other labs’ models, not only its own. This has been the pattern since R1: open weights, a full technical report, the kernel code, the formal proofs, and now the training stack behind the inference. That pattern is worth reading against the backdrop it arrived in. Since February, DeepSeek has been accused by Anthropic and OpenAI of extracting Western models’ capabilities through distillation, of building on borrowed work rather than its own. The public record answers that charge in an unusual way: a lab under accusation responding not with denials but by making everything inspectable. Openness does not settle the narrower technical question of what data trained the model; published weights do not reveal that, and the piece should not pretend they do. But it speaks directly to the larger charge, that the work is not theirs. You do not hand the world a novel architecture, a verified kernel library, and the training framework behind your fastest inference for a system you did not build. Whatever the motive, the effect is a standing invitation to verify, and an invitation is a harder thing to argue with than a denial.
What happens when that invitation is accepted at scale, when one lab’s open framework becomes the next lab’s foundation, is a different argument, and the subject of a later piece in this series.
Sources
-
https://jalammar.github.io/illustrated-transformer
-
https://github.com/vllm-project/vllm-project.github.io/blob/main/_posts/2026-04-24-deepseek-v4.md
-
https://github.com/huggingface/blog/blob/main/deepseekv4.md
-
https://github.com/huggingface/transformers/blob/main/docs/source/en/modeldoc/deepseekv4.md
-

