Large Language Model Compute Costs and Engineering Governance as R&D Funding Grows

    This article explains how large language model costs break down into training, inference, and infrastructure. It covers how to estimate per-request spending, choose a billing model, instrument calls for cost attribution, apply cost-reduction techniques, and set up budgeting and review processes.

    1. Background: From “Can We Build It?” to “Can We Afford It?”

    In the past one to two years, funding for large model development has grown noticeably. Public reports show that some large model companies have completed several funding rounds within a few months, with cumulative amounts reaching the order of 100 billion yuan. Ample funding means teams can buy more compute, expand engineering teams, and run experiments over longer periods. However, a larger budget does not lower unit costs on its own. Training and inference costs rise together with model size, request volume, and context length. Without cost governance, a budget can run out within a few quarters.

    As a result, the questions technical leaders must answer have changed. In the past, the focus was on whether a usable model could be trained. Now the more pressing question is whether the cost of every call and every experiment can be explained, predicted, and optimized.

    2. Cost Structure: Training, Inference, and Infrastructure

    Costs for large models usually fall into three categories, and each needs a different governance approach.

    1. Training costs: compute consumed during pretraining, continued training, instruction fine-tuning, and reinforcement learning. This spending is concentrated and largely one-time, so it suits project-based budgeting with a spending cap and milestone-based reviews.
    2. Inference costs: fees for online serving and offline batch calls. They grow with request volume, making them the part that most needs ongoing monitoring in long-term operations. After a model goes live, inference costs often exceed training costs.
    3. Infrastructure costs: storage, network transfer, data processing pipelines, logging, and monitoring services. These costs are easy to underestimate, but their share grows as the business scales.

    Each cost type also needs a different attribution method. Training costs can usually be mapped to experiment IDs, while inference costs need to be mapped to business APIs, tenants, or product modules. If attribution is too coarse, there is no clear starting point for optimization.

    3. Estimating the Cost of a Single Request

    For token-based billing, the cost of one request can be estimated with the following formula:

    Cost per request = input tokens / 1000 × input price + output tokens / 1000 × output price

    In practice, use the actual distribution of input and output lengths rather than averages alone. Long-tail requests, such as very long contexts or multi-turn tool calls, often account for most of the spending. The example below shows how to estimate monthly cost from daily request volume. Replace the prices with the latest prices published by the provider.

    1. function estimate_monthly_cost(
    2. requests_per_day, # average daily requests
    3. avg_input_tokens, # average input tokens
    4. avg_output_tokens, # average output tokens
    5. price_input_per_k, # price per 1,000 input tokens
    6. price_output_per_k, # price per 1,000 output tokens
    7. days = 30 # number of days in the period
    8. ):
    9. total_input = requests_per_day * avg_input_tokens * days
    10. total_output = requests_per_day * avg_output_tokens * days
    11. cost = total_input / 1000 * price_input_per_k
    12. + total_output / 1000 * price_output_per_k
    13. return cost

    Compare the estimate against the actual bill once a week. When the deviation exceeds a set threshold, the statistical scope or business assumptions have likely changed, and the estimate needs recalibration.

    4. Choosing a Billing Model

    There are two common billing models.

    • Per-call billing: a fixed fee for each call. It suits scenarios with similar request complexity and stable call volume, where budgets are easy to predict. However, for very long texts or complex tasks, per-call billing may not match the actual compute used.
    • Token-based billing: charges depend on the number of input and output tokens. Costs track actual compute more closely, which makes this model suitable for long texts and generative tasks. In multi-turn conversations, prior history, system instructions, and tool return values usually count toward input tokens, which is easy to overlook.

    When choosing a billing model, test it against your request distribution rather than comparing unit prices alone. Whichever model you use, follow the latest rules published by the provider and review them regularly.

    5. Observability: Making Costs Attributable

    Cost governance depends on observability. Record the following information for every call:

    • Business line, feature module, and tenant ID, for cost attribution.
    • Model version and deployment environment, for comparing price-performance across versions.
    • Input and output token counts, response latency, and retry count, for analyzing how per-request cost relates to user experience.
    • Cache hit status, for evaluating the actual benefit of the caching strategy.

    This data can be written to a logging service, and a monitoring and alerting system can then build dashboards from it. Set up three types of alerts: when daily cost exceeds a set percentage above the baseline, when the cost of a single request exceeds a threshold, and when the retry rate rises abnormally, since retries directly inflate costs.

    6. Common Cost-Reduction Methods and Trade-offs

    Cost-reduction measures usually involve trade-offs in quality, latency, or maintenance effort, so evaluate each one individually.

    1. Caching: reuse results for identical or highly similar requests. This suits Q&A and retrieval scenarios, but you need to handle cache invalidation and personalized content.
    2. Prompt trimming: remove redundant system instructions and repeated context to reduce input tokens. This is low-cost work, but it must be paired with effectiveness evaluation to avoid deleting critical constraints.
    3. Tiered model routing: send simple requests to smaller models and complex requests to larger ones. Routing rules should be based on task type or classification results, and routing accuracy should be validated continuously.
    4. Batch processing: merge non-real-time requests to improve resource utilization. The trade-off is higher latency, so this suits offline analysis, data labeling, and similar tasks.
    5. Quantization and distillation: reduce inference cost by lowering numerical precision or training smaller models. Both can cause some loss in effectiveness, so validate them with your own business evaluation sets.
    6. Rate limiting and quotas: set call limits for each business line to prevent abnormal traffic or runaway call loops from causing sudden cost spikes.

    Actual savings depend on your workload. Collect data through load testing and gradual rollouts rather than applying other teams’ figures directly.

    7. Organizational Process: Bringing Cost into the R&D Loop

    Process matters as much as tooling. The following practices are effective in most teams.

    • Layered budgets: set a company-wide total budget, allocate quotas to business lines, and give each experiment project its own quota. Requests that exceed a quota need separate approval.
    • Pre-release cost review: before a new model or feature goes live, submit estimated per-request and monthly costs as part of the release review.
    • Weekly cost review: the engineering lead and product lead review the dashboard together, focusing on abnormal fluctuations and high-cost endpoints, and record optimization action items.
    • Experiment cost logging: record resource consumption and results for every training run and evaluation, so the return on investment can be assessed later.

    8. Summary

    Funding determines the upper limit of resources a team can invest, while cost governance determines how much effective output those resources produce. Technical teams should build cost models, observability systems, and approval processes before funds arrive, so that every part of the budget has a clear purpose and a measurable return.