Lightweight LLM Selection and Cost Evaluation for Office Workloads

    This article explains how to select lightweight large language models for office workloads by combining token pricing analysis with business-aligned evaluation. It covers billing structure, per-task cost calculation, evaluation set design, controlled benchmarking, quality-floor-based decision making, tiered routing, and common pitfalls.

    1. Why Office Workloads Need a Separate Evaluation for Lightweight Models

    Many office tasks do not require the strongest reasoning capability. Tasks such as meeting notes summarization, contract clause extraction, weekly report refinement, table field normalization, and email classification usually have clear input structures and output formats. The model requirements center on comprehension accuracy, format stability, and timely response.

    In these scenarios, the value of lightweight models comes mainly from two factors. First, the per-call cost is low, making them suitable for high-frequency, batch tasks. Second, response latency is short, making them suitable for interactive workflows such as in-editor instant rewriting or real-time classification of customer support tickets.

    However, “lightweight” does not mean “directly replaceable.” Different models vary widely in long-text understanding, instruction following, and structured output. The key to selection is to compare price, speed, and quality in the same table rather than looking only at unit price.

    2. Understand the Billing Structure Before Comparing Unit Prices

    Most large model services charge by token, and billing items usually include the following categories.

    • Regular input tokens: the number of encoded user prompts and context.
    • Output tokens: the number of tokens generated by the model, usually priced higher than input.
    • Cached input tokens: the input portion when the same prefix is reused, usually priced significantly lower than regular input.
    • Time-of-day differences: some services use different prices during peak and off-peak periods, and the actual cost during peak hours may be several times higher.

    There is a common misunderstanding here. Directly adding the input unit price and output unit price, or comparing only one of them, cannot reflect the real cost. Office tasks often have long inputs (an entire document, historical conversation) and short outputs (a classification label or a summary), so the weights of the two are very different.

    Therefore, a reasonable approach is to first estimate the average input volume, output volume, and cache hit ratio for each task type, and then calculate the per-task cost.

    3. Convert Unit Prices into Per-Task Cost

    The following is a generic cost calculation function. All parameters use placeholder descriptions and can be replaced with the actual price table of any service.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class PriceTable:
    4. input_per_m: float # Price per million regular input tokens
    5. output_per_m: float # Price per million output tokens
    6. cached_input_per_m: float # Price per million cached input tokens
    7. def task_cost(
    8. price: PriceTable,
    9. input_tokens: int,
    10. output_tokens: int,
    11. cached_tokens: int = 0,
    12. ) -> float:
    13. """Calculate the cost of a single task in the same unit as the price table."""
    14. fresh_input = input_tokens - cached_tokens
    15. cost = (
    16. fresh_input * price.input_per_m
    17. + cached_tokens * price.cached_input_per_m
    18. + output_tokens * price.output_per_m
    19. )
    20. return cost / 1_000_000

    When using it, you should collect the distributions of input_tokens, output_tokens, and cached_tokens for each task type from real business logs rather than using a single estimate. For example, a contract extraction task may average 6,000 input tokens and 300 output tokens, while a title generation task may have 400 input tokens and 20 output tokens. The cost structures of the two task types are very different and should be calculated separately.

    After obtaining the per-task cost, you also need to multiply it by the monthly task volume to get a budget-level figure. It is recommended to keep both peak and average results during calculation to avoid budget distortion caused by price differences during peak periods.

    4. Build an Evaluation Set That Reflects the Business

    Cost is only half of the information. If model output is incorrect or format-unstable, the saved cost will quickly be offset by manual review and rework. Therefore, a business-aligned evaluation set is needed before selection.

    4.1 Stratified Sampling by Task Type

    The evaluation set should cover the main task types in the business and allocate sample counts according to their actual proportions. Common office tasks include:

    • Information extraction: extracting fields such as dates, amounts, person names, and clause numbers from text.
    • Text summarization: generating fixed-length key points for long documents.
    • Content rewriting: rewriting paragraphs in a specified tone or format.
    • Structured output: converting unstructured text into a specified JSON or table format.
    • Classification and routing: determining which ticket category or department an input belongs to.

    For each task type, it is recommended to prepare at least 50 samples and include a certain proportion of edge cases, such as malformed input, documents with missing fields, and very long text.

    4.2 Define Quantifiable Scoring Dimensions

    Scoring dimensions should correspond to business goals. The following four are common.

    1. Accuracy: the degree to which the output matches the reference answer, measured by exact match, field-level match, or human rating.
    2. Format compliance rate: whether the output can be parsed directly by downstream systems, such as whether the JSON is valid and whether fields are complete.
    3. Latency: the time from request issuance to complete response return. It is recommended to record both P50 and P95.
    4. Stability: the degree of consistency in output when the same input is called multiple times, which can be calculated through variance or agreement rate across repeated calls.

    4.3 Choose an Appropriate Scoring Method

    Scoring methods can be roughly divided into three categories.

    • Rule-based validation: suitable for format and field tasks, with fast speed, low cost, and reproducible results.
    • Human spot checks: suitable for open-ended tasks such as summarization and rewriting. It is recommended to sample a certain proportion of cases and have two reviewers score independently, then calculate agreement.
    • Model-assisted review: a stronger model can be used to score outputs, but its own biases, such as a preference for longer answers, need attention. It should be validated against human results for correlation before being used at scale.

    5. Control Variables in Side-by-Side Comparisons

    With the same evaluation set, conclusions are not credible if experimental conditions are not unified. When comparing multiple models, it is recommended to unify the following variables.

    • Prompts: use the same template and fix the number and content of examples.
    • Sampling parameters: unify settings such as temperature and maximum output length. Higher temperature increases output differences for the same input and has an obvious impact on stability evaluation.
    • Context length: ensure that each model receives exactly the same input to avoid result differences caused by different truncation strategies.
    • Repetition count: call each sample at least three times and take the average or majority result to reduce the impact of random fluctuations.
    • Test period: complete all tests within the same period as much as possible to avoid network conditions and service load changes affecting latency data.

    The following is a simplified example of an evaluation workflow. The model interface and scoring function are placeholder implementations.

    1. import statistics
    2. import time
    3. def run_benchmark(model, cases, scorer, repeat=3):
    4. """Run evaluation for a single model and return accuracy and latency statistics."""
    5. scores = []
    6. latencies = []
    7. for case in cases:
    8. for _ in range(repeat):
    9. start = time.perf_counter()
    10. output = model.generate(case["prompt"]) # Placeholder model call
    11. latencies.append(time.perf_counter() - start)
    12. scores.append(scorer(output, case["expected"])) # Placeholder scoring function
    13. return {
    14. "accuracy": statistics.mean(scores),
    15. "latency_p50": statistics.median(latencies),
    16. "latency_p95": sorted(latencies)[int(len(latencies) * 0.95) - 1],
    17. }

    After running this workflow for each candidate model, you can obtain a comparison table containing accuracy, latency, and per-task cost.

    6. Turn Results into Selection Decisions

    After the comparison table is available, decisions should not rely on a single metric. The following steps can be used.

    Step 1: Set quality floors. For example, field accuracy for contract extraction must not be lower than 95%, and format compliance must not be lower than 99%. Models below the floor are excluded directly and do not participate in cost comparison.

    Step 2: Compare unit cost and latency among models that pass the floor. If a model has lower cost but noticeably higher P95 latency, determine whether the task has real-time requirements.

    Step 3: Apply weighting based on business priorities. For batch offline tasks, cost can carry more weight; for interactive tasks, latency and stability should carry more weight.

    Step 4: Validate with a small-scale pilot. After selecting a model, run it for two to four weeks in one department or on one task type, observe the cost curve and error types under real traffic, and then decide whether to roll it out more broadly.

    7. Tiered Routing: Not Every Task Needs the Same Model

    In practice, a better approach is usually not to switch everything to a single model, but to route by task difficulty. Simple, high-frequency, fixed-format tasks go to lightweight models, while complex reasoning and long-document analysis go to stronger models.

    Routing rules can be designed based on the following signals:

    • Task type labels explicitly specified by the business team at call time.
    • Input length, with requests above a threshold forwarded to a stronger model.
    • Historical failure rate, automatically escalating when the same task type repeatedly fails on the lightweight model.
    • Confidence signals, such as format validation failure or missing fields in model output.

    The example code below uses placeholder model names.

    1. ROUTING_RULES = {
    2. "field_extraction": "light_model",
    3. "classification": "light_model",
    4. "long_document_analysis": "strong_model",
    5. }
    6. LONG_INPUT_THRESHOLD = 8000 # Unit: tokens
    7. def route(task_type: str, input_tokens: int) -> str:
    8. if input_tokens > LONG_INPUT_THRESHOLD:
    9. return "strong_model"
    10. return ROUTING_RULES.get(task_type, "strong_model")

    Defaulting to a stronger model helps avoid quality issues caused by unknown tasks being misrouted to a lightweight model. The routing rules themselves should also be included in evaluation, with regular checks on whether the escalation ratio is reasonable. If a large number of tasks are escalated, the applicable scope of the lightweight model has been overestimated.

    8. Common Pitfalls

    Several issues recur in practical evaluation.

    • Looking only at unit price and not task volume. A low-unit-price model may have a higher total cost if its output is verbose.
    • Using a small number of demonstration samples instead of real evaluation. A few examples passing does not mean the business coverage is sufficient.
    • Ignoring the impact of caching. If many requests share the same system prompt or document prefix, the cache hit rate will significantly change the actual cost and should be included in the calculation.
    • Ignoring peak periods. Estimating budgets with averages may lead to overspending during business peaks.
    • Sending model output directly to downstream systems. Even with high accuracy, format validation and exception fallback logic should be retained.

    9. Summary and Recommendations

    For selecting lightweight models in office workloads, the core is to establish a reproducible evaluation process. Specifically, first decompose the cost structure by task type, then measure quality and latency with a business-aligned evaluation set, and finally complete the decision through quality-floor screening, weighted comparison, and a small-scale pilot.

    On this basis, tiered routing can achieve a better balance between cost and quality. As business volume grows, it is recommended to rerun the evaluation set regularly, because model versions, pricing strategies, and business task distributions may all change. Making evaluation a routine process is more effective for controlling long-term cost than one-time model selection.