How to Evaluate LLMs: Reasoning, Coding, and Long-Context Performance

    A practical LLM evaluation should measure reliable task completion, not just model size or impressive demonstrations. This guide explains how to build reproducible tests for reasoning, agentic coding, and long-context evidence use, while assessing API compatibility, operational stability, latency, and cost per successful delivery. It also shows how to define deployment boundaries and maintain regression tests as models and applications change.

    1. Evaluate Task Value, Not Just Parameter Count

    Improvements in large language models often appear as stronger complex reasoning, more reliable tool use, more complete code delivery, and larger context windows. These capabilities do not automatically translate into business value.

    For developers, the practical questions are whether a model can complete tasks within existing engineering constraints, whether its outputs can be verified, whether it can recover from failures, and how much time and money a successful task requires.

    A rigorous evaluation should do more than showcase a few impressive responses. It should answer three questions:

    1. Which tasks is the model suited for? Examples include short-text classification, complex requirements analysis, cross-file code changes, and evidence retrieval across large document collections.
    2. Under what conditions does it fail? These may include ambiguous requirements, conflicting context, tool execution errors, or tasks that require strict permission boundaries.
    3. Are the improvements worth the additional investment? More extensive reasoning may improve success rates, but it can also increase waiting time, generation costs, and debugging effort.

    This article focuses on general capabilities and verification methods. Unreproduced marketing claims, internal impressions, and isolated demonstrations should not be treated as established findings.

    2. Understand Model Specifications: Total Parameters, Active Parameters, and Context

    Total parameters do not directly determine per-request compute

    Some models use a mixture-of-experts architecture. They contain multiple expert modules, but each input segment activates only a subset rather than using all parameters at once.

    It is therefore important to distinguish total parameters from active parameters. Total parameters describe the overall model size. Active parameters more closely reflect the parameters involved in a single forward pass, but neither figure alone determines response speed, deployment cost, or practical capability.

    Inference performance also depends on hardware, parallelization, batch size, numerical precision, context length, and service scheduling. Even a model with relatively few active parameters can incur substantial compute costs when processing long inputs.

    For local deployment, also examine weight storage, runtime memory, cache usage, and communication overhead. Activating only part of a model does not mean that only those parameters need to be loaded.

    A larger context window does not guarantee accurate understanding

    Context windows are usually measured in tokens, the basic units a model uses to process text. Tokens do not have a fixed one-to-one relationship with Chinese characters, English words, or bytes. A token count therefore cannot be directly converted into an equivalent character count.

    Advertised capacity and effective context use should be evaluated separately:

    • Capacity: Can the service accept the input?
    • Retrieval: Can the model locate relevant evidence?
    • Reasoning: Can it combine information distributed across the input?
    • Stability: Does the answer change when evidence moves or distracting material is added?

    As context windows grow, testing must go beyond whether information fits. It must establish whether the model can find that information and use it correctly.

    Reasoning and low-latency modes serve different tasks

    Some model services support different reasoning strategies. More extensive reasoning is generally suited to planning under multiple constraints, mathematical problem-solving, and complex debugging. Low-latency strategies are often better suited to format conversion, information extraction, and simple questions.

    Longer reasoning does not necessarily produce more accurate answers. A model may continue elaborating on a false assumption or overanalyze a straightforward task. Choose a strategy based on task complexity and the cost of failure rather than always selecting the most computationally expensive setting.

    3. Build a Reproducible Evaluation Process

    Draw tasks from real workloads, not just showcase prompts

    Build task sets in four categories:

    • Basic tasks: Summarization, classification, field extraction, and text rewriting.
    • Reasoning tasks: Decisions involving multiple conditions, quantitative relationships, and constraint checking.
    • Engineering tasks: Bug fixes, feature implementation, additional tests, and documentation updates.
    • Long-context tasks: Cross-document retrieval, version comparison, and identification of conflicting information.

    Each category should include normal, boundary, and exceptional inputs. For field extraction, for example, test not only complete records but also missing fields, contradictory descriptions, and similar entities that are easy to confuse.

    Include both common requests and high-risk requests. Testing only common cases can underestimate production failure costs. Testing only extreme challenges may obscure the benefits of everyday use.

    Fix experimental conditions to make comparisons meaningful

    When comparing models or invocation strategies, keep the following as consistent as possible:

    • Task instructions and reference materials.
    • Output length limits.
    • Tool permissions and execution environments.
    • Retry and timeout rules.
    • Concurrency levels.
    • Scoring criteria.

    Run each task multiple times and record variation. A single successful run shows that a model has completed a task once, not that it can do so reliably.

    If prompts are adjusted, document the changes. Avoid repeatedly optimizing prompts for one candidate while evaluating another with unoptimized inputs. Do not continually use the test set for tuning, either: doing so can inflate estimates of generalization.

    Measure task success instead of vague “answer quality”

    Success must be defined differently for each task.

    Field extraction can be evaluated through field accuracy and format validity. Mathematical tasks require verification of the final answer and key constraints. Coding tasks should pass build checks, automated tests, and any necessary human review. Document question answering requires checking that cited evidence exists and that conclusions stay within what the materials support.

    Use three levels of criteria:

    1. Mandatory requirements: Correct results, compliance with permissions, and parseable output.
    2. Important quality measures: Clear explanations, appropriately scoped changes, and sufficient evidence.
    3. User experience measures: Response speed, language fluency, and ease of interaction.

    Fluent writing must not conceal factual errors. Similarly, code that looks complete must not receive credit if it cannot run.

    4. Evaluate Agentic Coding Across the Full Delivery Workflow

    Agentic coding involves more than generating a code snippet. It requires a sequence of actions: understanding requirements, inspecting the project, planning changes, modifying files, running validation, and correcting problems.

    Include realistic engineering constraints

    A neutral test task might ask an agent to add input validation to an existing service while preserving current calling behavior and adding tests.

    Specify:

    • Which directories may be modified.
    • Which behaviors must remain backward compatible.
    • What requirements error messages must meet.
    • Whether new dependencies are allowed.
    • What constitutes completion.

    These constraints reveal whether the model breaks existing behavior to pass local tests or introduces unnecessary complexity to finish quickly.

    Tool results must guide subsequent decisions

    A reliable agent adjusts its approach based on actual execution feedback. It should not declare completion after tests fail.

    Check whether the agent:

    • Read the key files.
    • Interpreted tool output correctly.
    • Ran validation after making changes.
    • Distinguished environment failures from code defects.
    • Clearly identified anything it could not verify.

    More tool calls do not necessarily indicate stronger capability. Repeatedly reading the same files or trying commands without a clear purpose can increase costs without improving success.

    Set permissions, budgets, and stopping conditions

    Production models should not have unrestricted execution privileges. Use least-privilege access, isolated execution environments, and explicit operation budgets.

    Actions involving file deletion, permission changes, sensitive data access, or changes to live systems should require approval or be blocked. Once repeated failures meet a predefined threshold, stop automated attempts and hand the task to a human.

    An external system should verify completion rather than relying entirely on the model’s own report. “Done” must correspond to verifiable deliverables.

    5. Test Long-Context Evidence Use, Not Just Capacity

    Measure sensitivity to evidence position

    Place the same critical information at the beginning, middle, and end of the material while keeping the question and other content unchanged. Observe whether answer accuracy varies.

    Then gradually add irrelevant passages, similar names, and repeated descriptions to test resistance to distraction. Include outdated information as a further test, requiring the model to answer explicitly from the latest material.

    These experiments expose problems that a larger input capacity alone cannot solve. A model may accept all the text yet select the wrong evidence.

    Check whether the model combines distributed information correctly

    Enterprise tasks often require information from several sources. One document may define the default process, another may list exceptions, and a third may specify when those exceptions take effect.

    Retrieving only one passage is not enough to reach the correct conclusion. Require the model to identify the passages supporting its answer, then check for missing prerequisites, confused time ranges, or incorrectly combined rules.

    Combine long context and retrieval augmentation according to the task

    Directly supplying a long context may be convenient for a single document that requires holistic understanding. For a large, continuously updated knowledge base, retrieval augmentation is often better suited to controlling input size, updating knowledge, and tracing evidence.

    These approaches are not mutually exclusive. A common pattern is to narrow the candidate materials first, then have the model read the relevant content and synthesize an answer.

    Retrieval can also miss critical evidence, so measure retrieval quality and answer quality separately. When an answer is wrong, determine whether the system failed to find the material or found it but interpreted it incorrectly.

    6. Test API Migration and Operational Stability

    Similar request structures do not guarantee identical behavior. Models and services can differ in output formats, streaming responses, tool calls, error handling, and length limits.

    Before migration, establish contract tests covering normal requests, timeouts, rate limits, invalid input, output truncation, and tool execution failures. For structured outputs, validate field types, required fields, and permitted enumeration values.

    A successful request does not mean a migration is complete. Applications depend on stable behavior, including how failures are returned, whether retries are safe, and whether retries can cause duplicate execution.

    Assign a trace identifier to each request so that model calls, tool executions, validation results, and final status can be correlated. Logs should retain enough information for troubleshooting while redacting sensitive content and avoiding unnecessary copies of complete business data.

    7. Compare Total Cost per Successful Delivery

    The price of a single model call accounts for only part of the expense. A complete task may involve multiple reasoning rounds, tool executions, failed attempts, and human review.

    A useful conceptual metric is:

    Average cost per successful delivery = Total model-call, tool, and review costs across all tasks ÷ Number of successfully completed tasks

    This metric highlights two common outcomes: a low-priced option can become expensive through frequent retries, while a more compute-intensive option can reduce total cost by completing more tasks on the first attempt.

    Also record time to first output, end-to-end task duration, and latency distributions under high concurrency. Average response time alone does not adequately capture the impact of a small number of requests that wait much longer.

    In practice, route tasks by difficulty. Use a low-latency path for simple tasks, and more extensive reasoning and validation for complex or high-risk work. Escalate failed tasks when defined conditions are met rather than repeating calls unconditionally.

    8. Define Selection Boundaries Instead of Declaring an Overall Winner

    A useful evaluation report should document the task sets, experimental conditions, scoring rules, success rates, costs, latency, and representative failures.

    Frame the final recommendation around clear boundaries:

    • Which tasks can be automated.
    • Which tasks require human review.
    • Which input conditions are likely to cause errors.
    • Which operations must be restricted by the permission system.
    • When a different processing strategy is needed.

    Validation must continue after a model upgrade. Changes to business data, prompts, or service versions can alter previously observed performance. Maintain a fixed regression task set and recheck key metrics after each change.

    Ultimately, a capable LLM is not defined by parameter count, context length, or an impressive demonstration. It is defined by whether it can complete real tasks consistently, reliably, and economically within explicit constraints. Combining capability evaluation with engineering verification is what turns model improvements into sustainable production value.