Evaluating Interactive Coding Capabilities of Large Models: Task Design, Verification, and Regression Analysis
This article presents a task-based methodology for evaluating the interactive programming abilities of large language models. It breaks down the assessment into five core dimensions—functional correctness, visual fidelity, numerical and physical accuracy, algorithmic correctness, and instruction adherence—and walks through four representative task types, including visual effects, logic-constrained puzzles, 3D physics simulations, and reinforcement learning algorithms. The article also discusses how to verify model-generated explanations against actual code, and how to conduct regression analysis across multi-round repair attempts. The goal is to provide a repeatable, objective framework for assessing model performance in interactive coding scenarios.
Why Use Task-Based Evaluation for Large Model Coding Ability
Judging a model’s capability based on a single demonstration is easily influenced by visual polish, random luck, or how the prompt happens to be phrased. A more reliable approach is to break the evaluation into discrete tasks, each with clear acceptance criteria and the ability to be run repeatedly. This article uses several common interactive programming tasks to illustrate how to design tests, interpret results, and attribute failures.
1. Decomposing the Evaluation Dimensions
A single generated result typically contains multiple quality aspects at once. It is recommended to separate them into at least five dimensions:
- Functional correctness: Whether the program runs and whether the core features behave as specified.
- Visual fidelity: Whether the layout, color scheme, and animations match the description, and whether information remains legible.
- Numerical and physical accuracy: Whether collision detection, spacing, and coordinate calculations align with common sense and the requirements.
- Algorithmic correctness: Whether state transitions, reward design, and convergence behavior align with established theory.
- Instruction adherence and self-consistency: Whether the output satisfies all constraints and whether the explanatory text matches the actual code.
Once these dimensions are separated, a result can score high on one axis while failing on another, making the diagnosis much clearer.
2. Designing Representative Tasks
2.1 Visual Tasks: Particles and Lighting Effects
In this task, the model is asked to generate a page with particle effects or lighting effects. First impressions are not enough. The evaluation must check whether the animation continues to run, whether the particle count is reasonable, and whether the layout overflows at different window sizes. A common issue is that the visual effects look rich, but the text contrast is too poor to read. It is advisable to record the contrast ratio between background and foreground colors as a quantifiable metric.
2.2 Logic Constraint Tasks: Sliding Puzzle
Tasks like Huarong Pass examine the model’s ability to represent state and satisfy constraints. A correct implementation should conserve the number, size, and position of the pieces during movement; maintain a single empty slot; and ensure every move is legal. During testing, a script can read the page state and validate these properties programmatically, rather than inspecting each cell by hand.
One important observation is that visual effects described in the model’s chain-of-thought do not necessarily appear in the final code. For instance, the reasoning trace may claim to implement a stylized rendering, while the output contains only plain colors. This should be recorded as “inconsistency between explanation and implementation,” which is itself a scoring penalty.
2.3 3D Physics Tasks: Bowling
The bowling task evaluates the model’s ability to construct a 3D scene and handle collision detection. At the level of common sense, the bowling pins should be evenly spaced, and the ball radius should be large enough to cover the necessary contact area. Otherwise, the ball may pass through the pins, or a single roll could never knock down all pins under normal physics. Judgment methods include checking the geometric parameters of pin arrangement, verifying that collision volumes match the visual models, and running repeated simulations at a fixed initial velocity to observe the distribution of knocked-down pin counts.
Visibility is also part of the delivery quality. If the scene background is too dark or lighting is missing, the user cannot see the ball or pins clearly—this counts as a defect.
2.4 Algorithmic Tasks: Maze and Reinforcement Learning
The maze task checks the model’s understanding of Q-learning. The evaluation proceeds in two steps: first verify that the maze itself is valid, then verify that the algorithm implementation is correct.
Maze validity can be checked with a breadth-first search to confirm that the start and goal are connected:
from collections import dequedef reachable(grid, start, goal):rows, cols = len(grid), len(grid[0])seen = {start}queue = deque([start])while queue:r, c = queue.popleft()if (r, c) == goal:return Truefor dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)):nr, nc = r + dr, c + dcif 0 <= nr < rows and 0 <= nc < cols and grid[nr][nc] == 0 and (nr, nc) not in seen:seen.add((nr, nc))queue.append((nr, nc))return False
The correctness of the algorithm itself can be compared against a standard implementation. The code below serves as a reference to check the model’s logic, not as the expected output:
import randomimport numpy as npdef q_learning(grid, start, goal, episodes=2000, alpha=0.1, gamma=0.95, eps=0.1):rows, cols = len(grid), len(grid[0])q = np.zeros((rows, cols, 4))moves = [(-1, 0), (1, 0), (0, -1), (0, 1)]for _ in range(episodes):r, c = startfor _ in range(rows * cols * 4):a = random.randrange(4) if random.random() < eps else int(np.argmax(q[r, c]))dr, dc = moves[a]nr, nc = r + dr, c + dcif not (0 <= nr < rows and 0 <= nc < cols) or grid[nr][nc] == 1:nr, nc = r, creward = -1elif (nr, nc) == goal:reward = 100else:reward = -1q[r, c, a] += alpha * (reward + gamma * np.max(q[nr, nc]) - q[r, c, a])r, c = nr, ncif (r, c) == goal:breakreturn q
At acceptance time, three things matter: whether the update rule matches the Bellman equation, whether hitting a wall keeps the agent in place, and whether the termination condition is reasonable. If the maze takes up most of the screen or the start and goal are missing, the model has failed to satisfy the most basic layout constraints. These errors should be recorded before looking at algorithm details.
3. Result Verification and Chain-of-Thought Audit
The explanatory text produced by the model is a signal that requires independent verification. The audit steps are as follows:
- List every feature promised in the explanation.
- Locate the corresponding implementation in the code, one by one.
- Mark any item that cannot be found as “not implemented.”
This procedure exposes cases where the narrative is complete but the code is missing. The final judgment should be based on the code and the running result; the explanatory text is only a set of leads to be verified.
4. Regression Analysis in Multi-Round Repair
Many tasks allow the model to fix its output over multiple rounds. Each round should record the input, the output, and the reason for failure, so that “fixing one issue” is not mistaken for “overall improvement.” A common pattern is that the second round fixes an old problem but introduces a new layout or logic error.
It is recommended to keep a fixed regression test set, rerun all tests after each round, and record the outcomes in a table:
| Round | Passed Items | New Failures | Notes |
|---|---|---|---|
| Round 1 | Functional entry, basic layout | Maze dimensions abnormal | Takes up too much screen space |
| Round 2 | Maze dimensions restored | Maze not rendered | The fix introduced a rendering error |
The key is to maintain a stable test suite and track the full history of changes, so the evaluation reflects the model’s true progress over repair iterations rather than a single snapshot.
