The Real Capabilities and Evaluation Methods of LLMs in Generating Interactive Web Applications

    Large Language Models (LLMs) have significantly improved their ability to generate web pages, mini-games, and data visualization demos. However, while these applications may appear visually complete, they often fall short of being genuinely usable. This article explores the gap between visual completion and actual functionality in LLM-generated web applications, examining issues in requirement understanding, geometric constraints, and algorithmic implementation. It provides practical evaluation methods and development advice to help developers build more reliable and maintainable interactive web demos using LLMs.

    In recent years, the ability of Large Language Models (LLMs) to generate web pages, mini-games, and data visualization demos has improved significantly. Given a natural language prompt, a model can typically output page structure, styling code, interaction logic, and even auto-organize a runnable front-end project. However, in actual practice, many generated works share a typical issue: the page “looks complete” but is still far from being truly usable.

    This gap often does not lie in whether the code can be generated, but rather in requirement understanding, geometric constraints, visual expression, interaction loops, and algorithm implementation. Particularly when a task involves graphic drawing, physics rules, state management, and training processes, models are prone to local correctness with global failure.

    1. Good Visuals Do Not Mean Accurate Requirement Implementation

    Visually, current LLMs can already generate fairly complete web interfaces. For instance, pages might feature gradient backgrounds, dynamic particles, card layouts, glowing buttons, shadow effects, and transition animations. These elements often quickly create a “tech vibe” or “product showcase feel.”

    However, visual completion mainly solves “whether it looks rich,” which is not equivalent to “whether it meets specific requirements.”

    For example, if a user asks for an ink-wash style chessboard or scene, the model might mention concepts like “ink rendering” or “traditional texture” in its reasoning or text. Yet, the final page only uses a dark background, blurred shadows, and gray gradients, failing to truly reflect features like brush strokes, rice paper textures, ink diffusion, or edge spreading.

    This indicates a potential deviation between the description in the model’s output and the actual code. The model can understand the semantic association of “ink-wash” but may not translate it into explicit rendering steps. To achieve a credible style, it usually needs further breakdown into:

    1. Background texture: simulate paper grain, fibers, and uneven base colors;
    2. Color control: reduce pure black, use overlapping gray-black with transparency;
    3. Edge handling: introduce blur, diffusion, and irregular contours;
    4. Brush stroke simulation: use noise, masks, or multi-layer paths to construct natural variations;
    5. Animation control: prevent elements from moving mechanically and synchronously.

    Therefore, when evaluating a model’s visual capabilities, one should not only check if the page is “flashy” but also verify line-by-line whether the style requirements are truly implemented in the code and rendering results.

    2. Rule-Based Mini-Games Easily Expose Common Sense Errors

    Board games may seem simple, but they actually demand high precision in spatial relationships and rule constraints. Take sliding block puzzles (like Klotski) as an example. Models can usually draw the board, generate blocks of different sizes, and implement click or drag operations. The real difficulty lies in ensuring all elements satisfy strict geometric relationships.

    A qualified board layout must meet the following conditions:

    • All blocks must be located within the legal grid;
    • Blocks cannot overlap;
    • Block movement can only occur in allowed directions;
    • Movement distance must comply with empty space and size constraints;
    • The initial state must be solvable;
    • The victory condition must be accurately detectable.

    If the model only arranges graphics based on visual impressions without establishing a unified grid coordinate system, blocks might appear neat visually but cannot actually move, or the layout might be entirely unsolvable.

    A more reliable implementation is to separate interface coordinates from logical coordinates. The logical layer only handles rows, columns, width, height, and empty space states, while the rendering layer converts logical coordinates to pixel positions. For example:

    1. Logical state:
    2. {
    3. type: "block",
    4. row: 1,
    5. column: 2,
    6. width: 2,
    7. height: 1
    8. }
    9. Rendering position:
    10. left = column * cellWidth
    11. top = row * cellHeight

    The benefit of this approach is that rule checks do not rely on visual positions on the page, reducing issues caused by floating-point errors and drag offsets.

    3. Physics-Based Interactions Cannot Rely Solely on “Looking Reasonable”

    Bowling, collision balls, or slingshot mini-games have even stricter geometric requirements. A common failure case is that pins are drawn, but the spacing between them is too large, causing the ball to fail to knock down all targets as expected.

    This is not simply an art problem; it stems from a lack of uniformity among the collision model, size proportions, and layout rules.

    When implementing physics-based scenes, consider at least:

    1. Object Size

    The ball’s radius and the pins’ width and height must have proportional relationships. If the ball is too small, it might not cover the effective collision area even if it appears centered visually.

    2. Arrangement Spacing

    The spacing between targets cannot be set by eye; it should be calculated based on collision radius. For gameplay requiring “hitting multiple targets at once,” the spacing must be within a reasonable range.

    3. Collision Detection

    Simple demos can use circle or axis-aligned bounding box collisions, but the detection range must match the visual object. A common error is scaling the visual element while keeping the collision area at a fixed size.

    4. Motion Direction

    The ball’s initial velocity, friction, boundary bounce, and target offset all affect the final result. If only a fixed horizontal displacement is set, the game might move but lack a true sense of control.

    5. Visibility

    If the interface background is too dark and object colors are too similar, users cannot even determine the positions of the ball and pins. Visual design must serve interaction; basic readability should not be sacrificed for “immersion.”

    Therefore, the acceptance criteria for physics-based demos should not merely be “can start, can move,” but should also include whether collisions are accurate, whether actions meet expectations, whether objects are clearly visible, and whether results are stable across different inputs.

    4. Mazes and Reinforcement Learning Tasks Better Test Overall Engineering Capabilities

    Reinforcement learning simulations in mazes are more complex comprehensive tasks than ordinary web games. They simultaneously involve map generation, agent movement, reward design, state updates, training process presentation, and final policy execution.

    The difficulty of such tasks lies not in writing a few state variables, but in ensuring consistency across multiple layers:

    • Map layer: walls, passages, start, and end points;
    • State layer: the agent’s current location;
    • Action layer: movement behaviors like up, down, left, right;
    • Value layer: estimated values corresponding to each state or action;
    • Training layer: exploration, exploitation, rewards, and iterative updates;
    • Presentation layer: whether paths, values, and animations accurately reflect internal states.

    Several typical issues frequently occur in practice.

    1. Map Cannot Be Drawn Correctly

    The model might generate a maze container but fail to initialize the wall array, or use different row/column counts for map dimensions and the render loop. The result is a page with a frame but no actual maze.

    2. Training Logic Exists, but Interaction Cannot Start

    Some code can update the value table, but buttons are not bound to events, the animation loop is not started, or it fails to switch to an executable state after training. The algorithm code might not be entirely wrong, but the product loop has failed.

    3. Action Layer Misaligned with Map Layer

    This is one of the hardest issues to debug. For instance, the map is drawn based on cell size, but the agent uses a different set of offsets when moving; or walls use row/column coordinates while the character directly adds up pixel coordinates. This results in characters passing through walls, stopping at grid boundaries, or appearing in unreachable areas.

    The solution is to unify the coordinate conversion function:

    1. cellToPixel(row, column):
    2. x = column * cellSize + cellSize / 2
    3. y = row * cellSize + cellSize / 2
    4. return (x, y)

    All maps, characters, paths, and value markers must call the same conversion logic; coordinate calculations should not be repeatedly hand-coded in different components.

    4. Value Table Convergence Does Not Mean the Policy Is Correct

    Even if the training curve stabilizes, it does not mean the agent has learned the optimal path. You must also check:

    • Whether the goal is reached;
    • Whether it frequently hits walls;
    • Whether it falls into a loop;
    • Whether a shorter path exists than the current one;
    • Whether the executed policy post-training is consistent with the value table.

    If the reward design is unreasonable, the model might learn incorrect policies like “try not to move,” “circle repeatedly,” or “only pursue local rewards.” Therefore, training results must be judged jointly with path quality and behavioral performance.

    5. Why Models “Fail to Fix It After Multiple Revisions”

    When users repeatedly ask the model to fix the same project, it often exhibits a phenomenon of “fixing one issue while introducing another.” This usually happens for the following reasons:

    1. Lack of Executable Acceptance Criteria

    If the requirement is just “make the maze work,” the model doesn’t know what “work” means. A more specific description should include: the map must display, the character must start at the beginning point, movement must occur after clicking start, walls cannot be passed through, and the path must be shown after training.

    2. Excessive Modification Scope

    Models tend to rewrite large sections of code rather than just fixing the point of failure. Large-scale rewrites increase inconsistencies among state variables, event bindings, and styles.

    3. No Regression Testing

    Existing functions should be re-verified after every modification. For example, after fixing character movement, re-check that map display, button response, and the training process haven’t been broken.

    4. Over-Reliance on Explanation Text

    The model might give explanations like “fixed coordinate sync” or “added collision detection,” but explanations do not equal implementations. Acceptance must be based on actual running effects and key code paths.

    6. How to Design More Reliable LLM Front-End Evaluations

    To objectively compare different models’ abilities to generate web applications, it is recommended to adopt a layered evaluation rather than just looking at final screenshots.

    Layer 1: Startup Check

    Confirm the project can load normally, the page has no obvious script errors, and resource paths and event bindings are valid.

    Layer 2: Visual Check

    Check layout, text, colors, contrast, element size, and responsive behavior. Focus on whether specified styles in the requirements are truly reflected.

    Layer 3: Interaction Check

    Execute button clicks, drags, keyboard inputs, and reset operations item by item to verify that each interaction forms a complete loop.

    Layer 4: Rule Check

    For tasks like boards, collisions, and mazes, verify boundary conditions, illegal operations, victory conditions, and abnormal states.

    Layer 5: Data and Algorithm Check

    Confirm whether state updates, training iterations, path generation, and result displays are consistent, avoiding the illusion of “the interface is moving, but the internal logic hasn’t changed.”

    Layer 6: Maintainability Check

    Check whether the code has duplicate logic, hardcoded coordinates, overly large single-file components, or missing error handling. Outputs meant for actual development use should not only be demonstrable but also easy to modify later.

    7. Practical Advice for Developers

    When using LLMs to generate complex demos, it is best to follow a “logic first, visuals later; minimal loop first, gradual enhancement later” workflow.

    Step 1: First, ask the model to complete a plain text or simple graphic version to confirm that state changes and rule checks are correct.

    Step 2: Next, add page layout and basic styles to prevent visual code from masking logical issues.

    Step 3: Add animations, particles, gradients, and decorative effects, ensuring these do not affect interactive performance.

    Step 4: Add automated checks or at least establish a manual acceptance checklist, verifying each function item by item.

    Step 5: When issues arise, provide specific reproduction steps, expected results, and actual results, rather than just saying “it still doesn’t work.” The more specific the information, the easier it is for the model to locate the true point of failure.

    Overall, LLMs already possess strong capabilities in web generation and demo construction, particularly excelling at quickly building interfaces, organizing common components, and implementing basic interactions. However, in terms of geometric constraints, physics rules, complex state synchronization, and algorithm visualization, developers still need to perform strict acceptance checks.

    What is truly worth noting is not whether the model can generate “visually complete” code in one pass, but whether it can continuously understand requirements, verify results, locate issues, and maintain system stability after multiple rounds of revisions. For complex applications, generation speed is just the starting point; accuracy, runnability, and maintainability are the core metrics for measuring engineering value.