Evaluating LLM-Generated SVG Cycling Animations: A Testing Methodology and the Limits of Automated Correction

    A practical evaluation framework for testing whether a code-generating LLM can produce an animated pelican riding a bicycle in pure HTML and inline SVG. Covers test condition logging, a coordinate-and-constraint prompt template, three common geometric and timing errors to check, the limitations of multimodal self-correction loops, and a step-by-step evaluation workflow with a checklist.

    1. Evaluation Goal and Boundaries

    This workflow uses a concrete task to evaluate code generation models: draw an animated pelican riding a bicycle using pure HTML and inline SVG, viewed from the side, with wheels rotating and legs performing circular motion as the pedals turn. The task is small, but it requires the model to handle coordinate positioning, geometric constraints, and time synchronization simultaneously—making it a good entry-level test for complex animation tasks.

    The task does not test physical realism. SVG animation is a two-dimensional approximation and does not rely on a physics engine. The evaluation focuses on whether the model can produce code that is geometrically self-consistent and temporally synchronized.

    The original author did not disclose the model name or version, referring only to “Model A” as the primary test model and “Model B” as the comparison model. Model A was tested at maximum reasoning effort in standard mode. Such results only reflect the model version and parameters at the time of testing. After a model upgrade, server-side change, or sampling parameter adjustment, the conclusions may no longer hold.

    2. Recording Test Conditions

    Before each evaluation, record the following information. Without it, results cannot be compared or reproduced.

    • Model name, version number, and invocation date.
    • Model parameters such as reasoning effort or thinking budget.
    • Sampling parameters, such as temperature, top_p, and maximum output length.
    • The full text of the system prompt and user prompt.
    • The number of runs per task. Run the same prompt multiple times to observe whether output is stable.
    • The rendering environment, including browser type and version, window size, and whether zooming is enabled.

    Save test results together with these conditions. If you only save the final HTML file without the conditions, you cannot later determine whether differences come from the model or the environment.

    3. Prompt Template and Coordinate Conventions

    In the original author’s first round of testing, the pelican’s facing direction was only corrected after the direction was explicitly stated in the prompt. The following template therefore specifies the coordinate system, orientation, and constraints upfront:

    1. Please draw a 2D animation of a pelican riding a bicycle using pure HTML and inline SVG, side view.
    2. Coordinate system: the origin is at the top-left, X is positive to the right, Y is positive downward. The pelican faces the positive X direction.
    3. Constraints:
    4. 1. Both hands touch the handlebars; hand coordinates must match handlebar coordinates. Small jitter is allowed, but hands must not leave the handlebars.
    5. 2. Each leg connects the hip, knee, and ankle. The pedal rotates at constant speed around the bottom bracket, and foot positions are computed with the circular parametric equations.
    6. 3. Wheels rotate around their axle centers, and the bottom edge of the frame is parallel to the ground.
    7. 4. All animations share one timeline with a 6-second period, looping continuously.
    8. Output a complete HTML file and list the key coordinates of each component in comments.

    After the template, evaluators need to define clear acceptance criteria.

    • Hand-to-handlebar tolerance. Measure the pixel distance between the two center points and set a threshold relative to canvas size. For example, with an 800-pixel-wide canvas, the distance should not exceed 2 pixels. This is a suggested starting point and can be adjusted, but it must be documented.
    • Period verification. Check the duration attributes of all animations in the file, including the dur of <animateTransform> and animation-duration in CSS. All should be 6 seconds.
    • Coordinate comment verification. The key coordinates listed in comments should match the actual values in the code. If they do not, the case should be marked as a failure even if the animation plays.

    4. Three Error Types to Check Carefully

    The following three error types should be prioritized during evaluation. The original author recorded the orientation issue in the first test round; the other two should be verified in your own runs.

    Error 1: Reversed orientation. The pelican’s head and handlebars have an inverted X-axis relationship, making it look like it is riding backwards. Check by comparing the X coordinates of the head and tail: the head’s X value should be greater than the tail’s. The fix is to state the orientation in the prompt and require the model to list the head and handlebar coordinates in comments. If the model still gets it wrong, check whether a mirror transform such as scale(-1,1) has been misused.

    Error 2: Feet detached from pedals. The ankle point of the leg is not computed with the circular parametric equations, causing the foot to separate from the pedal. The pedal position should satisfy x = cx + r·cos θ, y = cy + r·sin θ, where (cx, cy) is the bottom bracket coordinate and r is the pedal rotation radius. Check by reading the pedal and ankle coordinates at a given frame, computing the distance between them, and comparing it against the tolerance. The fix is to drive both the ankle point and the pedal from the same parameter θ, rather than hardcoding values independently.

    Error 3: Unsynchronized periods. The wheel animation period differs from the pedal animation period, so the rhythms do not match. In code, this usually appears as differing dur values, or differing durations when CSS and SVG animations are mixed. Check by searching the file for all duration-related fields and confirming they are all 6 seconds. The fix is to unify the timeline and note the period in comments.

    When judging whether an error has been fixed, look at both the static code and the rendered result. Code alone cannot reveal visual offsets, and the rendered output alone can miss issues hidden in duration fields.

    5. The Multimodal Correction Loop and Its Limitations

    A common approach is to let the model self-correct. The loop works like this: the model generates code, the system renders a screenshot, a vision model compares the screenshot against the requirements and feeds problems back to the code model, which generates again. This loop appears to reduce manual effort, but it has several clear limitations.

    First, vision models are insensitive to small offsets. A hand a few pixels off the handlebar may go undetected in a screenshot. The loop’s judgment therefore cannot be treated as direct evidence that coordinates are correct.

    Second, feedback text can introduce new errors. The vision model’s suggested fixes are sometimes inaccurate; after the code model applies them, one issue may be fixed while another is broken.

    Third, a single-frame screenshot cannot judge kinematic relationships. Whether the legs move in circles with the pedals requires multiple frames—ideally sampled at several points on the timeline, such as 0s, 1.5s, 3s, and 4.5s, and inspected frame by frame.

    Fourth, looping does not guarantee convergence. The loop may still fail after multiple rounds, or pass in one round while new problems appear in other components. It is recommended to record the number of correction rounds per task, the changes made in each round, and whether a human ultimately confirmed the result.

    The loop is typically less reliable in these scenarios: many components, coupled constraints, requirements for precise numeric alignment, and contradictions between visual feedback and code constraints. These scenarios should include human checkpoints and should not rely solely on automated judgment.

    6. An Executable Evaluation Workflow

    1. Fix the test conditions and record the model, parameters, and environment as described in Section 2.
    2. Generate the HTML file using the template in Section 3 and save the raw output. Do not modify it manually and then save it as “raw output.”
    3. Perform static checks: search all duration fields to confirm a 6-second period, and verify the key coordinates in comments.
    4. Open the file in the target browser, capture screenshots at at least 4 time points, and record the screenshot filenames with their corresponding times.
    5. Verify orientation, hand-to-handlebar distance, foot-to-pedal distance, and whether the bottom edge of the frame is parallel to the ground.
    6. Fill in a verdict of pass, fail, or undetermined for each item; attach screenshots and code line numbers for failures.
    7. Repeat runs with the same prompt, tally the pass count, and record the distribution of failure types.

    The key to this workflow is record-keeping. The output of every step should be verifiable by a second person.

    7. Evaluation Checklist

    • Model name, version, invocation date, and inference parameters recorded.
    • Full user prompt and system prompt saved.
    • Browser type, version, and window size fixed.
    • Pelican head X coordinate greater than tail X coordinate; orientation correct.
    • Hand-to-handlebar distance within the preset tolerance.
    • Foot-to-pedal distance within the preset tolerance in every frame.
    • All animation durations are 6 seconds and share the same timeline.
    • Bottom edge of the bicycle frame parallel to the ground.
    • Key coordinates in comments match the values in the code.
    • Screenshots taken at at least 4 time points, with filenames attached.
    • If automated correction was used, correction rounds and per-round changes recorded.
    • Failure samples saved and labeled with failure types.

    8. Conclusion and Risk Notes

    This workflow helps you turn vague questions like “can the model draw a pelican riding a bicycle” into checkable geometric and timing conditions. It is suitable for comparing performance on the same task across different models or parameters, and for identifying weak points in automated correction.

    Keep the following in mind when applying these conclusions. Model upgrades, sampling parameter changes, and server-side updates can all alter results. Different browsers may also render SVG slightly differently, so the same file may not look identical in two browsers. Additionally, this task is a two-dimensional approximation—passing the test only shows the code is geometrically self-consistent, not that the model understands dynamics.

    When citing these conclusions, state the test conditions and keep the failure samples. Only then can others judge which version the conclusions apply to, and in which scenarios they do not.