Reliability Evaluation and Engineering Practice for LLM Agents: Moving Beyond Visual Completion

    This article explains why visual polish does not show that LLM-generated interactive outputs, such as web games, 3D scenes, and algorithm demos, work correctly. It proposes a six-layer evaluation framework that covers rendering, interaction, domain common sense, instruction compliance, source attribution, and stability. It also shows how to turn these checks into automated assertions, using bowling pin spacing and grid-based layer alignment as examples.

    1. Background: Visual Completion Does Not Mean Functional Correctness

    When reviewers evaluate interactive outputs generated by LLMs, such as web mini-games, 3D scenes, and algorithm visualizations, they usually notice the visual quality first. Color, lighting, animation, and layout easily create a good first impression. However, these qualities reflect only surface completeness and say little about whether the functionality is correct.

    Common problems in practical testing include the following:

    • Disconnect between interface and function: The page renders completely, but the core logic does not run, or its results differ from what was expected.
    • Common-sense errors: Physical parameters do not match real-world magnitudes. For example, the gap between collision bodies is far larger than is reasonable.
    • Inconsistency between description and implementation: An effect the model mentions in its reasoning, such as a specific art style or material, does not appear at all in the final output.
    • Persistent errors after multiple corrections: A task allows several rounds of correction, but the problem may shift from one form to another without ever converging.

    These problems show that evaluation cannot rely only on human observation. Teams need to break down “done correctly” into conditions that can be verified one by one.

    2. Building a Layered Evaluation Framework

    We recommend splitting evaluation into six layers, each with its own method of judgment:

    1. Visual presentation: Whether the interface renders completely, whether the layout is misaligned, and whether element sizes are reasonable.
    2. Interaction and function: Whether buttons, inputs, and state changes respond as expected, and whether the program crashes or freezes.
    3. Domain common sense: Whether physical quantities, geometric relationships, and numerical ranges follow real-world rules.
    4. Instruction compliance: Whether constraints, such as the number of executions, the output format, and prohibited content, are satisfied item by item.
    5. Source attribution: Whether the data and conclusions cited in a response can be traced to a source in the retrieved material or the context.
    6. Stability and reproducibility: Whether results stay within an acceptable range of consistency across repeated runs with the same input.

    The first three layers suit automated assertion checks. The fourth and fifth layers require structured logs as support. The sixth layer depends on fixed random seeds and statistics from repeated sampling. The following sections describe the approach for three typical task types.

    3. 3D Scene Generation: Using Physical Common Sense as Assertions

    For 3D scene tasks, the evaluation focus is geometric and scale relationships. Take a bowling scene as an example. If the gap between pins is too large, the ball can pass through it, and the geometric condition for a strike no longer holds. Screenshots cannot reveal this kind of error, so the standard dimensions need to be written as assertions.

    The example below takes the ball diameter and pin spacing as input parameters and checks whether the gap between adjacent pins falls within a reasonable range. The values are common industry figures. Real projects should follow the specifications they are based on.

    1. # Unit: centimeters. The values are common figures and should be confirmed against the specification the project follows.
    2. BALL_DIAMETER = 21.8 # Bowling ball diameter
    3. PIN_CENTER_SPACING = 30.5 # Distance between the base centers of adjacent pins
    4. PIN_BASE_DIAMETER = 12.1 # Diameter of the pin base
    5. def check_pin_gap(center_spacing, pin_diameter, ball_diameter):
    6. """
    7. Check whether the gap between two adjacent pins is smaller than the ball's diameter.
    8. If the gap is not smaller than the ball's diameter, the ball can pass between the two pins,
    9. which contradicts the geometric premise of a strike.
    10. """
    11. gap = center_spacing - pin_diameter
    12. return {
    13. "gap": round(gap, 2),
    14. "ball_can_pass": gap >= ball_diameter,
    15. }
    16. result = check_pin_gap(PIN_CENTER_SPACING, PIN_BASE_DIAMETER, BALL_DIAMETER)
    17. assert not result["ball_can_pass"], f"Pin gap is too large: {result['gap']} cm"

    This kind of assertion does not depend on rendered screenshots, so it can go directly into a test suite. The same approach applies to other scenes. Parameters such as collision body dimensions, gravitational acceleration, friction coefficients, and frame rate can each be given a reasonable range first. A program can then check the values in the generated code.

    4. Algorithm Visualization: Layered Rendering and Coordinate Alignment

    Maze, path-planning, and reinforcement learning demo pages are usually built from several stacked layers, such as a terrain layer, an agent layer, and a numerical annotation layer. Evaluation needs to verify three things: whether all layers use the same coordinate system, whether the agent is located on a passable area, and whether the numerical annotations correspond one to one with the states.

    1. def assert_layers_aligned(terrain, agent_pos):
    2. """Check that the agent's coordinates fall within the terrain grid and on a passable cell."""
    3. rows, cols = len(terrain), len(terrain[0])
    4. r, c = agent_pos
    5. assert 0 <= r < rows and 0 <= c < cols, "Agent is out of bounds"
    6. assert terrain[r][c] == 0, "Agent is located inside a wall cell"

    Evaluating training results also requires distinguishing between two types of metrics. A decrease in the error of a Q-value table only shows that the numbers are changing. It does not show that the policy is usable. A more reliable approach is to observe the training error and the success rate of the greedy policy at the same time.