How to Break Down LLM Inference Pricing Costs: A Three-Layer Framework

    This article presents a method for decomposing large language model inference costs instead of comparing per-token price changes directly. It explains how total parameters drive cluster capacity, activated parameters affect memory bandwidth and latency, and attention design determines compute usage, then shows how to combine these three cost lines into a unit-cost multiple and compare it against the price multiple. A reusable evaluation checklist and practical self-check suggestions for both consumers and providers are included.

    1. The Problem: Price Changes Are Not Cost Changes

    When a cloud provider releases a new-generation large model and announces per-token pricing, the most common community reaction is to subtract the old price from the new one: input went up by a few times, output went up by a few times, and therefore the pricing must be “too high.” This reasoning chain is missing a link. The denominator of the unit price is tokens, while the numerator of cost is determined jointly by three independent resource lines: memory capacity, memory bandwidth, and compute occupancy. These three lines scale according to completely different rules, so there is no fixed proportional relationship between a change in unit price and a change in unit cost.

    This article uses the public structural parameters of a new-generation sparse-architecture model (a lightweight tier with 283B total parameters and a heavy tier with 1.6T total parameters) and its predecessor (671B total parameters, 37B activated) as source material to abstract a cost-decomposition method. The article does not evaluate any specific vendor’s pricing; it discusses only the method itself.

    2. The Three Cost Lines and Their Scaling Rules

    2.1 Total Parameters Determine Service Cluster Size

    Total parameters first affect how much the weights occupy in memory. Estimating with common low-precision storage and parallel partitioning, 1.6T parameters require roughly 1.6TB of memory to fit completely, at about 1 byte per parameter, not yet counting the KV cache and runtime overhead. This determines the minimum scale of the multi-card cluster needed to serve a model. It is a capacity-type cost, independent of request volume, and a fixed overhead.

    However, fixed overhead does not scale linearly with total parameters into a “per-card unit cost.” When large-scale expert parallelism is used, experts are spread across a large number of cards. As the total number of cards in the cluster grows, the share of weights carried by each card stays roughly constant, so the unit cost converted to a single card does not show a significant jump. This is the most easily overlooked yet most critical point in the original material.

    2.2 Activated Parameters Determine Memory Bandwidth Pressure and the Latency Floor

    During autoregressive decoding, every generated token requires reading the activated weights from memory once, which is a typical memory-bandwidth-bound process. Reducing activated parameters from 37B to 13B means the weight-reading volume per token drops to about one-third, and the per-request latency floor drops accordingly.

    It needs to be emphasized that this is the dominant factor only when concurrency is low and the batch cannot be filled. Actual online serving packs the batch close to saturation, spreading the memory-bandwidth cost across a large number of requests, at which point the marginal impact of activated parameters on total cost is significantly weakened. Using a drop in activated parameters to argue for a large cost reduction does not hold under real production workloads.

    2.3 The Attention Mechanism Determines Compute Occupancy, with a Quadratic Relationship

    Attention is the only one of the three lines that clearly consumes compute, and its overhead grows quadratically with the context length included. Reducing the attention-included length from 2048 to 1024 cuts compute occupancy to about one-quarter; reducing it to 512 cuts it to about one-sixteenth. This is the most dramatic reduction in the source material.

    Combined with ultra-sparse attention (compressing long context to about one-hundredth, so 1M tokens compress to only about 7K tokens participating in computation) and fixed-length sliding-window attention (a fixed 128-token overhead), the compute cost for long-context scenarios is pushed close to negligible. The general engineering implication here is that the goal of attention design is not “supporting longer” contexts, but “keeping length out of the quadratic term.”

    3. Combining the Per-Item Reductions into Unit Cost

    The following illustrative table aligns the two generations’ structures and cost directions (values are order-of-magnitude illustrations, not measurements):

    1. Item Previous gen (671B/37B) Lightweight (283B/13B) Heavy (1.6T/49B)
    2. Total params (capacity) 1x ~0.5x ~3x
    3. Activated params (bandwidth) 1x ~1/3 ~1.3x
    4. Attention included (compute) 2048 512 (1/16) 1024 (1/4)
    5. Sliding window / ultra-sparse none/none 128 / 128x 128 / 128x

    For the lightweight tier, all three lines drop at the same time, so the unit cost is significantly lower than the previous generation, while the input unit price drops by about 50% and output by about 30%. The price reduction is smaller than the cost reduction, so the gross margin therefore improves. For the heavy tier, the capacity and bandwidth lines rise to about 3x, while the compute line instead drops to one-quarter, and the capacity line is diluted by expert parallelism. The combined unit cost rises by far less than 6–8x, while the unit price rises 6x for input and 8x for output.

    Conclusion: To judge whether pricing is too high, you must compare the “price multiple” with the “combined unit-cost multiple,” not with the multiple of any single per-item line.

    4. A Reusable Evaluation Checklist

    For any per-token quote, it is recommended to work through the following order:

    1. Capacity line: total parameters and parallelism strategy, to estimate the minimum cluster size and fixed amortization;
    2. Bandwidth line: activated parameters and expected batch fill rate, to determine whether the bottleneck for latency and throughput is on which side;
    3. Compute line: whether the attention-included length enters the quadratic term, and whether long context has compression or sliding-window fallback;
    4. Combination: weight the three lines by business workload to obtain the unit-cost multiple, then compare it against the price multiple;
    5. Trend: distinguish “genuine concession” from “premium give-back.” In the former, unit cost falls faster than price; in the latter, the reverse.

    5. Self-Check Suggestions on the Engineering Side

    For consumers, the same model can differ enormously in cost depending on how it is called: compressing context to the necessary length, reusing prefix caching, performing retrieval and summarization on long documents before feeding them into the model, and choosing a tier based on the input-to-output ratio can all reduce cost without changing the model. For providers, filling the batch, improving the per-card utilization of expert parallelism, and using monitoring alerts and logging services to locate memory-bandwidth bottlenecks are the proper ways to convert pricing room into real gross margin.

    In related practices at Baidu AI Cloud, this kind of evaluation is usually done together with the resource profiles of monitoring alerts, logging services, and container platforms: first quantify the three cost lines, then discuss whether the unit price is reasonable. The method is transferable; the conclusions must be calculated for yourself.