Lightweight LLM Comparison: Office Scenario Selection and Real Cost Testing

    Choosing the cheapest lightweight model per million tokens often leads to a higher bill. This article breaks down the real cost of office AI requests into input length, output length, cache hit rate, and peak versus off-peak scheduling, then turns that logic into a reproducible evaluation method. You will find a cost formula, a five-category office benchmark design with scoring criteria and sample evaluation code, common failure modes such as lost-in-the-middle and JSON drift, and a three-stage rollout path for routing simple tasks to lightweight models. The takeaway is a method, not a single cheapest model: use task success rate and total cost per task as the north star, and keep cutting spend with caching, off-peak scheduling, and output constraints.

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

    When lightweight models are released in rapid succession, many teams look at the price per million tokens and pick the lowest one. That reasoning does not hold up in engineering practice. The real cost of an office request is determined by four variables: input length, output length, cache hit rate, and whether the call happens off-peak or during peak hours.

    Take the time-based and cache-based pricing published by a cloud provider as an example. Standard input and output prices off-peak can be half to a quarter of peak prices, while cached input can cost an order of magnitude less than uncached input. A model with a higher list price can therefore produce a lower bill if its cache hit rate is high enough and most of its traffic is scheduled off-peak.

    So this article discusses no specific product. Instead, it frames the topic as a general engineering problem: how to select among multiple lightweight models for office scenarios and measure cost with a reproducible method.

    2. Cost Model: Write the Bill as a Formula

    Start by expressing cost as something computable before discussing selection:

    1. cost per request =
    2. input tokens × uncached input price
    3. + input tokens × cache hit rate × cached input price
    4. + output tokens × output price
    5. + extra tokens from failed retries

    The last term is easy to overlook. Differences in stability on structured output and long-table understanding translate directly into retry counts. If a model is 30% cheaper per call but has a 20% higher retry rate, total cost goes up.

    Three actionable conclusions:

    • Cache first: Put system prompts, glossaries, templates, and few-shot examples in the request prefix and keep that prefix stable to earn the cache discount.
    • Schedule by time of day: Queue non-real-time work such as batch summarization, batch translation, and log summarization, and consume it off-peak.
    • Control output: Compress output length with explicit word and structure constraints. Output price is usually several times the input price, so this has the most direct payoff.

    3. Evaluation Method: Make Results Reproducible

    Evaluations usually fail because the task set is too light. Testing a few question-answer pairs produces a ranking with almost no reference value. Split office work into five categories with at least 30 samples each:

    1. Long-document summarization: 8k–30k input tokens, testing information retention and point ordering in long context.
    2. Structured extraction: Pulling fields from contracts, invoices, and meeting notes into strict JSON, testing format compliance.
    3. Table and data understanding: Cross-row and cross-column comparison, unit conversion, and outlier detection.
    4. Rewriting and style unification: Normalizing text from multiple sources into one tone and format.
    5. Multi-turn office assistant: Schedule organization, email drafting, and replies with tool calls.

    Fix the scoring dimensions at five: task success rate, format validity rate, average latency (P50/P95), tokens consumed per task, and actual cost per task. A sample evaluation loop:

    1. def evaluate(model_client, samples):
    2. total_cost, success, fmt_ok, latency = 0, 0, 0, []
    3. for s in samples:
    4. resp, meta = model_client.run(s.prompt, s.context)
    5. total_cost += meta["input_token"] * meta["in_price"] \
    6. + meta["output_token"] * meta["out_price"]
    7. latency.append(meta["elapsed"])
    8. success += int(check_answer(resp, s.golden))
    9. fmt_ok += int(is_valid_json(resp) if s.need_json else True)
    10. n = len(samples)
    11. return {
    12. "success_rate": success / n,
    13. "format_rate": fmt_ok / n,
    14. "p95_latency": sorted(latency)[int(n * 0.95) - 1],
    15. "cost_per_task": total_cost / n,
    16. }

    One point deserves emphasis: all prices, hit rates, and latency numbers must come from your own load-testing environment, not from marketing claims.

    4. Common Failure Modes in Office Scenarios

    • Lost in the middle: Key information in the middle of a long document gets missed. Mitigate it by summarizing in segments and then aggregating, rather than feeding everything in at once.
    • JSON structure drift: Missing fields or extra explanatory text. Mitigate it with field descriptions, examples, and validation retries.
    • Number and unit errors: Common in table tasks. Mitigate it by requiring the model to restate units before answering.
    • Inconsistent style: Tone drifts after multiple rewriting rounds. Mitigate it by fixing style rules into a cacheable prefix.

    5. Selection Advice and Rollout Path

    If your team uses model services on Baidu AI Cloud, you can build a closed loop with general cloud capabilities: object storage for evaluation sets and results, a message queue for off-peak batch scheduling, a container platform for load testing and the inference gateway, and logging plus monitoring alerts to track success rate, P95 latency, and cost trends.

    Recommended three-stage rollout: Stage one runs a smoke evaluation on 100 samples and eliminates candidates with low format compliance. Stage two expands to 300 samples, adds caching and off-peak strategies, and measures real cost per task. Stage three is a canary release with weekly reviews of cost and success rate, dynamically adjusting model routing—simple tasks go to lightweight models, complex tasks escalate to larger models.

    The conclusion points not to a single “cheapest model” but to a method: make task success rate and total cost per task the only north star metrics, and keep pushing the bill down with three levers—caching, off-peak scheduling, and output constraints.