How Native Multimodal Large Language Models Achieve Visual Closed-Loop Programming
This article explores the technical logic behind native multimodal large language models (LLMs) and their implementation of visual closed-loop programming. It covers four key aspects: sparse activation via Mixture of Experts (MoE), native multimodal pretraining, the generate-observe-correct workflow of visual closed-loop programming, and the cost implications of low-priced models. Developers will learn how these models integrate visual capabilities during pretraining to autonomously review and refine rendered code.
Introduction
Recently, a new large language model has sparked discussions in the developer community. According to its public materials, despite a relatively small parameter scale, its comprehensive capabilities are comparable to top-tier models in the industry, while its API pricing is significantly lower. Another notable feature is that it integrates image and text capabilities during the pretraining phase. This article organizes the basic logic of this technical route from four perspectives: architecture, multimodality, visual closed-loop programming, and cost. The performance and pricing data mentioned are based on public claims; please refer to official technical reports and third-party evaluations for actual usage.
1. Sparse Activation: Large Total Parameters, Partial Computation per Inference
The Mixture of Experts (MoE) architecture divides model parameters into multiple expert subnetworks. Traditional dense models activate all parameters for every inference, whereas MoE models only activate a portion, using a routing mechanism to determine which experts process the current input.
According to public data, this model has a total parameter count in the hundreds of billions, activating approximately 18B parameters per inference, an activation ratio of around 5%. Since computation scales roughly with the number of activated parameters, the computational cost of a single inference is lower than that of a dense model with the same total parameters. This ratio is a theoretical estimate; actual latency is also affected by VRAM, communication, and batch processing.
This design offers two main benefits. First, inference costs are reduced. Second, the total parameter capacity remains large, allowing different experts to specialize in areas such as programming, mathematics, multilingual understanding, and visual comprehension. The model’s developers also stated that a portion of its inference traffic runs on specialized chip clusters. The actual scale and effectiveness of this claim should be verified against public technical reports.
2. Native Multimodality: When is Visual Capability Introduced?
Many programming models in the past could only process text. They could generate front-end code but could not see the rendered pages. Issues like layout misalignment or color inconsistency had to be checked manually.
Currently, there are two technical routes to supplement models with visual capabilities:
| Comparison Item | External Vision Module | Native Multimodal Pretraining |
|---|---|---|
| Approach | Attaching a vision encoder to an existing text model and conducting alignment training | Unified modeling of images and text during the pretraining phase |
| Development Cycle | Shorter | Longer |
| Training Cost | Lower | Higher |
| Vision & Language Reasoning | The connection between the two parts may not be tight enough | Shares the same representation; theoretically tighter connection |
| Applicable Scenarios | Quickly patching visual capabilities | Scenarios requiring high visual reasoning and willing to invest more resources |
The aforementioned model follows the second route. After generating front-end code, it can take a screenshot to view the results and self-correct if it identifies issues. Whether this is stable and reliable requires testing on your own tasks.
3. Visual Closed-Loop Programming: Generate, Observe, Correct
The basic workflow of a visual closed loop is: generate code, run, render, review, and correct. The pseudocode below illustrates the structure and is not directly runnable:
# Pseudocode: Basic workflow of visual closed-loop programmingMAX_ITERATIONS = 8 # Set an iteration limit to avoid infinite loopsdef visual_loop(task, model, sandbox):context = [task]for step in range(MAX_ITERATIONS):code = model.generate_code(context)artifact = sandbox.run(code) # Run in an isolated environment, outputting a page or chartscreenshot = sandbox.render(artifact) # Render and take a screenshotissues = model.review(screenshot, task.acceptance_criteria)if not issues:return artifact # Pass visual acceptancecontext.append(issues) # Feed issues back to the model for the next roundraise RuntimeError("Reached iteration limit, transferring to manual handling")
When implementing this, pay attention to the following points:
- Execution Environment: Run the code in an isolated container or sandbox with fixed dependency versions. Otherwise, environment differences will lead to inconsistent screenshots and affect the model’s judgment.
- Screenshot Transmission: The rendering result is passed to the model as an image. Ensure the API supports image input, and control the image resolution to avoid consuming too many tokens.
- Acceptance Criteria: Specify testable conditions in the prompt, such as elements not exceeding container boundaries, text contrast reaching agreed values, and key buttons remaining visible on mobile screen widths.
- Iteration Limit and Fallback: Set a maximum number of rounds and a timeout. If the number of issues does not decrease for two consecutive rounds, interrupt the process and handle it manually.
In a public demonstration, the model reportedly ran autonomously for over ten hours, building a large-scale scene using a 3D modeling tool. This demonstration showcases long-term iteration capabilities and does not represent a general production metric.
4. Cost: What Choices Do Low-Priced Models Change?
According to public data, the model’s API price is far lower than that of industry flagship models, and its performance in some programming evaluations is close to or even slightly exceeds that of flagships. These claims need to be verified by checking evaluation names, versions, dates, and pricing units.
When comparing prices, looking solely at the unit price is insufficient. You should also check the following conditions:
- Whether input and output tokens are billed separately;
- Context length limits and the billing method for long contexts;
- Concurrency and rate limits;
- Discount conditions for cache hits and batch calls;
- The average number of iterations your task requires.
Each round of the visual closed loop requires passing images and context, meaning costs increase with the number of iterations. This must be factored into the budget.
Low costs primarily affect three types of scenarios:
- Developers: The cost barrier for multi-round iterations, batch code reviews, and long-context agent tasks is lowered.
- Enterprises: The model is reportedly open-source with a permissive license. The cost of private deployment needs to be calculated based on actual load, and specific license terms should be reviewed before use.
- Industry: As the capability gap between models narrows, the focus of competition may shift to engineering efficiency, computing power choices, and ecosystem development.
5. Boundaries to Note
Visual closed-loop programming is not a panacea. The model’s judgment of screenshots can still be wrong, especially for pixel-level details, dynamic interactions, and accessibility experiences. It is recommended to combine automated acceptance with manual sampling. Additionally, computing solutions, open-source licenses, and prices change rapidly, so check the latest official documentation before making a selection.
Conclusion
Native multimodality, sparse activation, low-cost inference, and visual feedback are key clues to understanding current LLM programming workflows. For developers, it is advisable to first experiment with visual closed loops in a small front-end task, recording iteration counts, costs, and failure reasons before deciding whether to scale to more scenarios.
