Training Multimodal Models on a Full Domestic AI Stack: Architecture and Engineering Practices
This article examines what it means to train a state-of-the-art multimodal image generation model entirely on domestic chips and a domestic deep learning framework. It breaks down the dual-engine planner-plus-renderer architecture used for controllable text rendering, explains why Chinese text generation is difficult across glyph, semantic, layout, and style layers, and covers evaluation metrics, instruction-based image editing, cost and capacity planning, and a four-step path from pilot to production. Readers will find practical guidance on evaluation baselines, layered architecture design, and transferable cost models.
1. Technical Background: Why a Full Domestic Training Stack Matters
The capability ceiling of multimodal image generation models has long been constrained by three things: compute availability, the maturity of training frameworks, and the completeness of data and evaluation systems. Frontier model training has been concentrated on a small number of hardware and framework combinations, which creates two practical problems. First, compute availability is exposed to external supply fluctuations. Second, when frameworks are tightly coupled to hardware, experience with low-level operator optimization and communication library tuning becomes hard to transfer.
The significance of the first SOTA multimodal model trained end to end on domestic chips and a domestic deep learning framework is not a single benchmark score. It validates a closed-loop path: data cleaning and mixing ratios, distributed parallelism strategies, operator adaptation and graph optimization, mixed precision and memory management, evaluation and alignment can all be completed within one software and hardware stack, without relying on cross-stack patches. For engineering teams, this means reproducibility: the same methodology can be carried over to fine-tuning and inference deployment for their own workloads.
The engineering value of a full domestic stack comes mainly from three points:
- Supply stability: Compute and framework release cadence is controllable, so long training runs are less likely to be interrupted by external changes.
- Short optimization loop: The framework layer and the hardware layer evolve within one system, which shortens the path to diagnosing missing operators or precision anomalies.
- Predictable cost structure: Once resources are pooled, per-unit training and inference costs are easier to plan for capacity.
2. Architecture Breakdown: Why Dual Engines Suit Text Rendering
The core design described in the source material is a dual-engine structure of “understanding and planning” plus “detail rendering”: an autoregressive model handles semantic parsing and layout planning, a diffusion decoder handles pixel-level rendering, and a dedicated text module handles glyphs. Abstracted into a general engineering pattern, this is a division of labor between a Planner and a Renderer.
The split works because the two task types differ fundamentally:
- Semantics and layout are discrete and strongly constrained. Instruction parsing, element counting, hierarchy, and whitespace ratios are structured decisions, and autoregressive modeling is a more natural fit for long-context reasoning and constraint following.
- Pixels and textures are continuous and high-dimensional. Color transitions, material reflections, and stroke edges require iterative denoising, which diffusion decoding handles better.
If a single model takes on both jobs, the common outcome is either sacrificing visual quality to keep text correct, or breaking text structure to improve image quality. The dual-engine design decouples “writing the right characters” from “making it look good”: the planner outputs structured layout and text content, the renderer generates pixels only inside designated regions, and the text module applies dedicated constraints to glyph shape, letter spacing, and line height.
A schematic interface abstraction (not a specific product API, only to express the layering):
# Pseudocode: layered planner-renderer callplan = planner.parse(prompt) # Output: element list, bounding boxes, text content, style tagscanvas = renderer.init_canvas(plan.size)for region in plan.regions:if region.type == "text":canvas.draw_text(region.box, region.content, font=region.font_spec)else:canvas.blit(renderer.render(region)) # Diffusion decoding handles image regions onlyimage = postprocess(canvas, upscale=plan.scale)
Three engineering details matter here. First, feathering region mask boundaries to avoid hard seams where text meets the background. Second, an independent redraw channel for the text layer, so a misspelled character can be fixed without rerunning the whole image. Third, layout consistency checks before rendering, using rules or a lightweight model to detect overlapping or out-of-bounds elements.
3. Chinese Text Rendering: Where the Difficulty Lies and How to Evaluate It
Garbled text in AI-generated images is not a single problem. It splits into four layers:
- Glyph layer: Chinese characters have many strokes and vary widely in density, so they easily blur into an unreadable mass at low-frequency detail.
- Semantic layer: The text content must match the instruction, with no homophone substitutions or dropped characters.
- Layout layer: Font size, line spacing, alignment, and line breaks must stay readable, and long text tends to overflow.
- Style layer: The font’s character must match the overall design language; the choice between handwriting-style and serif or sans-serif faces directly affects the result.
Evaluation should cover multiple dimensions rather than just “does it look right.” A general metric set includes text accuracy (character-level edit distance), region localization accuracy (IoU between predicted and ground-truth boxes), long-text completeness, and human-rated layout aesthetics. Public leaderboard rankings are only a reference; teams should build their own small regression set covering real edge cases such as mixed Chinese and English text, numbers with units, and very long headlines.
A practical way to organize regression tests:
{"case_id": "poster_cn_long_title","prompt": "Generate a Chinese promotional poster with a 12-character main title and a subtitle of no more than 20 characters","checks": ["char_accuracy", "box_iou", "no_overflow", "style_consistency"],"threshold": {"char_accuracy": 0.95, "box_iou": 0.7}}
4. Instruction Understanding and Image Editing: Turning Intent into Verifiable Execution
Image editing tolerates less ambiguity in instruction understanding, because users often give relative descriptions such as “change the background to a night scene but keep the subject’s outline” or “make the second line of text one size smaller.” Evaluation should focus on three capabilities:
- Reference and counting: Correctly resolving “the second one” or “the one in the top-left corner.”
- Constraint preservation: Whether non-target regions are changed unintentionally, which can be quantified with before-and-after difference maps.
- Multi-turn consistency: Whether style drifts across consecutive edits.
The engineering recommendation is to build the editing flow as a rollbackable operator chain, keeping intermediate artifacts and parameter snapshots at each step so it is easy to identify which step introduced a deviation. Also surface uncertainty explicitly to users, for example by returning confidence scores or candidate options instead of a single result.
5. Cost and Capacity: Calculate the Total Bill
Unit price is only part of the cost. Real cost = call price × retry rate + post-processing compute + manual rework hours + storage and bandwidth. Models with strong text rendering can significantly reduce retry rates and manual character-fixing effort, and those gains are amplified in batch commercial use such as posters, covers, and bulk creative assets.
For capacity planning, separate offline batch and online real-time pipelines. Batch workloads can use queues to smooth peaks and off-peak scheduling to maximize throughput. The online path must control per-request latency, and when necessary it can generate image regions at lower resolution and then upscale. Reusable general cloud components include object storage for assets and outputs, a message queue for task decoupling, a container platform for elastic scaling, and logging plus monitoring and alerting for quality and latency observation.
6. Implementation Advice: Four Steps from Pilot to Scale
- Slice the scenario: Start with a pilot in text-heavy, low-tolerance scenarios, where the payoff is most visible.
- Establish an evaluation baseline: Fix metrics with your own regression set and run it after any model or prompt change.
- Adopt a layered architecture: Make planning, rendering, and post-processing replaceable modules to avoid tight coupling to a single model.
- Close the operational loop: Feed online failure samples back into training and evaluation data for continuous improvement.
Overall, a full domestic compute stack supporting frontier multimodal training signals that the underlying capability is ready for production-grade exploration, and the planner-renderer division of the dual-engine design offers a clear engineering path to controllable text generation. For developers, what really needs to be mastered is not the usage of any single model, but three transferable pieces of infrastructure: the evaluation system, the layered architecture, and the cost model.
