How to Scientifically Evaluate LLMs' Ability to Replicate Web Animations

    This article explains how to use a "web animation replication" task as a rigorous benchmark for evaluating the coding capabilities of large language models. It covers why replicating a particle-animation page is a high-quality test case, how to design evaluation prompts that specify goals without prescribing methods, what to observe during execution (tool-use strategy, handling of minified code, computer-use ability), a five-dimension scoring framework with a reference Canvas particle implementation, and recommendations for building a fixed, repeatable evaluation benchmark to avoid novelty bias.

    How to Scientifically Evaluate LLMs’ Ability to Replicate Web Animations

    1. Why “Replicate a Cool Web Page” Is a Great Benchmark

    Whenever a new generation of large models is released, the official demo page is usually visually striking: the hero section features a signature shape built from particles. As you scroll, the particles first scatter like a starfield, then converge into a specific form, with subtle interactive feedback when the mouse hovers. This kind of effect is typically implemented with a WebGL or Canvas particle system, and the code is minified, obfuscated, and split into on-demand chunks.

    Many people’s first reaction to such a page is: “Let the model replicate it for me.” This seemingly casual request is actually a high-quality benchmark task, for three reasons:

    1. Clear goals and verifiable results: The reference page is live online. Whether the result matches is obvious at a glance—there is no gray zone of “it looks okay.”
    2. Complete capability chain: The model must first fetch and analyze a third-party page’s implementation (browser access, network inspection, reading minified code or screenshot analysis), then abstract the structure of the particle system (particle count, target shape for convergence, scattering logic, scroll-driven interpolation, mouse-interaction force field), and finally produce a standalone, runnable demo page. This pipeline covers four categories of capability: information retrieval, code comprehension, graphics knowledge, and engineering delivery.
    3. It exposes the “planning vs. execution” gap: Many models can explain the principles clearly but cut corners in the actual implementation. Replication tasks amplify this gap most effectively.

    2. Prompt Design: State the Goal, Not the Method

    A good evaluation prompt should mimic how real users communicate—state what you want clearly, without telling the model how to do it. The prompt structure used in this article can serve as a template:

    In the middle of a certain page’s homepage there is a dynamic effect: as you scroll, particles converge and scatter; when converged they form a specific shape, and when scattered they look like tiny stars; moving the mouse over them produces an interactive effect. Please help me replicate this effect. You may use browser-access skills to fetch the relevant source code directly, or reconstruct it through screenshot analysis—the approach is up to you. I want it to be as identical as possible, and the final deliverable should be a standalone demo page.

    This prompt has several deliberate design choices:

    • No prescribed technical path: The choice between “fetching code via the browser” and “reverse-engineering from screenshots” is left to the model, so you can observe its task-planning ability.
    • Emphasis on replication over innovation: Open-ended creative tasks let models play to their strengths and hide weaknesses. “Replicate it exactly” is actually a stricter constraint and measures fidelity more clearly.
    • A standalone deliverable: A single runnable HTML demo page makes it easy to compare outputs across models.

    3. Execution Observations: Which Implementation Path Do Models Choose?

    In cross-model comparisons, a convergence pattern emerges: almost all models choose “load the page in a browser + analyze script resources in network requests” rather than taking screenshots first and reasoning purely from pixels. This is reasonable—resources loaded by the browser are, in theory, all retrievable, and deobfuscation is far cheaper than inferring physics parameters from pixels.

    But “getting the code” is not the same as “understanding the code”:

    • Minification and code-splitting act as natural difficulty filters. Production code is minified and obfuscated, and animation-related logic is often split across multiple asynchronously loaded chunks. Some models grab only the entry script and rush into implementation, producing shapes that differ noticeably from the original. Others keep tracing dynamically loaded resources, and even use runtime debugging techniques (breakpoints, inspecting uniform variables) to recover the particle system’s parameters.
    • Whether the model leverages computer-use capabilities is another dividing line. The ideal path is for the model to operate the browser’s developer tools directly and observe runtime behavior. In practice, some models only read static code and develop an insufficient understanding of dynamic behaviors such as “how scroll progress maps to the degree of convergence.”

    This tells us that the tool-invocation strategy should be recorded as an independent observation item during evaluation, not just the final page.

    4. Evaluation Dimensions and Scoring Framework

    We recommend scoring each model on the following five dimensions (1–5 points each):

    1. Shape fidelity: Does the converged shape’s outline match the original? This is where things most often go wrong—insufficient particle counts or errors in target-point computation lead to results that look similar but feel wrong. Common failure modes include blurred edges and distorted proportions.
    2. Animation fidelity: Is the scroll-driven scatter/converge interpolation smooth? Does the easing function approximate the original’s physical feel?
    3. Interaction completeness: Is the mouse-hover repulsion/attraction effect implemented, with reasonable response radius and strength?
    4. Process quality: Did the model make full use of available tools? Was the analysis efficient? Did it require repeated human correction?
    5. Engineering deliverability: Is the output a single-file, directly runnable page? Is the code maintainable, with necessary documentation?

    A simplified reference implementation skeleton (native Canvas particles) looks like this:

    1. const particles = targets.map(t => ({
    2. x: Math.random() * W, y: Math.random() * H, // scattered position
    3. tx: t.x, ty: t.y, // target point when converged
    4. }));
    5. function update(scrollProgress) {
    6. for (const p of particles) {
    7. // scroll-driven: interpolate between scattered and converged
    8. const gx = p.x + (p.tx - p.x) * scrollProgress;
    9. // mouse force field: repel when close
    10. const d = dist(mouse, p);
    11. const repel = d < R ? (1 - d / R) * FORCE : 0;
    12. p.x += repel * Math.cos(angle); p.y += repel * Math.sin(angle);
    13. p.draw(gx, p.ty + (p.y - p.ty) * scrollProgress);
    14. }
    15. }

    Production implementations are usually more refined (GPU-side computation, noise-field perturbation), but this skeleton is sufficient as the “passing threshold” reference in evaluation.

    5. Conclusion: Beware of Novelty Bias; Use Fixed Tasks for Long-Term Evaluation

    A common conclusion from cross-model comparisons is: low expectations plus first-impression novelty most easily lead evaluators to give inflated scores. Real gaps, however, are often revealed instantly in a replication task—some models approximate the original in their first attempt, while others produce clearly distorted shapes that remain off even after multiple rounds of correction.

    Recommendations for developers and enterprise users:

    • Build your own fixed benchmark suite (several replication, debugging, and refactoring tasks), and run the same suite for every new model release to avoid being swayed by a single experience.
    • Score both process and results—tool-invocation strategy and the number of correction rounds also count as costs. In pay-per-use API scenarios, correction rounds directly determine real usage cost.
    • For enterprise adoption, you can combine model services, logging services, and monitoring/alerting capabilities provided by general cloud platforms to build an automated evaluation pipeline—turning model selection from “gut feeling” into “data-driven decisions.”

    Replicating a cool web page is just the starting point. The methodology behind it—clearly verifiable goals, open choice of approach, and a structured scoring framework—is the reusable asset worth keeping.