Training SOTA Multimodal Models on Domestic AI Chips: A Technical Breakdown
This article examines how a SOTA multimodal generation model was trained on domestic AI chips, focusing on the engineering practices that make large-scale training viable. It explains why text rendering in generated images has been a persistent weakness, then walks through software-hardware co-design points such as operator coverage, mixed precision, parallelism, and fault tolerance. It also covers glyph-level representation, layout priors, data construction, and a readback quality gate for accurate text rendering, along with evaluation metrics, cost optimization techniques, and selection guidance for common use cases.
1. Background: Why Multimodal Generation Keeps Failing at Text
Over the past two years, image generation models have improved substantially in composition, lighting, and material rendering. Rendering text inside an image, however, remains a clear weak spot. The industry generally attributes this to three factors.
First, semantic alignment between the text encoder and the visual generator is insufficient. The text side does not model glyph structure, stroke order, or component combinations at a fine enough granularity, so the generation side can only approximate a texture that looks like a character.
Second, the training data distribution is imbalanced. High-quality image-text samples with precise text annotations make up a small share, and samples with long text, multi-line layouts, or mixed Chinese-English content are even scarcer. As a result, models handle short titles reasonably well but degrade quickly on long paragraphs.
Third, evaluation criteria are inconsistent. Many works report only overall aesthetics or CLIP similarity, with no fine-grained measure of whether the characters are actually correct, so the problem is hidden by average scores.
A genuinely usable multimodal generation approach must therefore address four issues at once: training compute supply, data mix, evaluation methodology, and inference cost. Tuning hyperparameters alone is not enough.
2. Software-Hardware Co-Design: Key Engineering Points for Large-Scale Training on Domestic Chips
Training a SOTA multimodal model on domestic chips is fundamentally a software-hardware co-design problem. The reusable lessons cluster around the following points.
1) Operator coverage and graph compilation. Multimodal training involves many heterogeneous operators, including convolution, attention, variational inference, and diffusion sampling. Any missing operator falls back to a generic execution path and causes a sharp performance drop. The practical first step is to audit operator coverage, fill in high-frequency operators, and apply fusion optimizations.
2) Mixed precision and numerical stability. Diffusion models are sensitive to numerical range, so a balance between compute efficiency and stability is required. A common practice is to keep higher precision in key normalization layers and in loss computation.
3) Combining parallelism strategies. Data parallelism, tensor parallelism, and pipeline parallelism must be re-tuned against memory bandwidth and interconnect topology. Overlapping communication with computation is the deciding factor for throughput.
4) Fault tolerance and checkpoint resume. Node failures are inevitable in large clusters, so the training framework needs minute-level recovery to avoid repeatedly rolling back long-running jobs.
Illustrative training startup logic (pseudocode, structure only):
# Illustrates how parallelism and precision settings are organized; not a platform-specific APIconfig = {"parallel": {"dp": 64, "tp": 8, "pp": 2},"precision": {"compute": "bf16", "norm_and_loss": "fp32"},"checkpoint": {"interval_steps": 500, "async_save": True},"fault_tolerance": {"max_retry": 3, "resume_from_latest": True},}for step, batch in enumerate(dataloader):with autocast(compute_dtype=config["precision"]["compute"]):loss = model(batch)loss.backward()optimizer.step()if step % config["checkpoint"]["interval_steps"] == 0:async_save(model, optimizer, step)
3. Capability Breakdown: Why Text Rendering Can Be Correct
Stable, correct Chinese characters in an image usually require effort in four areas at the same time.
- Glyph-level representation: model characters down to the stroke and component level to reduce confusion between similar-looking characters.
- Layout prior injection: explicitly model line width, letter spacing, alignment, and hierarchy so text does not blur into a single mass.
- Data construction: build samples with precise text ground truth, covering difficult cases such as multiple lines, long paragraphs, mixed Chinese-English content, and stylized text.
- Post-generation verification loop: run recognition readback on the text region after generation and trigger resampling on mismatch, forming a quality gate.
In engineering terms, this loop can be abstracted as a quality gate function:
def render_with_gate(prompt, max_retry=3, min_accuracy=0.90):for _ in range(max_retry):image = generate(prompt)acc = readback_accuracy(image) # recognition readback accuracy on the text regionif acc >= min_accuracy:return image, accreturn image, acc # return the best result and log the metric
4. Evaluation: Measuring Complex Visual Text Generation
Two evaluation dimensions can be abstracted into two metric sets commonly used in the field, which readers can implement themselves.
The first is complex visual text generation evaluation, whose core metrics are Word Accuracy and Normalized Edit Distance (NED). Word Accuracy measures the proportion of correctly rendered characters, while NED measures the overall difference between the predicted string and the target string. Strong results on both indicate the model is “both correct and not garbled.”
The second is long-text rendering evaluation, which needs to be reported separately for Chinese and English with an average score. The focus is stability across multiple lines and large blocks of text, since long text is where errors accumulate most severely.
Suggested evaluation record structure:
{"benchmark": "complex_visual_text","metrics": {"word_accuracy": 0.0, "ned": 0.0},"long_text": {"zh": 0.0, "en": 0.0, "avg": 0.0},"resolution_range": "1024x1024 ~ 2048x2048"}
In practice, manual spot checks and failure attribution should be added so a single metric is not inflated by easy samples.
5. Cost Engineering: Common Ways to Push Per-Image Cost Very Low
Very low per-image cost is not a single trick but the result of four things stacking up: operator fusion and batching in inference to raise throughput; tiered scheduling of resolution and sampling steps, so simple requests take a lightweight path; caching and deduplication to reuse results for frequent similar requests; and elastic scaling that automatically expands and shrinks container instances based on queue length, combined with object storage for artifacts plus logging, monitoring, and alerting for full-pipeline observability. To serve external users, quotas and rate limiting can be applied at the gateway layer to protect stability.
6. Typical Use Cases and Selection Guidance
- Social media covers: emphasize prominent titles blended with people and scenes; prioritize word accuracy and layout stability.
- Commercial posters and ad creatives: emphasize artistic quality and brand tone; require arbitrary aspect ratio output and high resolution.
- Teaching and explainer diagrams: emphasize information hierarchy and long-text correctness; mixed Chinese-English content needs particular validation.
- Large-scale production: emphasize per-image cost and concurrency; evaluate elastic scaling and cache hit rate.
For selection, score in the order of word accuracy, long-text stability, resolution and aspect ratio coverage, per-image cost, and engineering observability, to avoid being misled by visual appeal alone. In model service deployment, Baidu AI Cloud typically builds support around general capabilities such as compute scheduling, elastic scaling, and full-pipeline observability, an approach that applies to any multimodal generation service.
7. Conclusion
The significance of domestic chips supporting a SOTA multimodal model goes beyond a single leaderboard result: it validates that the full path of compute self-reliance, data engineering, evaluation loops, and cost optimization is workable. For developers, the reusable part is the methodology: define evaluation criteria clearly first, then make training and inference stability solid, and finally use scheduling and caching to drive cost down.
