How LLM Inference Gross Margin Turns Positive on Domestic AI Chips: A Technical Breakdown

    This article breaks down why positive inference gross margin is an engineering metric rather than a marketing claim, and how it can be achieved on large-scale domestic accelerator clusters. It covers a four-layer cost model per million tokens, model-side levers such as sparsification, distillation, quantization, and speculative decoding, hardware and operator-level optimization, and inference engine techniques including continuous batching and KV Cache management. It also explains how revenue-sharing models and metering affect margin attribution, outlines a phased rollout plan, and lists common pitfalls to avoid.

    1. The Phenomenon: Why “Positive Inference Gross Margin” Is an Engineering Metric, Not Marketing

    The core information in the source material can be abstracted into three points. First, commercialization of the main model series and cloud-side revenue sharing are growing together, with profit margins improving quarter over quarter. Second, management has reiterated the annual recurring revenue target, indicating that revenue recognition has shifted from one-time delivery to sustainable subscriptions and usage-based metering. Third, a cluster of more than one hundred thousand domestic accelerator cards is being used for large-scale, low-cost inference, and a lightweight model has achieved a shift from negative to positive gross margin per request on that hardware.

    Put together, the conclusion is not mysterious: inference gross margin = (revenue per request − cost per request) / revenue per request. A positive result can only come from two paths — improving effective throughput per unit on the numerator side (amortizing the fixed cost per card per hour), and reducing energy consumption and engineering overhead per million tokens on the denominator side. This means it must be a measurable and reproducible engineering result, not conceptual packaging.

    2. Cost Model: Breaking Down “Cost per Million Tokens” to an Optimizable Granularity

    Any inference optimization without a unified measurement standard degrades into local parameter tuning. It is recommended to break cost into four layers first:

    • Hardware amortization layer: accelerator card purchase or lease cost / effective service hours. Note the word “effective” — failures, queuing, and idle time generate no revenue.
    • Energy and cooling layer: total system power × electricity price × PUE. For domestic clusters, this item is often high in the early stages of compatibility tuning.
    • Software and operations layer: the manpower and resource consumption required to build the inference engine, scheduling system, monitoring and alerting, and logging services.
    • Quality loss layer: extra calls caused by retries, fallback to larger models, and long-context truncation made to reach acceptable accuracy.

    The illustrative gross margin calculation logic can be written as:

    1. def gross_margin(req, cost):
    2. # revenue_per_mtok: selling price per million tokens
    3. # cost_per_mtok: sum of the four items below
    4. revenue = req.tokens / 1e6 * cost.revenue_per_mtok
    5. c = (cost.hw_amort + cost.power + cost.ops) * req.elapsed_h \
    6. + req.tokens / 1e6 * cost.quality_loss_per_mtok
    7. return (revenue - c) / revenue

    The key insight is that fixed costs are truly amortized only when elapsed_h (the card hours occupied by a single request) is reduced. This also explains why “high-concurrency small models” often achieve positive gross margin earlier than “low-concurrency large models.”

    3. Model Side: Lightweighting and Structural Modification Are the First Lever

    The material mentions that a lightweight version of a model turned positive first on domestic hardware, which is inevitable from an engineering perspective. Reusable practices include:

    1. Sparsification and expert routing: decouple total parameter count from activated parameters per token, so that compute consumption grows with actual complexity rather than linearly with parameter scale.
    2. Distillation and data mix: use a large model to generate high-quality instruction data, feed it back to train a small model, approach the desired performance on target tasks, and compress the context length requirement to the actual business distribution range.
    3. Quantization and low-precision inference: adopt different precision strategies for weights and KV Cache; reduced memory bandwidth pressure translates directly into throughput improvement.
    4. Speculative decoding and draft models: use a very small model to propose candidates and a large model to verify, significantly reducing the number of large-model forward passes at an acceptable acceptance rate.

    It should be emphasized that all of the above are general industry methods, and specific gains vary greatly depending on model structure and business distribution; there is no universal multiplier.

    4. Hardware and Operator Layer: The “Last Mile” for Domestic Clusters Is Usually the Software Stack

    The real difficulty of a hundred-thousand-card-level cluster is not total compute, but operator coverage and communication efficiency. Common convergence paths in practice:

    • Operator completion and graph optimization: write or auto-tune kernels for high-frequency operators to reduce paths that fall back to generic implementations; use operator fusion to reduce memory accesses.
    • Memory and parallelism strategy matching: tensor parallelism controls per-card memory pressure, pipeline parallelism improves cluster utilization, and expert parallelism requires focused governance of long tails caused by routing imbalance.
    • Communication-topology-aware scheduling: constrain parallel groups with high communication density within the same switching domain to avoid cross-domain bandwidth becoming a bottleneck.
    • Elasticity and fragmentation governance: inference workloads have clear peaks and valleys, and oversubscription and time-sharing reuse can significantly improve effective utilization.

    A simplified throughput estimate helps determine the optimization direction:

    1. # Approximation: throughput ≈ concurrent batch size / single-batch latency
    2. # single-batch latency ≈ compute time + memory access time + communication time
    3. def est_throughput(batch, t_compute, t_mem, t_comm):
    4. return batch / (t_compute + t_mem + t_comm)

    If t_comm accounts for too high a proportion, prioritize topology and parallel partitioning; if t_mem dominates, prioritize quantization and KV Cache management.

    5. Inference Engine: Continuous Batching and KV Cache Governance Determine the Margin Curve

    • Continuous batching: replace request-level batching with iteration-level scheduling to avoid short requests waiting for long ones. In practice, this is the most direct way to improve effective throughput.
    • PagedAttention-style paged cache: manage KV Cache in blocks to reduce fragmentation and reservation waste, keeping memory controllable under high concurrency.
    • Prefix reuse: system prompts, tool definitions, and few-shot examples are highly repetitive across requests; prefix cache hits can directly eliminate repeated prefill computation.
    • Long-context tiering: for very long inputs, use retrieval-based pre-compression or layered caching to avoid a single prefill consuming the entire batch compute budget.

    Illustrative scheduling skeleton:

    1. while engine.running():
    2. batch = scheduler.form_batch(max_tokens=8192)
    3. logits = model.forward(batch) # one forward pass serves multiple requests
    4. scheduler.update(batch, logits) # iteration-level reclamation of completed sequences
    5. cache.evict(policy="lru") # KV block reclamation and reuse

    6. Commercialization and Metering: How the Revenue-Sharing Model Affects Margin Structure

    The material shows that revenue is realized through sharing and profit margins are improving quarter over quarter, which suggests the metering system must align with the cost accounting standard; otherwise, gross margin cannot be attributed. Recommendations:

    • Unify metering dimensions to tokens and call counts, distinguishing input/output and cache hits/misses;
    • Build gross margin dashboards by model, by tenant, and by region, connecting monitoring, alerting, and logging services to cost accounting;
    • Conduct separate gross margin sensitivity analysis for free quotas and promotional discounts to avoid scale growth masking deteriorating unit economics;
    • When using annual recurring revenue as the north star metric, track unit economics in parallel to prevent “revenue rising, gross margin falling.”

    7. Phased Implementation Roadmap

    1. Baseline phase (2–4 weeks): unify the metering standard, collect card hours, energy consumption, latency, and failure rate, and produce a credible cost baseline per million tokens.
    2. Engine phase (4–8 weeks): launch continuous batching, paged cache, and prefix reuse; this stage usually brings the most obvious throughput improvement.
    3. Model phase (8–12 weeks): use a distilled small model to handle high-traffic intents and a large model as fallback for complex requests, forming a routing hierarchy.
    4. Hardware phase (12 weeks+): complete operators, land quantization, and implement topology-aware scheduling to gradually approach the cluster’s theoretical utilization.
    5. Operations phase: use the gross margin dashboard to drive pricing and capacity planning, forming a “cost—pricing—capacity” loop.

    8. Common Pitfalls

    • Looking only at peak QPS without effective card-hour utilization, leading to no profit even after scaling up;
    • Skipping business-set evaluation after quantization; accuracy regression triggers retries and costs rise instead;
    • Persistently low prefix cache hit rate, indicating problems with prompt engineering and cache key design;
    • Attributing positive gross margin to a single piece of hardware while ignoring the contribution of scheduling and metering systems.

    In summary, positive inference gross margin is essentially the combined result of “improved effective throughput per unit + reduced cost per token + aligned metering and pricing.” For developers and enterprise users, building measurement first, then modifying the engine, and finally tuning models and hardware is the lowest-risk and fastest-to-result order.