Evaluating LLM Coding and Visual Generation Capabilities: Methods and Practices

    To effectively integrate Large Language Models (LLMs) into real-world research and development workflows, teams must look beyond public benchmark scores. This article outlines a systematic approach to evaluating LLM capabilities in coding, UI generation, and 3D content creation. We explore key evaluation dimensions, including functional correctness, engineering quality, visual and interaction quality, and cost-efficiency. Additionally, we provide practical guidelines for building reproducible evaluation sets, calculating the true cost per successful task, avoiding common interpretation pitfalls, and safely deploying LLMs into development pipelines.

    1. Why Systematic Evaluation of Model Capabilities is Necessary

    Large language models exhibit significant performance variations across different scenarios such as coding, UI generation, and 3D content creation. The same model might score highly on algorithmic problems but fail to generate complete frontend pages, resulting in style breakage or missing interactions. Therefore, relying solely on public leaderboard scores is insufficient to determine whether a model is ready for real-world R&D workflows.

    Teams often face three main challenges during model selection:

    • Mismatch between evaluation tasks and business scenarios: Benchmark questions tend to focus on algorithms, whereas business needs require component-based pages, API integration, and state management.
    • Data contamination: Evaluation prompts may have already appeared in the model’s training data, leading to artificially inflated scores.
    • Hidden costs: Focusing only on the price of a single API call ignores the hidden costs associated with failed retries and manual fixes.

    The goal of systematic evaluation is to break down the subjective concept of “usability” into measurable metrics, combined with human judgment to draw objective conclusions.

    2. Decomposing Evaluation Dimensions

    2.1 Functional Correctness

    The core question is whether the generated code can run and meet the requirements. This can be measured using two metrics: the runnable rate (whether the code starts without errors) and the test pass rate (the proportion of passed unit or end-to-end tests). For frontend tasks, you should also check the browser console for runtime errors.

    2.2 Engineering Quality

    Just because code runs does not mean it is maintainable. Evaluation should focus on the following:

    • Whether the directory structure and naming conventions align with project standards;
    • Whether unnecessary dependencies are introduced;
    • Whether there are hardcoded configurations, API keys, or magic numbers;
    • Whether critical logic includes necessary comments.

    Static analysis tools (such as linters and type checkers) can automatically count issues, reducing the workload of manual line-by-line review.

    2.3 Visual and Interaction Quality

    Visual tasks do not have a single correct answer and require a scoring rubric. It is recommended to score based on the following aspects:

    • Clarity of information hierarchy;
    • Consistency of spacing, alignment, and color schemes;
    • Proper layout across different screen widths (responsive design);
    • Clear state feedback for controls like buttons and forms;
    • Text and background contrast meeting basic readability standards.

    Screenshots can be automatically generated using a headless browser. Blind evaluations, where reviewers do not know the source model, can minimize the impact of subjective biases.

    2.4 3D and Graphics Tasks

    3D scene generation requires extra attention to whether rendering is normal, if resource loading fails, and if the frame rate is stable. You can record first-screen load time and average frame rate as objective metrics, while also checking whether model-generated parameters like camera position and lighting intensity fall within reasonable ranges.

    2.5 Instruction Following and Multi-turn Editing

    Real-world development is rarely completed in a single pass. Evaluations should design multi-turn tasks (Requirement -> Generate -> Modify Requirement -> Regenerate) to observe whether the model preserves already-correct parts and avoids mistakenly modifying unrelated code.

    2.6 Cost and Latency

    Cost includes both input and output token fees. Latency includes the time to first token (TTFT) and the full response time. Interactive scenarios are more sensitive to latency, while batch processing tasks are more concerned with throughput.

    3. Building a Reproducible Evaluation Set

    1. Task Source: Extract questions from real-world requirements and sanitize them while retaining the business structure.
    2. Difficulty Tiering: Design tasks at three levels—single-file, multi-file, and cross-module—to observe where capability boundaries break down.
    3. Unified Parameters: Fix the prompt template, sampling temperature, and maximum output length to prevent parameter variations from skewing conclusions.
    4. Multiple Sampling: Run the same task multiple times and report the mean and variance, rather than relying on a single result.
    5. Data Isolation: Evaluation prompts must not be included in fine-tuning data or prompt examples, and the question bank should be updated regularly.

    Below is a minimal evaluation record structure for tracking pass rates, latency, and output length:

    1. from dataclasses import dataclass
    2. from statistics import mean
    3. @dataclass
    4. class TaskResult:
    5. task_id: str
    6. passed_tests: int
    7. total_tests: int
    8. latency_s: float
    9. output_tokens: int
    10. def pass_rate(result: TaskResult) -> float:
    11. if result.total_tests == 0:
    12. return 0.0
    13. return result.passed_tests / result.total_tests
    14. def summarize(results: list[TaskResult]) -> dict:
    15. return {
    16. "avg_pass_rate": mean(pass_rate(r) for r in results),
    17. "avg_latency_s": mean(r.latency_s for r in results),
    18. "avg_output_tokens": mean(r.output_tokens for r in results),
    19. }

    Saving each run’s results as structured records ensures traceability when comparing different model versions later.

    4. Using Cost per Successful Task to Guide Selection

    A low price per API call does not equate to a low total cost. If a model’s pass rate is low, it will require multiple retries or manual fixes, driving up actual costs. Therefore, it is recommended to introduce the following metric:

    Cost per Successful Task = Average Cost per Task / Task Pass Rate

    Consider a hypothetical example: Model A has a lower cost per call but a pass rate of only 40%. Model B has a higher cost per call but achieves an 80% pass rate. Using the formula above, Model B’s cost per successful task might actually be lower. These numbers are solely for illustrating the calculation method; actual conclusions should be based on your own evaluation data.

    When calculating, you should also factor manual repair time into the cost, as an engineer’s time is often much more expensive than API call fees.

    5. Common Pitfalls in Interpreting Results

    • A good single demo does not guarantee stable outputs. Demo content is usually cherry-picked for optimal results.
    • A single metric can mask problems. For example, a high pass rate might hide chaotic code structures, leading to high future maintenance costs.
    • With small sample sizes, a difference of a few percentage points might just be random variance.
    • Prompts heavily influence results. When comparing different models, clarify whether a unified prompt was used or each model’s recommended prompt engineering was applied.

    6. Implementation Recommendations

    1. Canary Rollouts: Start with a small scope, such as using the model for unit test completion or minor style adjustments. Expand the scope gradually only after confirming effectiveness.
    2. Treat as Drafts: Treat model outputs as drafts that require review. Generated code must pass tests and code reviews before being merged.
    3. Regression Sets: Establish a regression test set and re-run it after every model version update to compare changes in key metrics.
    4. Security Checks: Perform security checks on generated code, focusing on issues like key leakage, untrusted dependency sources, and missing input validation.
    5. Audit Trails: Record the parameters, model versions, and dates for each evaluation to facilitate retrospective analysis.

    The value of evaluation lies in converting subjective impressions into reviewable data. Teams can use this data to determine which development stages a model is suited for, what verification measures are needed alongside it, and when it is time to re-evaluate.