Engineering Selection Strategies Behind the Surge in LLM Token Consumption
This article explores engineering strategies for selecting and deploying Large Language Models (LLMs) in high-concurrency scenarios. It covers the benefits and technical boundaries of lightweight models, the architectural nuances of Mixture of Experts (MoE), the cost implications of long context windows, comprehensive cost calculation methods, tiered routing strategies, and the application and risks of semantic caching. Readers will gain practical insights into optimizing LLM performance and cost in real-world applications.
Recently, various rankings regarding LLM API call volumes have emerged, but the weekly call numbers, statistical regions, metrics, and cycles provided by different institutions often vary. Direct comparisons can easily lead to incorrect conclusions. Instead of relying on specific ranking numbers, this article discusses why lightweight models are becoming popular, where their technical boundaries lie, and how developers should select and deploy models in high-concurrency scenarios.
1. Why Lightweight Models Are Popular
In high-frequency tasks such as intelligent customer service, text polishing, and information extraction, the first thing users notice is response speed. Time to first token (the time from sending a request to returning the first token) and output speed directly impact the user experience. These tasks typically do not require complex multi-step reasoning, giving lightweight models an advantage in both latency and per-call cost.
Common practices for lightweight models include reducing the number of activated parameters per call, optimizing attention computation, and using quantization to lower VRAM usage. These methods all improve the concurrent throughput of a single GPU. However, they come with trade-offs. For example, quantization may reduce the accuracy of mathematical reasoning and code generation, so it must be validated with your own business data before going live.
2. MoE Architecture: Total Parameters vs. Activated Parameters
The Mixture of Experts (MoE) architecture is a design adopted by many LLMs today. The model contains multiple expert sub-networks, and a gating network (Router) selects a few experts for each input token to participate in the computation, while the rest remain inactive. This sparse activation means the computational load during a single inference pass is much smaller than the total parameter count.
A common description in articles is “224B total parameters, 12B activated parameters.” These figures must specify the model name and version for verification. When reading such metrics, note two key points:
First, the activation ratio does not directly equate to VRAM savings. During inference, the weights of all experts usually need to reside in VRAM or high-speed storage, because the gate cannot determine in advance which experts will be selected. Therefore, VRAM usage often still scales with the total parameter count; the savings are primarily in computation.
Second, MoE introduces additional engineering overhead. Gating computation, expert load imbalance, and cross-GPU communication during distributed deployment can all affect actual latency. Some services mitigate load imbalance through auxiliary losses or capacity limits, but the effectiveness must be observed under real traffic.
3. Long Context: Capability Limits and Cost Curves
Some models support context windows of up to a million (1M) tokens in specific versions, but supporting a certain length does not mean it can be stably utilized in every scenario. Before deployment, three things should be confirmed: whether the context limit for that version is documented in the official documentation, whether output quality remains stable under long text inputs, and how pricing and latency change with long inputs.
The main cost of long context lies in the KV Cache. The KV Cache stores the key-value vectors of historical tokens, and its VRAM usage grows almost linearly with the sequence length. Common optimization methods in the industry include:
- PagedAttention: Manages the KV Cache in pages to reduce VRAM fragmentation and improve VRAM utilization for concurrent requests.
- KV Cache Quantization: Reduces cache precision in exchange for higher concurrency, at the cost of potentially affecting the reproduction of long-text details.
- Sliding Window Attention: Focuses only on the most recent tokens to reduce computation, but will lose information outside the window.
Long texts also exhibit the “lost in the middle” phenomenon, where critical information placed at the beginning or end of a document often has higher recall rates. Therefore, for long document Q&A, a more robust approach is to perform retrieval first and then feed only the relevant segments into the model.
4. Cost Calculation: Look Beyond Unit Price
Many teams assume that a low unit price guarantees low costs. The actual cost is determined by the following formula:
Cost per call = Input Token Count × Input Unit Price + Output Token Count × Output Unit Price
Output tokens are usually more expensive than input tokens, and the output length is heavily influenced by the prompt and task type. A summarization task that limits output to 200 words and a task that generates long articles freely can differ in cost by several times.
Cost optimization should consider three aspects: model pricing, cache hit rate, and concurrency utilization. For highly repetitive requests, the impact of the cache hit rate often outweighs minor fluctuations in unit price. If an article claims a model’s cost has dropped to a fraction of a traditional model, verify the testing conditions, including task type, input/output length, batching method, and precision settings. Multiplicative conclusions without these conditions should not be used as a basis for model selection.
5. Tiered Routing: Directing Simple Tasks to Lightweight Models
It is usually not suitable for enterprises to route all requests to a single model. A common practice is to place a lightweight intent recognition layer at the front to distribute requests to different model tiers. Below is a starter routing table where thresholds need to be calibrated with your own data:
| Task Type | Recommended Tier | Determination Method | Monitoring Metrics | Fallback Strategy |
|---|---|---|---|---|
| Text polishing, information extraction | Lightweight model | Intent classification confidence ≥ 0.85 | Time to first token, format validity rate | Escalate to standard model upon format validation failure |
| Customer service Q&A | Lightweight model + knowledge base retrieval | Retrieval hit score reaches threshold | Resolution rate, handover to human rate | Hand over to standard model or human agent if not hit |
| Code generation, multi-step math reasoning | Deep reasoning model | Request contains code blocks or multi-step conditions | Unit test pass rate, cost per call | Degrade after timeout and notify user |
| Long document Q&A | Standard model + retrieval | Document exceeds set length | Answer citation accuracy | Return “unable to determine” if retrieval is empty |
The intent recognition gateway itself must also be monitored. It is recommended to track its classification accuracy, added latency, and call cost. If the latency added by the gateway accounts for too high a proportion of the total latency, the benefits of tiering will be offset. When deploying routing rules, you can start with 5% of traffic in a canary release, observe metrics for two weeks, and then gradually scale up.
6. Semantic Caching: Saves Money, but Prevent Incorrect Reuse
In high-concurrency scenarios, similar requests are common. Semantic caching computes an embedding for the request content, compares it with historical requests, and directly returns the historical result if the similarity exceeds a threshold. This practice can reduce a large number of repetitive calls, but it carries clear risks.
First, a low threshold can cause false hits. For example, “refund rules” and “return rules” may be very close in vector space, but the answers are completely different. The threshold needs to be determined through a manually labeled sample set, and the false hit rate should be recorded.
Second, historical answers may expire. Prices, policies, and product information change, so it is necessary to set a TTL (Time to Live) for the cache and actively invalidate relevant entries when the knowledge base is updated.
Third, caching may leak data. Caches for different users and different tenants must be strictly isolated.
