Evaluating LLM Capabilities for Generating Complex Interactive Web Pages
This article explains how to evaluate large language models on complex interactive web generation, from static pages to stateful systems. It covers layered evaluation criteria, two case studies (draggable 3D windows and turn-based to real-time strategy conversion), acceptance assertions, and engineering practices for reproducible selection.
From Static Pages to Complex Interaction: The Evaluation Target Is Changing
LLM web generation has moved from “write a static page” toward producing interactive systems with state management, real-time loops, pathfinding, and visual consistency. These tasks resemble real front-end and game-prototype work: the model must implement UI, domain rules, state, input events, and logical consistency across requirements.
Interactive online labs lower the trial barrier: users enter prompts, preview results, iterate, and compare rounds in one interface. That is useful for developers validating ideas, but teams need reproducible evaluation, not just a trial impression. The same task may slow under peak load, reducing iteration rounds; versions and routing can also change outputs. Evaluation should therefore fix inputs, context, parameters, and acceptance criteria, and use anonymous blind tests when needed to reduce brand bias.
Evaluation Design: Turn “Looks Good” into Verifiable Items
Evaluate complex interactive pages in layers:
- UI fidelity: layout, hierarchy, materials, icons, and responsive behavior match the spec.
- Interaction correctness: drag, click, keyboard, sliders, and view switching remain stable.
- Business logic: state machines, resource progression, target selection, and auto-scheduling follow the rules.
- Performance and maintainability: animations do not stutter, frequent reflow is avoided, and structure remains iterable.
Each requirement should become a testable assertion, not a screenshot. “Windows can be dragged” means coordinate deltas match pointer movement. “Speed from 1x to 10x” means time-advance multiplier changes, not only animation frame rate. “Units auto-seek opponents” means target selection and path updates still work after obstacles change.
Keep the environment fixed: prompt version, temperature and other parameters, context length, network conditions, and preview container. Record first-pass rate, iteration count, human fixes, stuttering, and visual defects. Recording both quality and cost is what makes selection engineering-relevant.
Case 1: Desktop Window Interaction — Acceptance and Implementation Notes
A typical task is a desktop-style page with draggable windows and 3D window switching. Requirements: windows can be dragged, brought to front, closed or minimized; on switch, windows enter a 3D layout with the current window in front; windows use translucent materials and clear buttons.
Implementation: maintain window coordinates in a state table; on drag, record pointer start and window start, then update position. Manage stacking with z-index or an equivalent field. Capture and release pointer events so fast movement is not lost. Prefer transform during drag to reduce layout thrash. 3D switching can use perspective transforms and animation-frame scheduling, with a fallback for low-end devices. Translucency must keep text readable.
Pseudocode:
onPointerDown(windowId, event):active = windowIdstartPointer = event.positionstartWindow = state[windowId].positioncapturePointer()onPointerMove(event):if active is null: returndelta = event.position - startPointerstate[active].position = startWindow + deltarenderWithTransform(active)onSwitchView():for each window:animateTo3DLayout(window, isActive)bringToFront(activeWindow)
Common failures: drag out of bounds, stacking errors, stuttering switch animation, weak button details. Write acceptance as assertions in the prompt, e.g. “after drag, window top-left equals pointer displacement,” “after switch, all windows enter 3D layout and the current window is in front,” “no layout jitter during drag.” That pushes the model toward checkable implementations rather than visual approximations.
Case 2: Converting a Turn-Based Strategy Game into Real-Time Strategy
A harder task is converting a turn-based strategy game into real-time strategy. The core is not removing a “next turn” button; it is continuous time, fair clocks for both sides, and resource production and unit actions on a timeline. Requirements:
- Real-time progression: no manual turn key; the game loop advances time.
- Assisted research tree: an optional assistant auto-selects and completes research when resources allow.
- Auto-seek: all units seek enemies and cities, requiring targeting and pathfinding.
- Control enhancements: 1x–10x speed slider, hex grid, arrow keys to pan the view, common icon characters for main objects.
Architecture: game loop + entity-component + grid coordinates + pathfinding + scheduler. The loop advances time by the speed multiplier; the research scheduler completes tech when resources suffice; unit controllers periodically pick targets and request paths; the render layer draws the hex grid and camera offset.
Pseudocode:
gameLoop(deltaTime):scaled = deltaTime * speedMultiplieradvanceResources(scaled)autoResearchIfEnabled()for unit in units:target = findNearestEnemyOrCity(unit)path = findPath(unit.grid, target.grid)moveAlongPath(unit, path, scaled)render()onSpeedSlider(value):speedMultiplier = clamp(value, 1, 10)onArrowKey(direction):camera.offset += directionToGridDelta(direction)
Check for leftover turn logic; whether the slider changes time scale rather than render speed only; correct hex coordinate conversion; keyboard pan vs. input-focus conflicts; seek jitter or target thrashing; research assistant waiting when resources are insufficient. Prompt strategy: first require a domain model and data structures, then a feature list, then a self-test checklist. Staged generation is more stable than dumping all requirements at once.
Results Analysis and Engineering Recommendations
Complex interaction tasks expose model differences: some look close but miss logic; some pass logic with rough UI; some work as a single file and collapse when requirements grow. Do not judge first-look quality alone—record requirement pass rate, rework points, human fixes, and runtime performance. Peak-hour latency hurts iteration; teams can use async submission, cached baselines, batch evaluation, and a fixed sample set.
For production use, build a layered suite: basic UI, stateful interaction, real-time logic, and full game tasks. Automate key assertions. Host the evaluation environment on a general container platform, store artifacts in object storage, log iterations, and monitor latency and failure rate. Template prompts with role, domain rules, feature list, acceptance assertions, and output format. Final selection should weigh quality, stability, latency, cost, and maintainability—not a single demo.
