Evaluating LLMs for Enterprise Use: Methods, Metrics, and Cost Accounting

    General-purpose leaderboards can only tell you so much about how a large language model will perform in your actual business workflows. This article walks through how to build a structured, reproducible evaluation framework: decomposing capabilities into verifiable tasks, defining scoring criteria up front, measuring answer calibration and hallucination rates, and calculating cost per effective task instead of relying on per-call pricing. A code skeleton is included to illustrate how to record results and compute refusal metrics and task-level cost.

    1. Why Model Selection Needs Structured Evaluation

    General leaderboards reflect a model’s rough capability level, but they cannot answer more specific questions: can a given model handle a particular category of your business? Leaderboard tasks often differ from real workflows, and score gaps may come from task distribution, prompt templates, or scoring rules rather than the model itself.

    That’s why enterprises need a reproducible evaluation framework that breaks “capability” into tasks, metrics, and costs that can be verified item by item. Structured evaluation comes down to three things: tasks drawn from real business work, scoring criteria defined in advance, and results that record both quality and cost.

    2. Office Scenarios: Breaking Capabilities into Verifiable Tasks

    Typical office tasks include meeting note summarization, Q&A over policy documents, table data extraction, drafting and rewriting emails, and aggregating information across documents. Before evaluation, classify tasks by workflow, and for each task type define input samples, expected output formats, and scoring criteria.

    Use multi-dimensional scoring, with each dimension scored separately:

    • Completeness: Does the output cover all required content points?
    • Accuracy: Are facts, figures, and dates consistent with the source material?
    • Format compliance: Does it satisfy template, field-order, and length constraints?
    • Usability: How much rework would a business user need to do?

    A task counts as passed only when every dimension meets its threshold. Pass rate is a better proxy for day-to-day experience than average score, because a single critical numeric error can make an entire output unusable.

    3. Finance Scenarios: Building Task Sets from Real Business Data

    Finance scenarios demand higher accuracy and stricter compliance. Evaluation data should come from real business wherever possible, but must be anonymized before use—removing account numbers, ID numbers, customer names, and other sensitive fields—and the anonymization rules should be documented.

    Samples should cover major business lines as well as edge cases, such as conflicting clauses, missing key data, or statistical definitions that changed between reporting periods. Using only typical samples will overestimate model performance in complex situations.

    The basic process for blind human review looks like this:

    1. Normalize the formatting of all outputs and remove model identifiers and stylistic tells.
    2. Reviewing experts score independently without knowing which model produced each output.
    3. Each sample is scored independently by at least two reviewers, and inter-rater agreement is computed. Samples with large disagreements go to an arbitration panel.
    4. The review panel should include both internal business experts and external domain experts to reduce single-team bias.

    Blind review reduces brand bias, but the design of scoring criteria determines the ceiling of your conclusions. With vague criteria, even rigorous blind testing yields unstable results.

    4. Answer Reliability: Refusal Calibration Matters More Than Overall Accuracy

    When a model doesn’t know the answer, the ideal behavior is to express uncertainty or ask for additional material. If a model tends to fabricate confident answers, it can cause real damage in risk-sensitive scenarios even with high overall accuracy.

    Track these three metrics together:

    • Answerable accuracy: The proportion of correct answers when the material is sufficient.
    • Refusal rate: The proportion of cases where the model correctly declines to confirm when the material is insufficient.
    • Hallucination rate: The proportion of cases where the model gives a confident answer despite insufficient material.

    When designing the evaluation set, deliberately include a portion of questions whose answers are not in the material—only these expose a model’s calibration. Refusal rate and hallucination rate must be read together: optimizing refusal rate alone makes the model overly conservative and reduces effective answers to answerable questions.

    5. Notes on Evaluating Coding Ability

    Coding tasks should be judged by unit tests rather than manual inspection. Keep the following in mind:

    • Use a private question bank or recently released problems to reduce the impact of training-data contamination.
    • Record the runtime environment, timeout limits, and retry counts so results are reproducible.
    • Passing tests doesn’t mean the code is maintainable. If engineering quality is part of your evaluation goals, add dimensions such as code style, complexity, and security checks.

    6. Cost Accounting: From Per-Call Price to Per-Task Cost

    Comparing per-call prices alone leads to misleading conclusions. A more meaningful measure is cost per effective task:

    Cost per task = (call cost + human review cost) / number of effectively completed tasks

    Here, call cost must include tokens from failed calls and retries, since those expenses are just as real. Call cost is computed as:

    Call cost = Σ(input tokens × input price + output tokens × output price)

    A few caveats:

    • Pricing units, cache billing rules, and batch discounts differ across providers—normalize everything to the same task scope before comparing.
    • Reasoning models typically produce more output tokens, so measure on the same task set rather than relying on rough estimates.
    • Models with similar quality scores can differ severalfold in per-task cost. When selecting a model, put quality scores and costs in the same table.

    7. A Code Skeleton for the Evaluation Workflow

    The following example shows how to record results with a unified data structure and compute refusal metrics and cost per completed task. It is for illustration only—in production you would plug in your own invocation and scoring logic.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class EvalTask:
    4. task_id: str
    5. scenario: str # e.g. "office" or "finance"
    6. prompt: str
    7. expect_refusal: bool # True when the model should refuse due to insufficient material
    8. @dataclass
    9. class EvalResult:
    10. task_id: str
    11. score: float # human or automated score, range 0 to 1
    12. refused: bool # whether the model declined to confirm
    13. input_tokens: int # all input tokens, including failed and retried calls
    14. output_tokens: int # all output tokens, including failed and retried calls
    15. PASS_THRESHOLD = 0.6
    16. def refusal_metrics(tasks: list[EvalTask],
    17. results: list[EvalResult]) -> dict[str, float]:
    18. """Compute refusal and hallucination rates on unanswerable questions."""
    19. by_id = {r.task_id: r for r in results}
    20. unanswerable = [t for t in tasks if t.expect_refusal]
    21. if not unanswerable:
    22. return {"refusal_rate": 0.0, "hallucination_rate": 0.0}
    23. refused = sum(1 for t in unanswerable if by_id[t.task_id].refused)
    24. refusal_rate = refused / len(unanswerable)
    25. # Any non-refusal is counted as hallucination; this is a simplified definition
    26. return {
    27. "refusal_rate": refusal_rate,
    28. "hallucination_rate": 1 - refusal_rate,
    29. }
    30. def cost_per_completed_task(results: list[EvalResult],
    31. price_in: float,
    32. price_out: float,
    33. review_cost_per_task: float) -> float:
    34. """Compute cost per effectively completed task. Call costs from failed tasks still count toward the total."""
    35. call_cost = sum(
    36. r.input_tokens * price_in + r.output_tokens * price_out
    37. for r in results
    38. )
    39. review_cost = review_cost_per_task * len(results)
    40. completed = sum(1 for r in results if r.score >= PASS_THRESHOLD)
    41. if completed == 0:
    42. raise ValueError("No tasks completed effectively; cannot compute per-task cost")
    43. return (call_cost + review_cost) / completed

    8. Implementation Recommendations

    1. Define business goals before choosing metrics. Decide which tasks must be done well first, then choose which scores to track.
    2. Refresh the evaluation set regularly. Static question sets invite targeted optimization, and results will drift out of date.
    3. Report results with confidence intervals. With small sample sizes, small score gaps between models carry no statistical significance and should not drive decisions.
    4. Keep complete evaluation logs. Record data versions, prompt templates, scoring rules, and invocation parameters to make the next round reproducible and comparable.