LLM Code Generation in Practice: Evaluating Capabilities with SVG Animation

    A task-based evaluation of LLM-generated SVG animation reveals a gap between syntactically valid code and visually coherent results. Using a pelican riding a bicycle as the test case, this article examines first-pass generation, self-correction, and cross-model differences, then outlines practical approaches to component validation, regression testing, and context engineering. The findings are specific to the tested tasks rather than a definitive ranking of model capabilities.

    1. Why Evaluate Models with Real-World Tasks?

    LLM-assisted coding has become a useful tool for improving software development productivity. As models evolve rapidly, developers face a recurring question: how should their practical capabilities be evaluated?

    Standardized benchmarks provide useful comparative data, but they do not fully capture performance on complex, open-ended development tasks.

    This evaluation therefore used an informal, experience-based approach to examine how a model interprets natural-language intent, generates structured code, and repairs errors. The goal was to offer developers a practical evaluation method, not to establish a definitive measure of overall model capability.

    The results should be read within that scope: they describe behavior on particular tasks under particular test conditions.

    2. Task Selection and Evaluation Setup

    The core challenge was to generate SVG animation code directly from natural-language instructions. This task was selected for three reasons:

    1. Multiple technical requirements. SVG combines coordinate systems, path syntax, and animation state management, making it useful for probing domain knowledge.
    2. Spatial and motion reasoning. A convincing animation requires the model to reason about object placement and coordinated movement.
    3. Direct visual feedback. Rendered output allows a human reviewer to identify many quality problems quickly.

    All tasks used the highest reasoning-effort setting available for the model being tested. The evaluation included both independent generation and self-correction, allowing observation of first-pass performance as well as the ability to diagnose and revise mistakes.

    3. First Test: Generating a Complex Visual Scene

    3.1 Task Design and Initial Results

    The initial prompt asked the model to create a complete HTML document containing an inline SVG animation of a pelican riding a bicycle.

    Although brief, the request involved several distinct challenges:

    • Scene structure: Constructing a composite scene with two main visual objects—the pelican and the bicycle.
    • Motion coordination: Synchronizing leg movement with the pedals’ circular motion through carefully timed animation.
    • Visual correctness: Maintaining a plausible riding posture, including contact between the rider’s hands and handlebars and between its feet and pedals.

    The model handled the basic code structure reliably and produced a runnable SVG framework. The rendered animation, however, had clear visual defects.

    3.2 Identifying Defects and Revising the Output

    The main problems concerned posture and orientation.

    The pelican performed movements resembling cycling, but its hands were not visually connected to the handlebars. This weakened the plausibility of the scene. The riding direction was also the opposite of the intended direction—a more fundamental mismatch between the visual result and the expected meaning.

    Debugging combined model self-review with human guidance. An image-analysis component was used to let the model inspect its rendered output.

    The model independently identified the local problem of the hands failing to reach the handlebars. It did not notice the broader orientation error. Only after a human explicitly pointed out the direction problem did the model make the necessary adjustment and regenerate code that matched the intended orientation.

    3.3 What the First Test Revealed

    This test exposed limitations in reasoning across a chain of visual constraints. The model could produce executable animation logic, yet struggled with spatial orientation and plausible physical contact.

    These failures point to weaknesses in spatial relationship modeling, although this task alone cannot establish their underlying training-related causes.

    The correction process also showed how strongly successful revision depended on the specificity of external feedback. A concrete error description triggered a useful fix, while self-review missed a scene-level inconsistency. In this example, detecting deeper logical problems remained less reliable than correcting clearly identified ones.

    4. Cross-Model Comparison

    A second, lightweight model was tested on the same task to provide a reference point. This model was known among developers for fast responses and competent basic code generation.

    Its output showed a different balance of strengths.

    First, the scene was more coherent. The pelican’s orientation and riding posture were more consistent with the expected physical relationships.

    Second, the animation coordinated the legs and pedals more effectively. The relationship between their angles and keyframe timing produced a better balance of smooth motion and physical plausibility.

    The pelican’s appearance was described as somewhat slender and less rounded than the first model’s rendering. Nevertheless, the overall coordination and immediate visual impression exceeded expectations.

    The comparison illustrates why code-generation quality should not be reduced to a single score. Models can perform differently on structured implementation tasks and visual common-sense constraints. Differences in training and architecture may contribute to these patterns, but the evaluation did not isolate those factors.

    For model selection, the practical lesson is to examine task-specific behavior alongside general benchmark results.

    5. Error Patterns and Capability Boundaries

    Across the tests, several patterns emerged.

    5.1 Strengths: Local Syntax and Component Construction

    The tested model performed well on isolated technical elements.

    Basic geometric components, such as circular bicycle wheels and the connected lines forming the frame, did not exhibit syntax errors or structural failures. This suggests a solid command of the SVG syntax needed for those components.

    However, correct individual parts did not guarantee a correct scene.

    5.2 Weaknesses: Global Coordination and Concrete Visual Reasoning

    The main difficulties arose when translating textual meaning into coordinated visual objects:

    • Spatial orientation: The model failed to preserve the intended facing or riding direction.
    • Physical contact: It did not consistently enforce contact relationships between the rider and the bicycle’s moving or supporting parts.
    • Compound instructions: Errors appeared when the task required implicit relationships across multiple logical components.

    These observations apply to the tested outputs. They should not be treated as proof that the model fails on every task involving these concepts.

    5.3 Implications for Development Workflows

    The results do not support treating an LLM as a general-purpose visual simulation engine without validation.

    A more practical approach is component-based validation. Break a complex SVG request into stages such as:

    1. Scene construction.
    2. Pose alignment.
    3. Animation control.

    Validate each stage before integrating the full result. This pipeline reduces the risk of conflicting requirements becoming entangled in a single generation step.

    Validation infrastructure matters as well. Teams generating visual content should consider automated checks for specific visual properties, expressing suitable requirements as code-level assertions rather than relying entirely on human inspection. Such checks can serve as repeatable quality gates alongside visual review.

    6. Building a More Useful Evaluation Framework

    Teams integrating LLMs into the software development lifecycle should establish a multidimensional evaluation process that evolves with their tasks and model versions.

    6.1 Classify Tasks by Difficulty

    Group internal coding tasks by complexity, knowledge dependencies, and reasoning-chain length.

    Routine CRUD work may be suitable for fast models. Complex system design and visual generation involving multiple interacting constraints warrant more human review.

    The aim is not to assign a model a universal capability label, but to match the task and its risks to an appropriate workflow.

    6.2 Run Continuous Regression Tests

    Build a custom evaluation set and rerun it periodically as models change.

    General benchmarks remain useful, but internal examples that reflect an organization’s business semantics provide a more direct view of suitability for its own workflows. Combining both sources of evidence reduces the risk of making decisions based only on vendor-reported results.

    Regression testing also makes model updates easier to assess against consistent requirements.

    6.3 Treat Context Engineering as Part of Reliability

    In these tests, correction quality depended heavily on how explicitly the input described the problem.

    Prompts should therefore state important constraints in a structured way. Physical rules and spatial relationships should be made explicit rather than left for the model to infer from unstated common sense.

    For complex visual tasks, supplying clear constraints is not merely a matter of wording. It is part of defining the implementation requirements and making the result easier to evaluate.

    7. Conclusion

    This task-based evaluation highlights a distinction: generating valid code is not the same as producing a coherent visual result.

    The tested models showed different strengths in scene construction, motion coordination, visual detail, and error correction. The first model produced a runnable structure but needed explicit feedback to resolve an important orientation error. The lightweight reference model delivered better overall visual coordination in this particular comparison.

    These findings are not a comprehensive model ranking. They support a more practical approach to AI-assisted development: set realistic expectations, evaluate models on representative tasks, validate components before integration, and maintain repeatable regression tests.

    The most useful question is not simply which model is “smarter,” but which model and workflow can reliably satisfy the constraints of the task at hand.