Evaluating Large Language Models on Complex Front-End Generation: Test Scenarios and Prompt Optimization Tips

    This article examines how general-purpose large language models handle complex front-end generation tasks, using scenarios such as draggable desktop window systems, 3D window switching, and real-time strategy games. It breaks down the key evaluation dimensions, explains why multi-turn iteration can degrade visual quality, and presents a reusable four-layer prompt framework that separates functionality from visual specifications. Readers will also find practical evaluation criteria and guidance on moving generated pages into a cloud-based engineering and release workflow.

    1. Why Complex Front-End Generation Tests LLM Capabilities

    General-purpose large language models with long context windows and multimodal understanding are increasingly being evaluated on tasks like “generate a web page from a single sentence.” On the surface, producing a page is just outputting tags and styles. But when the task scales up to a desktop OS simulation with draggable windows, window effects with 3D transitions, or a strategy game with real-time combat logic, what is really being tested is the model’s combined understanding of interaction semantics, state management, and geometric modeling.

    These tasks are highly discriminating because they stress several capability dimensions at once:

    • Abstract concept understanding — for example, the fundamental difference between real-time strategy and turn-based gameplay.
    • Spatial and geometric reasoning — for example, the coordinates and adjacency relationships of a hexagonal grid.
    • Long-chain consistency — whether every requirement is implemented one by one without omissions when the list is long.
    • Visual fidelity — for example, translucent glass texture, button layering, and shadow details.

    2. Typical Test Scenarios and What They Evaluate

    2.1 Scenario 1: Desktop Window System with 3D Switching

    The requirement is to generate a desktop-style page with draggable windows plus a roughly 3D stacked window-switching effect. Evaluation focuses on three points: whether drag events and coordinate conversion are correct; whether window layering and focus management are clear; and whether the 3D transform uses sensible perspective and stacking relationships rather than a simple displacement simulation.

    2.2 Scenario 2: A Real-Time Strategy Mini-Game

    Converting a classic turn-based strategy game into a real-time one is a representative high-difficulty prompt. It requires the model to understand the mechanics of “fair time for both sides, no manual end-turn step” and then layer additional systems on top.

    • Requirement 1: Switch from turn-based to real-time progression — tests concept abstraction and main-loop design.
    • Requirement 2: Add a checkable auto-research assistant that completes research automatically when resources are sufficient — tests understanding of newly introduced systems driven by user intent.
    • Requirement 3: All units auto-pathfind and auto-target — involves path planning and target selection.
    • Requirement 4: Control enhancements, including a 1x–10x speed slider, a hexagonal grid, arrow-key viewport panning, and icons for cities and units.

    2.3 Scenario 3: Visual Details and “Glass Texture”

    In window-based tasks, translucent frosted effects, button highlights, and rounded shadows are often what separate results the most. This is not a functional issue but a matter of understanding style layering and compositing relationships.

    3. Observed Results: Speed, Stability, and Multi-Turn Iteration Gaps

    Two phenomena show up in practice. The first is slower responses caused by queuing and rate limiting. This is a server-side load issue unrelated to model capability; testing off-peak or switching to asynchronous requests is recommended. The second is more important: the same prompt can produce noticeably different results across different entry points, model versions, and prompts — and after two or three iterations, the initial visual advantage is often lost.

    A reasonable explanation is that multi-turn appended prompts introduce a large number of incremental constraints. Under a limited output budget, the model prioritizes functional items and compresses visual detail. Meanwhile, vague natural-language additions can conflict with existing constraints and cause style regressions. The fix is not to pile on more adjectives but to rewrite the prompt in a structured way.

    4. A Reusable Prompt Iteration Framework

    Split the prompt into four layers and converge layer by layer, instead of mixing every demand into a single sentence.

    1. [Role & Goal] You are a senior front-end engineer. Produce a single-file runnable page.
    2. [Feature List] 1. Real-time progression, no end-turn button; 2. Checkable auto-research;
    3. 3. Unit auto-pathfinding; 4. Speed slider 1x-10x; 5. Hexagonal grid;
    4. 6. Arrow-key viewport panning; 7. Icons for cities/units.
    5. [Visual Spec] Translucent frosted panels, 12px border radius, soft shadows, explicit z-index layering.
    6. [Acceptance] Self-check each item and output a checklist; explicitly flag unimplemented items.

    Four techniques matter most:

    1. Numbering makes it easy for the model to align with each item.
    2. Separating visual specs from the feature list prevents them from crowding each other out.
    3. Requiring self-check before output improves item coverage.
    4. Changing only one dimension per round makes it easier to locate the cause of a regression.

    5. Suggested Evaluation Dimensions

    • Feature coverage: whether every checklist item is implemented.
    • Interaction correctness: whether dragging, pathfinding, and speed scaling actually work.
    • Visual fidelity: whether transparency layers, icons, and the grid are consistent.
    • Code maintainability: single-file output, clear naming, no redundant dependencies.
    • Stability: whether variance across multiple generations is acceptable.

    6. Cloud Execution and Engineering Integration

    For long-term use, generated output should go through a standard engineering workflow: host the page artifacts on object storage or a static site service, build and release them uniformly through a container platform, connect logging and monitoring/alerting to track front-end exceptions, and use a message queue to smooth out batch generation peaks when needed. If stronger enterprise-side control is required, an evaluation pipeline can be built on Baidu AI Cloud’s general cloud products, archiving prompt versions, generated results, and human ratings together to form a sustainable regression evaluation baseline.

    7. Conclusion

    The gap in complex front-end generation capability is not mainly about “knowing how to write tags.” It comes down to three things: concept abstraction, constraint adherence, and visual layering. Numbering requirements, decoupling visuals from functionality, iterating one variable per round, and pairing this with a cloud-based evaluation and release pipeline is what turns an occasional “wow” result into a stable, deliverable capability.