A Practical Guide to Benchmarking Lightweight Models for Office Workloads

    Choosing a lightweight model (often called a Flash-class model) by price per million tokens alone is misleading. This guide explains why real office workloads shift cost toward input tokens and cache hit rates, how to build a quantifiable office task set across structured extraction, summarization, table handling, and multi-turn dialogue, how to verify prefix caching with reproducible calls, and how to model cost with time-of-day pricing. It also covers the metrics matrix for quality, latency, cost, and stability, common pitfalls, and a layered routing approach for production.

    1. Why “Cheaper Per Token” Does Not Mean “Cheaper Overall”

    In discussions about lightweight models (commonly called Flash-class models), the metric that gets amplified most is the price per million tokens. Public pricing is usually split into three parts: regular input, cached input, and output. The cache-hit price is often only a few percent of the regular input price, while the output price is typically several times the input price. Comparing just one of these segments easily leads to the wrong conclusion.

    Real office workloads have three characteristics that directly overturn the assumption that the lowest unit price is the best choice:

    1. Long input, short output. Tasks such as contract review, meeting notes, and long-document summarization often take thousands to tens of thousands of input tokens but produce only a few hundred output tokens. Cost is driven mainly by the input side, making the cache hit rate the first sensitive factor.
    2. Highly repetitive prefixes. System prompts, enterprise knowledge base snippets, and template instructions repeat heavily across calls, which determines whether caching can be used effectively.
    3. Pronounced peak and trough patterns. Calls cluster during working hours and nearly stop during idle periods. If a platform uses time-of-day pricing, the idle price and peak price can differ by several times, so the daily average cost depends on the real call-time distribution of the business rather than the list price.

    Conclusion: a benchmark must center on cost per task and latency per task, not unit price.

    2. Evaluation Design: Breaking Office Work into a Quantifiable Task Set

    Group office tasks into four categories, each with automatically scorable metrics.

    • Structured extraction: extract fields (time, amount, responsible party) from long text; metrics are field-level accuracy and hallucination rate.
    • Long-text summarization and rewriting: metrics are key-point coverage, factual consistency, and length compliance rate.
    • Table and semi-structured processing: input is tabular text and output is a normalized format; metrics are format validity rate and numeric correctness rate.
    • Multi-turn office dialogue: includes follow-ups, revisions, and added constraints; metrics are instruction retention rate and per-turn success rate.

    A task set of at least 30 items per category is recommended, with 20% reserved as a “regression set” for quick validation after model or prompt changes.

    3. Reproducible Calls and Cache-Hit Verification

    To verify that caching actually works, you must control variables: fix the system prompt and knowledge base prefix, fix randomness parameters, issue consecutive requests with the same prefix serially, and compare the observable usage fields in the responses.

    1. # Example: verify whether prefix caching takes effect (pseudo-interface, structure only)
    2. import time
    3. SYSTEM_PREFIX = "You are an enterprise office assistant..." * 200 # long and fixed prefix
    4. def call(messages, temperature=0.0):
    5. t0 = time.time()
    6. resp = client.chat.completions.create(
    7. model=MODEL_NAME,
    8. messages=messages,
    9. temperature=temperature,
    10. )
    11. usage = resp.usage # watch the three usage segments: input, cached input, output
    12. return resp.choices[0].message.content, usage, time.time() - t0
    13. # The first call establishes the cache; the second shows whether cached input rises significantly
    14. msgs = [{"role": "system", "content": SYSTEM_PREFIX},
    15. {"role": "user", "content": "Please summarize the following meeting notes..."}]
    16. for i in range(2):
    17. text, usage, cost_ms = call(msgs)
    18. print(i, usage, round(cost_ms, 2))

    Criterion: from the second request onward, “cached input” should be close to the fixed prefix length. If it stays at 0, the prefix was truncated, the order was changed, or caching is not enabled on the platform side.

    4. Cost Model: Writing Time-of-Day and Caching into the Formula

    Let the regular input price be P_in, the cache-hit input price be P_cache, and the output price be P_out; for a single task with input I, of which the cacheable prefix is C, and output O:

    1. Cost per task = (I - C) * P_in + C * P_cache + O * P_out
    2. Daily cost = Σ cost per task (substitute the price for the corresponding peak/trough period)

    Three practical conclusions follow:

    • When C/I is high, the real cost gap between models shrinks significantly; a 2x list-price difference may work out to 1.2x in practice.
    • Output is a small share, but the output price multiplier is high, so long-output tasks must be modeled separately and cannot be extrapolated from short-output tasks.
    • Under time-of-day pricing, deferrable tasks (such as overnight batch summarization and offline archiving) should be scheduled for idle periods; this optimization often pays off more than switching models.

    5. Measurement Dimensions and Observation Criteria for Office Scenarios

    Record four kinds of data at the same time to form a comparable matrix:

    Dimension Observation points Notes
    Quality Field accuracy, key-point coverage, format validity rate Manually spot-check 10% to prevent distortion of automated metrics
    Latency Time to first token, overall latency P50/P95 Office interaction is more sensitive to time to first token
    Cost Cost per task, cache hit rate Align with billing definitions before comparing
    Stability Rate-limit trigger rate, timeout rate, retry rate Especially critical during peak hours

    It is worth stressing that models differ in effective utilization under long context, and there is a gap between the nominal context length and the actually usable length. Test by “whether key information can be correctly recalled after being inserted,” not just by reading the spec sheet.

    6. Common Pitfalls

    1. Inferring long-output cost from short-output tasks, causing budget deviations of several times.
    2. Ignoring cache invalidation caused by prompt changes, where the cache hit rate drops sharply and cost doubles.
    3. Measuring only the average and not P95; office scenarios have very low tolerance for tail latency.
    4. Treating demo results as production results, with no regression set or spot-check mechanism.
    5. Overlooking data compliance and record keeping; office documents often contain sensitive information, so masking and logging policies must be defined in the architecture.

    7. Implementation Advice: Layered Routing and Continuous Evaluation

    A more robust production approach is layered routing: use lightweight models for highly repetitive tasks such as format conversion, extraction, and classification; hand complex reasoning and high-risk output to more capable models; and schedule deferrable batch tasks for idle periods. On the engineering side, use object storage to keep original documents, a message queue for peak shaving, and logging services with monitoring and alerting to observe latency and failure rates, forming a closed loop.

    If an organization already uses the relevant general capabilities of Baidu AI Cloud, the evaluation scripts above can be plugged into the existing model service call chain, tracking quality and cost continuously with a unified usage definition and monitoring dashboard, turning model selection from a one-off comparison into ongoing operations.