A Practical Framework for Evaluating Large Language Models on Complex Tasks

    This article describes a method for testing how large language models perform on complex tasks with dense constraints. It explains why these tasks need separate evaluation, breaks evaluation into four dimensions with observable metrics, outlines sample task categories, and shows a simple record-keeping script. It also covers verification methods, reporting conventions, common pitfalls, and suggestions for adopting the framework within a team.

    1. Why Complex Tasks Need Separate Evaluation

    Large language models have become much closer in performance on basic question answering. What determines real-world results is how they handle complex tasks. Complex tasks usually combine three kinds of requirements: structural requirements (frameworks, formats, hierarchies), detail constraints (values, fields, naming, boundary conditions), and functional connections (data flow between steps).

    Three failure patterns appear often in practice. The first is a complete framework with missing detail constraints, such as inconsistent field names or incorrect unit conversions. The second is a step that looks correct on its own but breaks when steps are chained together, such as a frontend API call whose parameters do not match the backend definition. The third occurs during multi-round revisions. The model fixes a new problem but quietly drops a requirement that a previous round had already satisfied.

    The goal of evaluation, therefore, is to determine whether a model can deliver usable results under dense constraints.

    2. Breaking Down the Evaluation Dimensions

    We recommend splitting evaluation into four dimensions. Each dimension maps to a set of observable metrics.

    Dimension Core Question Observable Metric
    Task completion Are all requirements met? Requirement coverage rate
    Factual and computational reliability Are numbers, formulas, and references correct? Independent recalculation pass rate
    Multi-round stability Are the original requirements preserved after revisions? Regression failure count
    Efficiency and cost Are time and usage acceptable? End-to-end latency, token usage, estimated cost

    2.1 Task Completion

    Break the original requirements into atomic items that can be checked. Each item should describe one verifiable result, such as “button label is in Chinese,” “output contains three sections,” or “the first column of the table is a date.” Once requirements are atomic, verification becomes a matter of confirming each item instead of forming an overall impression.

    2.2 Factual and Computational Reliability

    For content involving numbers, recalculate the values independently instead of accepting the model’s conclusions. For data spread across multiple files, check that the same metric has the same value in every file. Content that relies on external facts should cite its sources, and information should be classified as either “known to the model” or “needs verification.”

    2.3 Multi-Round Stability

    Multi-round tests should fix a baseline set of requirements. After each revision, recheck every baseline item. Checking only the content added in the current round will miss regression problems.

    2.4 Efficiency and Cost

    Record generation time separately from checking time. Token usage should include the context that is resent across multiple calls, and cached tokens should be recorded separately. Estimate cost using published standard unit prices, and state which additional fees are excluded.

    3. Sample Task Design

    A representative task set usually covers the following four scenarios.

    1. Visual creation: Generate interface mockups or charts from written requirements, then check element placement, color scheme, and text.
    2. Interactive development: Generate a small frontend page or script, then check event handling, state transitions, and error handling.
    3. Image-based reasoning: Provide a technical drawing or screenshot, ask questions that require reading specific values or relationships, and check the answers against the original image.
    4. Office collaboration: Generate a spreadsheet or document containing formulas, and require numbers to stay consistent across multiple files.

    Each task should come with a clear acceptance checklist. The more specific the checklist, the easier it is to reproduce evaluation results.

    4. Evaluation Workflow and Execution Standards

    The workflow has five steps: prepare the baseline, run the task, record results in a structured format, verify independently, and aggregate the statistics.

    The following simplified script records the latency and check results for each run.

    1. import time
    2. from dataclasses import dataclass, field
    3. @dataclass
    4. class RunRecord:
    5. task_id: str
    6. round_index: int
    7. generation_seconds: float = 0.0
    8. total_tokens: int = 0
    9. checks: dict = field(default_factory=dict) # requirement item -> passed or not
    10. def run_task(task_id, round_index, prompt, call_model, checklist):
    11. start = time.monotonic()
    12. response = call_model(prompt) # call the model under test; returns text and usage
    13. generation_seconds = time.monotonic() - start
    14. record = RunRecord(task_id=task_id, round_index=round_index)
    15. record.generation_seconds = generation_seconds
    16. record.total_tokens = response["usage"]["total_tokens"]
    17. for item_id, check_fn in checklist.items():
    18. record.checks[item_id] = bool(check_fn(response["text"]))
    19. return record
    20. def pass_rate(record):
    21. if not record.checks:
    22. return 0.0
    23. return sum(record.checks.values()) / len(record.checks)

    A few points about this code. Latency only measures the model call, so verification time should be measured separately. Each check item is either an executable judgment function or a manual confirmation. Structured records make later aggregation and recalculation easier.

    5. Result Verification Methods

    Verification falls into three categories.

    Mechanical verification applies to items that a program can judge, such as whether a file parses correctly, whether formula results match, and whether field names are consistent. Automate this type of verification where possible to reduce subjective bias.

    Comparative verification applies to image-reading and office tasks. For image-reading tasks, compare each item against the original image rather than judging by impression. For office tasks, check the model’s numbers against independently calculated results.

    Manual verification applies to aspects such as aesthetics, semantic expression, and readability. At least two reviewers should score independently. If their scores differ significantly, discuss the disagreement together.

    6. Reporting Conventions

    The reporting conventions must be stated at the beginning of every report. Without them, the numbers cannot be compared across reports. Specify the following:

    • Whether latency includes checking time and any waiting time between rounds.
    • Whether token usage includes repeatedly sent context.
    • Whether cost is estimated from standard unit prices or calculated from actual billing.
    • Whether the scope includes subtasks or auxiliary calls.

    For multi-round tasks, latency should be the sum of execution time across all rounds. State whether manual waiting time was excluded.

    7. Common Pitfalls

    • Drawing conclusions from a single task. Single-task results are easily affected by chance. Cover multiple types of scenarios.
    • Treating a complete framework as proof of quality. A complete framework only shows that structural requirements are met. Detail constraints still need to be checked item by item.
    • Testing only the first round. Regression problems in multi-round revisions often appear in later rounds.
    • Ignoring cost and efficiency. When quality is similar, cost and latency per task are the key factors for model selection.

    8. Implementation Recommendations

    Teams can adopt this evaluation in the following order. First, build a task set that covers core business needs, and attach an acceptance checklist to each task. Next, fix the run parameters and reporting conventions so that comparisons between models are fair. Finally, add the evaluation script to the regular workflow, run it after each model version update, and keep historical records for trend comparison.

    Evaluation results should support specific decisions, such as whether a type of task is suitable for automation or which steps still need human review.