LLM Arena: Evaluation Methods for Coding and Agent Capabilities

    This article describes a structured way to evaluate large language models. It covers the main capability dimensions, how to build a test set, scoring methods for frontend generation, backend engineering, and agent tasks, cost and latency accounting, and common evaluation mistakes.

    1. Why Systematic LLM Evaluation Matters

    LLM capabilities change quickly, and new leaderboards and demo videos appear constantly. A single demo usually shows only successful cases, which does not reveal how stable a model is in real projects. Teams that rely only on personal experience tend to make three kinds of mistakes. First, they treat a lucky good result as general capability. Second, they ignore cost and latency and look only at output quality. Third, they equate parameter count or open weights with practical usefulness.

    A systematic evaluation should answer three questions: Can the model complete our real tasks? How stable are the results? Is the cost per task acceptable? The sections below cover each evaluation dimension.

    2. Breaking Down Evaluation Dimensions

    LLM capabilities can usually be split into the following categories:

    1. One-shot frontend generation: Generate runnable page code directly from a requirement description. Check interface fidelity, interaction logic, and style correctness.
    2. Backend engineering tasks: Complete a requirement in an existing codebase. This involves reading context, modifying multiple files, and keeping existing tests passing.
    3. Agent capabilities: The model plans steps, calls tools, reads the returned results, and adjusts its strategy until the task is done.
    4. Perception and spatial understanding: Judge geometric relationships, boundaries, and object positions in images. This is common in multimodal tasks.
    5. Cost and latency: Include the billing model for input and output, cache hit rates, time to first token, and total runtime.
    6. Long-horizon tasks: Tasks with many steps that run for a long time. These test context management, state persistence, and error recovery.

    Splitting the dimensions gives each one its own metrics. If all abilities are merged into one overall score, you cannot tell which part of the model is weak.

    3. Principles for Building an Evaluation Set

    The quality of the test set determines how much the conclusions can be trusted. Follow these principles.

    Task representativeness. Tasks should come from the team’s real work, such as form pages in an internal admin console, completing endpoints in an order system, or writing log analysis scripts. Toy problems far from the business only reflect general ability and cannot guide model selection.

    Reproducibility. The same task with the same input should produce consistent results across repeated runs. For stochastic generation, fix the sampling parameters and run multiple times to get statistics instead of relying on a single result.

    Preventing data contamination. If evaluation questions are already public in training data, a model may have memorized the answers. Teams should keep a portion of hidden questions that are not published and update them regularly.

    Automated scoring. Manual scoring of each item is costly and subjective. Automate whatever can be verified automatically, such as whether a page renders, whether an API response matches the agreed format, and the pass rate of test cases. For parts that cannot be automated, such as code readability, define clear scoring guidelines, have two reviewers score independently, and average the results.

    4. Evaluating One-Shot Frontend Generation

    Frontend evaluation focuses on whether the output “runs, looks reasonable, and works interactively.” A workable process looks like this:

    1. Provide a unified requirement description that specifies the page structure, fields, interaction behavior, and visual constraints.
    2. Ask the model to output complete single-file page code in one pass, with no multi-round revisions.
    3. Load the page in a headless browser and check the console for errors.
    4. Run a scripted sequence of clicks, inputs, and submissions, and record whether the page state changes match expectations.
    5. Compare layout screenshots and check that the positions and sizes of key elements fall within a tolerance range.

    An illustrative scoring structure is shown below:

    1. def score_frontend(result):
    2. score = 0
    3. if result.renders_without_error:
    4. score += 20
    5. score += 20 * result.interaction_pass_rate
    6. score += 20 * result.layout_match_rate
    7. if result.no_external_dependency_missing:
    8. score += 10
    9. score += 30 * result.requirement_coverage
    10. return score

    The weights here are only examples. Teams should adjust them to match their business priorities. The quality of one-shot output depends heavily on prompt wording, so keep the prompt template fixed during evaluation. This prevents differences in prompt engineering from being mistaken for differences in model capability.

    5. Evaluating Backend Engineering Tasks

    Backend tasks are closer to real work. The model must read existing code, understand call relationships, and then make changes. Evaluation should track these metrics:

    • Task completion rate: After the change, whether the test cases for the requirement pass.
    • Regression rate: Whether the original tests still pass. Many models complete new features while quietly breaking other modules, so this metric often reveals more than the completion rate.
    • Change scope: The number of files and lines modified. Smaller, more focused changes usually indicate a more accurate understanding of the code structure.
    • Style consistency: Whether new code follows the project’s existing naming, layering, and error-handling conventions.

    The evaluation environment should match production as closely as possible, including dependency versions and configuration files. Otherwise, code that passes locally may fail in real deployment, and the test results lose their value as a reference.

    6. Evaluating Agent Capabilities

    The core of an agent task is planning, execution, and error correction. A typical agent loop includes understanding the goal, selecting a tool, calling the tool, parsing the result, and deciding whether the task is complete. During evaluation, record each part of this loop separately.

    1. def run_agent_episode(model, task, tools, max_steps=30):
    2. history = [task.instruction]
    3. for step in range(max_steps):
    4. action = model.next_action(history)
    5. if action.type == "finish":
    6. return check_result(task, action.payload)
    7. observation = tools.execute(action.name, action.arguments)
    8. history.append((action, observation))
    9. return task_failed("step limit reached")

    This code shows the basic structure of an evaluation framework. A maximum step count prevents infinite loops, and each action and observation is saved so failures can be analyzed afterward. Common failure types include incorrect tool arguments, misreading returned results, repeating the same action, and declaring completion too early. After classifying failures, the team can tell whether the problem lies in model capability, tool design, or the task description.

    Tools also need careful design. Their input and output formats should be clear, and their error messages should be specific. Vague tool definitions amplify model mistakes, so the evaluation results no longer reflect the model’s true capability.

    7. Cost and Efficiency Accounting

    Beyond performance, cost determines whether a solution can scale. The cost per task can be estimated with the following formula:

    Cost per task = input volume × input unit price × cache miss ratio + cache-hit input volume × cache unit price + output volume × output unit price

    In agent scenarios, each step repeats a long context, so input cost often accounts for a large share of the total. Improving the cache hit rate is an effective way to reduce cost. Common practices include:

    1. Place stable system instructions and tool definitions at the beginning of the request so the prefix stays consistent.
    2. Summarize and compress the conversation history to reduce repeated content.
    3. Use rules instead of model calls for steps that are deterministic.

    Record both time to first token and total latency. In interactive scenarios, latency directly affects user experience. In background batch processing, throughput and total cost matter more.

    8. Open Weights and Model Size

    Whether a model has open weights and how many parameters it has are only one input to model selection. They do not directly indicate capability or value. Smaller models may perform well on specific tasks and cost less to deploy. Open weights allow a team to deploy locally, which helps meet data privacy and compliance requirements. However, the team then takes on operations and security responsibility.

    A more reasonable approach is to decide based on your own constraints. Consider whether data is allowed to leave your country or region, what your latency budget is, whether custom fine-tuning is needed, and whether your team can deploy and maintain the model. Write these conditions as a checklist, then validate candidate models with the evaluation framework above. The resulting conclusions are usually more reliable than conclusions drawn from following trends.

    9. Long-Horizon Tasks: Challenges and Design

    Long-horizon tasks require dozens of steps or more to complete. Examples include a full workflow from requirements analysis to code delivery, or a data processing pipeline that runs across several days. There are three main challenges.

    Context growth. As steps accumulate, the history gets longer, and the model may overlook key constraints from earlier stages. A solution is to periodically compress progress into structured state, such as completed items, pending items, and known constraints.

    Error accumulation. A small error in one step affects all later steps. Adding checkpoints that run validation at key points keeps errors contained.

    State recovery. Long tasks may be interrupted by network or resource issues. Persist intermediate results so execution can resume from the latest checkpoint instead of starting over.

    When evaluating long-horizon tasks, record the step where each task fails and calculate success rates per step. If the success rate is high in the first half and drops noticeably in the second half, the problem most likely lies in context management.

    10. Common Misconceptions

    First, using a single case to represent overall performance. Use statistics from multiple tasks and multiple runs instead.

    Second, comparing only performance and ignoring cost. If a model improves by one percentage point but doubles the cost, the trade-off may not be worth it.

    Third, using evaluation tasks that are disconnected from the business. A high score on unrelated tasks does not show that a model fits the team’s work.

    Fourth, ignoring failure samples. Failure causes often guide improvements better than success cases, so they should be collected and archived systematically.

    11. Summary

    LLM evaluation requires breaking capability into measurable dimensions. It also requires supporting conclusions with representative tasks, reproducible procedures, and automated scoring, while taking cost and latency into account. Frontend generation, backend engineering, agent execution, and long-horizon tasks each have different focuses and need separate metrics. Teams can start with a small set of real business tasks, establish a baseline, and then