Evaluating Multimodal Code Generation Models: Challenges and Practices

    Multimodal code generation models must interpret natural language requirements, reference images, and UI constraints to produce runnable frontend or mini-game code. This article explains why a solution that "looks like it runs" is not necessarily usable, and breaks evaluation into six orthogonal dimensions: requirement coverage, visual fidelity, interaction completeness, runtime stability, multi-turn fix convergence, and observability. It outlines a reproducible evaluation workflow with fixed inputs, fixed criteria, and a fixed round budget, including sample code for verifying that controls are actually wired to behavior and for centralizing tunable parameters. It also classifies common defects, proposes targeted repair strategies, and offers engineering recommendations for moving from demo to delivery.

    1. Background: Why “It Looks Like It Runs” Does Not Mean “It Is Usable”

    In multimodal code generation, a model must simultaneously understand natural language requirements, reference images, and interface constraints, then output runnable frontend or mini-game code. The original test records show a typical contradiction: one solution was more complete in visual detail (for example, it added a net to the basketball hoop) but failed across the entire interaction flow; another had largely working interactions and commentary, and even provided an auto-demo mode, but key geometric elements and line positions were off, and the motion pacing was too fast.

    This shows that a single-dimension subjective impression cannot represent delivery quality. Evaluation must be split into several orthogonal dimensions, each with observable pass/fail conditions; otherwise, conclusions drift with whatever the tester happens to focus on.

    2. Breaking Down Evaluation Dimensions: Turning “Feel” into Metrics

    At minimum, cover the following six dimensions:

    1. Requirement coverage: whether each requirement item is implemented, measured by the checklist completion rate.
    2. Visual fidelity: whether key elements are present, whether positions and proportions are correct, and whether lines are aligned.
    3. Interaction completeness: whether controls such as start, shoot, pass, and steal are clickable and trigger the corresponding logic.
    4. Runtime stability: whether continuous running crashes, or whether empty scenes or disappearing elements occur.
    5. Multi-turn fix convergence: whether defects decrease after each round of feedback rather than new defects being introduced.
    6. Observability: whether capabilities such as auto-demo, status announcements, and log output are available to make verification easier.

    Item 5 is the most easily overlooked, yet it best distinguishes model capability. Poor convergence typically looks like this: fixing one defect while breaking existing functionality, eventually “fixing away” objects in the scene, or remaining stuck in a default failure state after multiple rounds.

    3. Designing a Reproducible Evaluation Workflow

    To keep conclusions stable, evaluation should fix the inputs, fix the criteria, and fix the round budget.

    1. Inputs: requirement text + reference image + runtime environment notes
    2. Round budget: N rounds (N=3 recommended, including the first generation)
    3. Record per round:
    4. - Requirement checklist completion rate
    5. - Presence of key elements (yes/no)
    6. - Clickable controls / expected controls
    7. - Number of crashes or empty scenes
    8. - Number of newly introduced defects
    9. Output: dimension radar chart + convergence curve

    Judging whether something is “clickable” cannot rely only on whether a button is drawn in the UI. Use automation to enumerate interactive nodes and trigger events, then confirm that the state actually changes. Sample validation logic:

    1. // Pseudocode: verify that controls are actually bound to behavior
    2. const controls = queryAll('[data-action]');
    3. const report = controls.map(el => {
    4. const before = readState(el.dataset.action);
    5. el.dispatchEvent(clickEvent());
    6. const after = readState(el.dataset.action);
    7. return { action: el.dataset.action, changed: before !== after };
    8. });
    9. console.table(report);

    If changed is false for all entries, the interaction flow is not wired up, and the solution cannot pass even if all UI elements are present.

    4. Common Defect Categories and Repair Strategies

    • Missing elements: key geometric objects are not generated, or proportions are unbalanced. When fixing, explicitly write the element list into the requirement constraints, and require the model to output a structural skeleton first, then fill in details.
    • Broken interactions: controls are drawn but events are not bound, or events are bound at the wrong level. When fixing, require the model to output an event-binding table so each item can be checked one by one.
    • Regression breakage: multi-turn edits introduce new problems. When fixing, introduce a regression test set, run it automatically at the end of each round, and forbid “change without verify.”
    • Pacing and parameters: motion speed or collision detection deviates from expectations. When fixing, centralize tunable parameters to avoid scattering them through the logic where they are hard to locate.

    A common approach to centralized parameter management:

    1. const CONFIG = {
    2. moveSpeed: 3,
    3. gravity: 0.4,
    4. shotWindowMs: 800,
    5. autoDemo: true
    6. };

    5. From Demo to Delivery: Engineering Recommendations

    1. Templatize requirements: rewrite vague descriptions like “draw a court” into itemized checklists to reduce ambiguity.
    2. Dual-track verification: humans assess look and feel, automation assesses metrics; when the two conflict, trust the metrics and trace back to the requirements.
    3. Baseline regression: save the runnable version from the first round and compare every later round against it to prevent capability regression.
    4. Prioritize observability: prefer solutions with auto-demo and status announcement capabilities, since they lower verification cost.
    5. Standardize the environment: unify the runtime environment and dependency versions to avoid mistaking environment issues for model issues.
    6. Cloud collaboration: use container platforms to lock down the runtime environment, use logging services and monitoring alerts to capture crash and interaction-failure events, and use object storage to archive each round’s artifacts for review.

    6. Conclusion

    Visual completeness and interaction usability are two independent evaluation axes, and no single-point advantage is enough to support a conclusion that one solution is “stronger.” Reliable judgment comes from multi-dimensional scoring and convergence curves under fixed inputs: requirement coverage and interaction completeness set the lower bound, stability and convergence set the upper bound, and observability determines evaluation cost. Only by turning evaluation into a reproducible process can you reliably distinguish “can demo” from “can deliver” across multiple iterations.