Evaluating LLM Interactive Coding and Constraint Planning Capabilities: A Practical Guide

    This guide explains how to assess large language models through executable, interactive, and verifiable task environments, focusing on interactive coding, constraint-based planning, and 3D voxel sandbox construction. It covers evaluation principles, acceptance criteria, scoring systems, automated testing, and isolated execution, helping readers turn one-off demos into reproducible, comparable engineering conclusions.

    Evaluating a new version of a large language model by looking at a single piece of generated code that “looks complete” rarely reveals its true engineering capability. A more valuable evaluation approach is to place the model in an executable, interactive, and verifiable task environment and observe whether it can reliably meet requirements across multiple runs. Three task categories—interactive coding, constraint planning, and voxel sandbox building—form a framework that covers generation quality, logical rigor, playability, and repairability.

    1. Why Upgrade “Demo-Style Generation” to Reproducible Evaluation

    Traditional code evaluation typically relies on algorithm problems, single-function prompts, or fixed input/output pairs. These are easy to grade automatically, but they fail to cover the most common issues in real-world development: state management, input mapping, spatial coordinates, exception handling, interactive feedback, performance constraints, and multi-round correction.

    Interactive coding tasks expose exactly these weaknesses. For example, a fighting game that looks complete—complete with health bars, skill effects, and enemy units—may have inverted arrow-key mappings, broken collision detection, and a double jump that never triggers, making it entirely unplayable. In that case, “code generation capability” does not equal “delivery capability.”

    Therefore, evaluation should shift from a single demonstration to a reproducible experiment: fix the task specification, the number of samples, the execution environment, and the acceptance checklist; record successes, failures, repair rounds, and time consumed for each run. Only by breaking subjective experience down into objective checkpoints can you compare real differences across models, prompt strategies, and toolchains.

    2. Five Core Principles of Evaluation Design

    1. Decomposable tasks. Break complex requirements into observable sub-capabilities, such as “page loads,” “character moves,” “skills have cooldowns,” “river crossing steps are legal,” or “chunks load dynamically.” Each sub-capability should have an automated or semi-automated verification method.

    2. Reproducible runs. Record model version, prompts, temperature, random seed, context length, whether code execution is allowed, and the execution environment. For generative tasks, run the same prompt at least five times and report pass rate, variance, and worst-case results—do not showcase only one successful sample.

    3. Acceptance before scoring. First define “must-pass items” and “bonus items.” Must-pass items determine whether the task is qualified: the game must be controllable, crossing steps must satisfy constraints, the 3D scene must allow movement and block placement. Bonus items evaluate visual quality, content richness, and code maintainability.

    4. Separate “no tools” and “with tools” tracks. Tool-free evaluation probes internal reasoning and one-shot generation capability; tool-enabled evaluation probes whether the model can call an execution environment, read errors, and iterate on fixes. The two must not be mixed, or conclusions will be distorted. For constraint planning problems, tool-free runs verify constraint maintenance; when tools are allowed, observe whether the model uses an external validator to check each intermediate state.

    5. Combine manual experience with automated checks. Automated scripts can verify whether controls work, rules are followed, and pages are error-free, but “does it feel smooth,” “is the visual hierarchy clear,” and “are enemy behaviors interesting” still require human judgment. Use a structured scoring rubric to reduce subjective bias.

    3. Designing and Accepting Three Typical Task Types

    3.1 Single-File Interactive Fighting Game

    The task can require the model to generate a single-file web program with movement, jumping, double jump, dodge, block, basic attacks, elemental skills, cooldown and energy mechanics, enemy decision logic, collision detection, scene rendering, and win/lose conditions. The focus is not “how fancy the graphics are” but “whether the state machine is coherent.”

    Suggested acceptance checkpoints:

    • The page loads without script errors and without blocking exceptions in the console.
    • Arrow keys (or specified keys) map to character movement consistently; screen coordinates and input mappings are not inverted.
    • Jump, double jump, dodge, block, attack, and skills can all be triggered.
    • Each skill has a clear cooldown, cost, hit detection, and visual feedback.
    • Enemies can search for targets, approach, attack, take hits, and reset without getting permanently stuck.
    • Collision logic is consistent between the character, scene, enemies, and attacks.
    • Win/lose determination, restart, and boundary conditions work correctly.
    • The code structure separates, at minimum, input handling, state updating, rendering, and configuration data.

    Common failures are not always syntax errors but “locally correct, globally inconsistent”: an attack animation plays but no damage is applied; a cooldown bar updates but the skill can still be spammed; enemies track the player but cannot path around obstacles. Classify these as state-consistency defects rather than attributing them simply to “poor code quality.”

    3.2 Constrained River-Crossing Planning

    This task requires the model to output, without external tools, a sequence of steps satisfying constraints such as capacity, who can row, supervision relationships, and conflict conditions. It tests multi-step planning, constraint maintenance, and intermediate-state validation. A seemingly valid step sequence is a failure if any intermediate state contains a disallowed combination.

    Do not only check the final answer—simulate step by step:

    1. function validatePlan(plan, initial, goal) {
    2. let state = clone(initial);
    3. for (const move of plan) {
    4. assert(move.persons.length >= 1 && move.persons.length <= 2);
    5. assert(move.persons.some(p => canRow(p)));
    6. state = applyMove(state, move);
    7. assert(!violatesSupervision(state));
    8. }
    9. assert(equals(state, goal));
    10. }

    Additional metrics can include the rate of finding a first valid solution, minimum step count, success rate across repeated samples, and types of constraint violations. If tools are allowed, observe whether the model proactively builds state tables, performs step-by-step self-checks, or calls a general constraint solver. Tool-free results reflect internal planning ability; tool-enabled results reflect engineering problem-solving ability—report them separately.

    3.3 3D Voxel Sandbox Program

    This task can require generating a single-file 3D program with terrain, trees, block placement and destruction, character movement, jumping, flight, day/night cycle, weather, enemy units, infinite terrain, and basic performance optimization. It simultaneously tests graphics programming, coordinate transforms, input handling, collision detection, resource management, and performance awareness.

    Acceptance checkpoints include:

    • Camera and character coordinate conventions are clear; forward/back/left/right movement aligns with the view direction.
    • Jumping, gravity, landing, and collision responses are correct—no clipping through terrain or floating in mid-air.
    • Block picking, placing, destroying, and highlight selection work correctly.
    • Terrain generation is continuous; trees, resources, or enemies do not break basic rules when spawned.
    • Chunk loading and unloading cause no obvious stuttering or continuous memory growth.
    • Day/night, weather, and lighting effects change over time or with configuration.
    • Rendering frame rate, longest frame time, and memory usage stay within acceptable ranges.
    • The console shows no high-frequency errors, and long-running sessions do not crash.

    In this type of task, models often prioritize “visual richness” while neglecting input and physics correctness. Inverted axes, broken jumping, cameras passing through terrain, and offset block coordinates are typical spatial-consistency problems. During multi-round optimization, newly added weather, lighting, and infinite terrain can mask pre-existing defects—so regression tests are essential: after each round of changes, re-run the core checks instead of relying on screenshots.

    4. Building a Quantitative Scoring System

    Use a “must-pass items are veto votes, composite score provides layered comparison” approach. Core items determine qualification; scoring items rank quality.

    Dimension Suggested weight What to observe
    Functional correctness 30% All core interactions, rules, and constraints satisfied
    Stability 20% Pass rate, exception rate, and variance across multiple runs
    Repairability 15% Quality of fixes within one or two feedback rounds
    Interaction & playability 15% Control consistency, feedback clarity, goals and difficulty
    Performance & resources 10% Load time, frame time, memory, long-running behavior
    Code quality & security 10% Module separation, readability, error handling, sandbox safety

    Key metrics can be defined as follows:

    • Task pass rate = number of runs satisfying all core acceptance items / total runs.
    • Average repair rounds = number of feedback rounds needed to reach a passing standard.
    • Regression failure rate = proportion of existing core items that fail after new features are added.

    For planning problems, also track the legal-solution ratio, minimum-step hit rate, and constraint-violation density. For interactive programs, track input response latency, average frame time, and error log counts.

    5. Automated Testing and Isolated Execution

    Interactive tasks should be driven automatically: open the page, simulate key presses, read character coordinates, check health and cooldown status, verify block-count changes, and capture console errors. The approach can be abstracted into pseudocode:

    1. const cases = [
    2. { name: 'No blocking errors on load', run: env => env.errors.length === 0 },
    3. { name: 'Forward movement direction is correct', run: env => {
    4. const p0 = env.playerPosition();
    5. env.press('ArrowUp', 300);
    6. const p1 = env.playerPosition();
    7. return env.distanceForward(p0, p1) > 0;
    8. } },
    9. { name: 'Double jump can be triggered', run: env => {
    10. env.press('Space');
    11. env.wait(100);
    12. env.press('Space');
    13. return env.playerVelocityY() > 0;
    14. } }
    15. ];

    When automatically running untrusted code, isolate it: limit CPU, memory, execution duration, and network access; use a dedicated working directory per task; collect stdout, error logs, screenshots, and performance metrics; destroy the environment when the task ends. For batch evaluation, tasks can be submitted to a general-purpose container platform such as the one offered by Baidu AI Cloud for isolated execution, with artifacts written to object storage and logs/metrics managed through a unified logging and monitoring service. The key priorities are traceability, recoverability, and observability—not dependence on any specific interface.

    6. Interpreting “Strong Generation but Insufficient Attention”

    In interactive tasks, a common pattern is that models quickly generate large amounts of structurally complete, visually rich code but make errors in long-context references, state synchronization, coordinate mapping, and boundary conditions. Engineering-wise, this “attention deficit” can be decomposed into five testable problem types: instruction-following drift, cross-reference errors, state machine inconsistency, spatial coordinate mapping errors, and regressions introduced by iterative modification. Suggested mitigations:

    1. Put the acceptance checklist at the top of the prompt before asking for implementation, so the model does not latch onto superficial goals like “impressive” or “rich.”
    2. Require the model to output the architecture, coordinate conventions, state machine, and key invariants before generating code.
    3. Deliver complex tasks in phases: core playable loop first, then visuals, then performance optimization.
    4. Run regression tests after every modification and require the model to fix failed items one by one.
    5. For planning problems, require a per-step state table and legality checks to reduce “only looking at the endpoint” errors.
    6. For 3D programs, explicitly specify coordinate systems, camera orientation, input mappings, and collision-response rules to reduce spatial ambiguity.

    7. Conclusion

    Evaluating large language models cannot rely on whether a single demonstration looks impressive; it must examine whether the model can stably satisfy clearly defined acceptance criteria across multiple runs. Interactive fighting games test state machines and input mapping, constrained planning problems test multi-step reasoning and rule maintenance, and 3D voxel sandboxes test spatial consistency, performance awareness, and iterative repair ability. By combining must-pass items, stability, repairability, playability, performance, and security into a unified scoring system—and supporting it with automated testing, isolated execution, and regression checks—you can turn the vague impression of “great capability but unstable delivery” into reproducible, comparable evaluation conclusions that can guide engineering decisions.