Code Agent Evaluation for Mid-Size Dense Models: Capabilities, Costs, and Controls

    This article provides a practical framework for evaluating code agents built on mid-size dense models. It distinguishes code generation from end-to-end engineering task completion, explains the full agent execution loop, examines the value and limits of dense architectures, outlines deployment resource estimation, covers multimodal inputs for software engineering, and proposes an evaluation and security model for real projects. The goal is to help teams judge whether a model can deliver verifiable engineering work under practical compute and permission constraints.

    1. Evaluation Focus: Closed-Loop Task Completion, Not Model Size

    When evaluating a language model for programming, the first distinction to make is between “generating code” and “completing an engineering task.” The former usually asks the model to output a function from a description, explain an algorithm, or complete a snippet. The latter requires understanding an existing project, locating the problem, modifying multiple files, running tests, and continuing to correct the work based on feedback.

    These two capabilities are related, but they cannot replace each other. A model that is good at answering programming knowledge questions may not reliably handle a software repository with complex dependencies and many constraints. A model that performs well on engineering tasks does not necessarily mean it is stronger across all general knowledge domains.

    Therefore, when discussing the technical value of mid-size models, the core question should be reframed: under limited compute and clear permission constraints, can the model complete verifiable software engineering tasks more reliably?

    “Verifiable” is especially important here. Code that looks reasonable is not necessarily functionally correct; passing tests does not necessarily mean there are no security issues. A genuinely useful code agent needs to satisfy task goals, engineering standards, and delivery constraints at the same time.

    2. Code Agent Capabilities Come from a Complete Execution Chain

    A code agent is not a model alone. It is a system composed of the model, tool-calling mechanisms, runtime environment, and feedback process. Its typical workflow can be summarized as:

    Requirement understanding → project retrieval → issue localization → modification plan → file editing → execution validation → feedback correction → result delivery.

    2.1 Requirement Understanding Determines Task Direction

    Real requirements are often incomplete. For example, “fix the export failure” may involve input format, permission checks, character encoding, resource limits, or concurrency issues. The model needs to first identify known facts, missing information, and acceptance conditions, rather than immediately modifying code.

    For uncertain requirements, a reliable system should allow the model to ask clarifying questions or explicitly state its current assumptions. This reduces the case where “a reasonable feature was implemented, but it is not the feature the user needed.”

    2.2 Project Retrieval Determines Context Quality

    Large projects usually cannot fit entirely into the model context at once. The agent needs to find relevant files, call chains, tests, and configuration while excluding irrelevant content.

    The goal of retrieval is not to “read more,” but to “read enough of the right content.” If the system provides only local code, the model may overlook dependencies in other modules. If it provides too much irrelevant text, it may dilute key constraints and increase reasoning cost.

    In practice, you can first narrow the scope based on error messages, file paths, and symbol references, then add relevant tests, interface definitions, and project conventions.

    2.3 Editing and Validation Must Form a Closed Loop

    The model’s first generated patch should not be trusted by default. Compile errors, missing edge cases, and behavioral regressions all need to be exposed through tool feedback.

    A reasonable validation order is usually: first check whether the changes can be parsed and built, then run relevant tests, and then perform broader regression validation. For changes involving permissions, data processing, and external input, security checks should also be added.

    At the same time, ineffective retries must be limited. A model repeatedly performing the same failing action does not mean it is effectively advancing the task. The system should set a maximum number of attempts, an execution time budget, and conditions for escalation to human handling.

    3. The Value and Boundaries of Mid-Size Dense Models

    Mid-size models attract attention mainly because they offer an explorable balance between resource requirements and task capability. However, parameter scale alone cannot directly determine task performance.

    3.1 Dense Architectures Are More Straightforward, but Deployment Is Not Necessarily Simple

    A dense model typically uses all major parameters in a single forward pass. Compared with architectures that activate only part of their modules, its resource usage and execution path are generally easier to understand, and deployment usually does not require handling expert routing and load balancing.

    However, dense models still face issues such as memory capacity, inter-device communication, operator support, and concurrent scheduling. When multiple GPUs are used, interconnect performance can directly affect response speed. Therefore, “relatively straightforward structure” and “necessarily simple deployment” are not equivalent.

    3.2 Total Parameter Count and Actual Cost Are Not Directly Interchangeable

    For conditionally activated architectures, it is necessary to distinguish total parameter count from the number of parameters activated per computation. Total parameter count affects weight storage requirements, while activated parameter count relates to compute overhead, but neither alone is enough to determine end-to-end cost.

    Actual cost is also affected by input length, output length, cache occupancy, batching method, and the number of task retries. A model that is cheaper per inference may cost more to complete a task if it fails frequently and requires repeated revisions.

    Therefore, a more meaningful metric is “cost per successfully delivered task,” not just “cost per request.”

    3.3 Targeted Capability Improvements Are Not a Full Upgrade

    Model training can focus on optimizing tool use, code editing, error recovery, and long-horizon execution. Such optimization may significantly improve engineering task performance, but it may not simultaneously improve general Q&A, mathematical reasoning, or knowledge coverage.

    Evaluation should separate capability dimensions and avoid using a single score to represent all performance. For development teams, whether a model can reduce manual rework in their own codebase is usually more important than its scores in unrelated domains.

    4. How to Estimate Deployment Resources

    Before deciding whether a model can run, you should first estimate resources and then validate them through actual load. Do not look only at weight file size, and do not judge solely by the number of GPUs.

    4.1 Weight Memory Is Only a Lower Bound

    Weight occupancy can be roughly estimated as follows:

    Weight storage ≈ number of parameters × average number of storage bytes per parameter.

    Using a model with approximately 27 billion parameters as a pure capacity estimation example, at 2 bytes of storage per parameter, the weights alone are about 54 billion bytes, or roughly 54 GB. This uses decimal units and excludes additional memory during inference.

    With an ideal 4-bit representation, the raw weight data is about 13.5 GB. However, actual quantization usually also includes scaling factors, group metadata, unquantized modules, and memory alignment overhead, so this number cannot be treated as the runtime memory requirement.

    This example only illustrates the relationship between parameter scale and storage precision. It is not a commitment about the deployment conditions for any specific model.

    4.2 Context Cache Continuously Consumes Resources

    During inference, the key-value cache used by the attention mechanism must be stored. Its capacity depends on the number of network layers, attention structure, cache precision, context length, and number of concurrent requests.

    Code tasks often include long files, multi-turn tool outputs, and long conversation history, so cache occupancy can become a key factor limiting concurrency. The fact that a model can run with short input does not mean it can reliably handle long-context, multi-user concurrent access scenarios.

    4.3 Quantization Requires Revalidating Task Performance

    Quantization can reduce weight storage and may improve efficiency in some deployment scenarios, but the actual benefit depends on hardware and inference implementation. Some low-precision formats may not deliver the expected speedup if they lack effective compute support.

    In addition, quantization may affect complex reasoning, precise formatted output, and tool-call stability. Acceptance testing should focus on cross-file edits, strict structured output, long-task execution, and failure recovery, rather than only observing whether the model can answer simple questions fluently.

    5. How Multimodal Inputs Serve Software Engineering

    The engineering significance of multimodal capability is not simply that the model “can see images.” It is about incorporating visual evidence into requirement understanding and issue localization.

    Common scenarios include judging layout issues from UI screenshots, understanding business constraints with flowcharts, reading information from error screenshots, or analyzing the trigger order of interaction anomalies through screen recordings.

    However, visual understanding must be validated against other evidence. Screenshots may lack environment information, screen recordings may omit preceding operations, and small text in images may be misread. A reliable process should combine visual input with source code, runtime logs, configuration, and reproduction steps.

    It is also necessary to distinguish visual content generation from visual content understanding. These correspond to different tasks. The ability to generate images does not imply reliable code engineering analysis capability.

    For video, it should be clear whether continuous temporal understanding is supported or only extracted image frames are processed. For issues sensitive to operation order, analyzing only a few static frames may not be enough to reconstruct the cause.

    6. Building an Evaluation System for Real Projects

    Public benchmarks can serve as initial screening material, but they should not directly replace internal acceptance testing. Model scores are affected by task version, tool permissions, context settings, number of attempts, and run budget. If these conditions differ, scores may not be directly comparable.

    6.1 Task Sets Should Cover Common Work

    It is recommended to build at least four types of tasks:

    • Defect repair: determine whether the model can find the root cause, not just eliminate the surface error.
    • Small feature development: check whether the implementation complies with interfaces, style, and business constraints.
    • Refactoring and maintenance: confirm that behavior remains unchanged and compatibility is not broken.
    • Test supplementation: evaluate whether tests cover valid boundaries and can detect actual defects.

    Each task should fix the initial code, dependency environment, requirement description, and acceptance criteria, and set up a validation mechanism independent of the agent’s modification scope.

    6.2 Beyond Success Rate, Measure Delivery Quality

    The following metrics can be recorded:

    • Independent acceptance pass rate;
    • First-submission pass rate;
    • Average completion time;
    • Number of tool calls and retries;
    • Time required for manual revision;
    • Ratio of unrelated file changes;
    • Unauthorized operations and sensitive information exposure.

    Among these, independent acceptance pass rate is more credible than the model’s self-reported “completed” status. Manual revision time reveals the hidden cost behind apparent success.

    6.3 Prevent Test Modifications from Masking Issues

    When an agent has edit permissions, it may modify tests, weaken assertions, or bypass validation. Even if this is not malicious behavior, it can distort results.

    Therefore, you should keep acceptance tests that the agent cannot rewrite, review test file changes, and check for hardcoding, skipped validation, or suppressed errors. For critical tasks, human code review should also be used.

    7. Security Controls from Trial to Production

    Code agents need to execute programs, access files, and read logs, so their risks are not limited to incorrect answers. They also include unauthorized access, environment damage, and sensitive information exposure.

    First, apply the principle of least privilege. Routine repair tasks usually do not need production credentials, database write permissions, or unrestricted network access.

    Second, execute tasks in an isolated environment. Limit accessible directories, network scope, runtime, and resource consumption, and retain records of tool calls and file changes.

    Third, guard against instruction interference in untrusted content. Project comments, documentation, logs, and external text may contain content that attempts to induce the agent to perform additional operations. Such material should be treated as data to be analyzed, not as new system authorization.

    Finally, establish a tiered approval mechanism. Low-risk changes can automatically generate patches and be validated. Changes involving permissions, payments, data migration, or core business logic should require human confirmation before proceeding to subsequent steps.

    8. Decide by “Task Value,” Not “Model Labels”

    When choosing a model, teams can proceed in three stages.

    The first stage is small-scale validation: select representative internal tasks and confirm that the environment can run, tool calls are stable, and results can be independently accepted.

    The second stage is same-condition comparison: fix the task set, permissions, time budget, and runtime environment, and compare success rates, latency, and manual rework across different deployment configurations.

    The third stage is controlled rollout: first take on test supplementation, documentation updates, and localized defect fixes, then gradually expand the task scope based on continuous observation.

    Overall, the value of mid-size dense models is not in proving that a particular parameter number can replace all larger models. It is in exploring a more controllable way to deliver engineering work. Only by combining model capability, toolchain, resource budget, independent validation, and security boundaries can you judge whether it truly fits a team’s actual work.