LLMs Building with Bricks: Functional Models Are Easy, Good Design Is Hard

    This article explores the challenges of using large language models to generate brick-built structures from text descriptions. It breaks the task down into physical feasibility and visual quality, explains how hierarchical part retrieval addresses the scale of large brick libraries, and examines why general-purpose coding agents outperform task-specific models through a generate-check-repair loop. It also covers evaluation design—physical, semantic, and aesthetic metrics—and offers practical engineering advice for building similar systems.

    1. Task Background: From One Sentence to a Full Structure

    Having AI generate 3D models, CAD parts, or rendering scripts is already a common engineering task. Building brick models goes a step further: the model must take a short text description, select suitable parts from a massive library, determine each part’s position, orientation, and color, and ensure the overall structure remains stable under gravity.

    The input to this kind of task is short, but the output is a combination of hundreds or even thousands of discrete parts. Every decision affects subsequent steps, so it is fundamentally a constrained sequential generation problem.

    2. The Core Difficulties: Physical Feasibility and Visual Quality

    Evaluating a brick model can be split into two dimensions.

    1. Physical feasibility

    • Collision detection: the geometry of adjacent parts must not intersect.
    • Connection: every part needs a valid interlock with other parts in the structure, or the model will fall apart when touched.
    • Stability: the center of gravity must fall within the support area, so the structure does not tip over or collapse at rest.

    Physical feasibility can be verified automatically by a program, with clear pass/fail criteria, making it well suited to quantitative measurement.

    2. Visual quality

    Visual quality is hard to capture with a single formula. Two models may both fully match the text description and both stand stably, yet one has well-proportioned, detailed design while the other looks rough and arbitrary. This difference involves proportions, symmetry, color schemes, and local detail, and must be assessed with a combination of human judgment and auxiliary metrics.

    3. Part Selection: A Retrieval Problem Driven by Scale

    Public brick part libraries contain more than 14,000 part types, varying in shape, size, and connection method. A model that relies solely on memory will easily pick the wrong part or use a nonexistent variant. A reasonable approach is to split retrieval into two steps:

    1. First determine the required part category from semantics, such as “plate,” “slope,” or “cylinder.”
    2. Then filter within that category for the specific variant whose dimensions, color, and connection points match.

    This hierarchical approach shrinks the search space and makes it easier to locate problems when something goes wrong.

    4. Why General-Purpose Agents Perform Better

    Early task-specific models trained on brick-building data had a clear advantage in data coverage. However, research found that a general-purpose coding agent, never specifically trained on brick data, achieved performance close to human-designed reference solutions on existing benchmarks—and significantly outperformed the specialized models.

    The key difference lies in the working method. A general-purpose agent can:

    • Write code to generate structures instead of predicting parts one by one;
    • Call checking functions to verify results;
    • Revise the plan based on error reports and verify again.

    This “generate, check, repair” loop mirrors how human engineers work. Here is a conceptual illustration of the process:

    1. def build_structure(prompt):
    2. plan = draft_layout(prompt) # Plan the overall layout from the description
    3. while True:
    4. parts = place_parts(plan) # Select parts and determine positions
    5. report = check_physics(parts) # Check collisions, connections, and stability
    6. if report.passed:
    7. break
    8. plan = repair(plan, report) # Revise the plan based on the report
    9. return parts

    This code only expresses the idea; each function must be implemented against a specific part library and physics engine.

    5. Designing the Evaluation System

    Now that general-purpose methods can handle the “functional” part of the task, evaluation needs to raise the bar—testing whether a model truly understands design rather than merely passing easy problems by luck. A reasonably complete evaluation system can include three categories of metrics.

    1. Physical metrics

    Count collisions, disconnected parts, and whether stability requirements are met. These results can be computed automatically.

    2. Semantic alignment metrics

    Compare the generated result against the text description and check whether key objects are present—for example, whether “a pelican riding a bicycle” includes both the bird’s form and the bicycle’s wheels and frame. Such checks can be done with vision models or multimodal evaluators.

    3. Aesthetics and design quality metrics

    This is the hardest part to quantify. A common approach is to organize multiple reviewers for blind evaluation, comparing submissions against reference solutions and recording the degree of reviewer agreement. Automated metrics can only serve as auxiliary references and cannot fully replace human judgment.

    6. Practical Engineering Recommendations

    When implementing a similar system in a real project, the following principles can help.

    • Ensure feasibility before pursuing aesthetics. Physical checks should act as a hard gate; any result that fails goes straight into the repair stage.
    • Expose checks as callable functions. Letting the agent obtain structured error information significantly improves repair efficiency.
    • Keep reference solutions for evaluation. Human-designed samples provide a baseline for comparison and can reveal systematic biases in proportion and detail.
    • Log every iteration. Saving intermediate plans and reports makes it easier to analyze failure causes and improve prompts or rules.
    • Control problem scale. Complex builds can be split into submodules, generated separately, and then assembled, reducing overall constraint complexity.

    7. Limitations and Future Directions

    Current methods still have clear limitations. First, physics engine accuracy differs from real materials—a structure that passes simulation may not be stable in physical form. Second, aesthetic evaluation relies on subjective judgment, and standards may vary across reviewers. Third, as part libraries keep growing, retrieval and selection efficiency still needs improvement.

    Future work can advance in two directions: making evaluation metrics better aligned with human perception, and extending the generate-check-repair loop to more manufacturing and design scenarios. The brick-building task is moderate in scale and has well-defined rules, making it an ideal starting point for validating such methods.