Text Rendering in Multimodal Image Generation: Training on Domestic AI Chips
Text accuracy has become a key benchmark that separates production-grade multimodal image generators from demo-level ones. This article examines why text rendering is difficult, the compute-engineering challenges of training these models from scratch on domestic heterogeneous AI accelerators, and how to quantitatively evaluate visual text quality. It covers operator and framework adaptation, distributed parallelism, mixed precision and numerical stability, observability, a divergence-troubleshooting checklist, and common failure modes such as missing or garbled characters. It also compares metrics like Word Accuracy, CER, WER, BLEU, and NED, and offers practical engineering guidance for text-heavy applications such as posters, packaging, and e-commerce imagery.
1. Background: Why Text Is Becoming a Serious Test for Multimodal Image Generation
In recent years, diffusion-based multimodal image generation has advanced rapidly in image quality and semantic consistency. The field is now shifting from competing on visual fidelity to competing on text accuracy. Whether text quality can be measured objectively, and whether training can be completed on domestic heterogeneous compute, are the two hurdles to clear before text-heavy applications can scale.
Yet a long-standing industry pain point has come into focus: whenever a generated image needs to contain text—a poster headline, a shop sign, packaging copy, dialogue in an illustration—models tend to produce merged strokes, misaligned characters, and garbled meaning. For scripts dominated by Latin letters the problem is tolerable; but for a dense, structurally complex writing system like Chinese characters, the challenge is magnified many times over.
A model that can “read an image, draw an image, and get the text right” is an important marker of how mature multimodal generation has become. Building a complete understanding of text-rendering capability, the engineering challenges of training on domestic heterogeneous compute, and quantifiable evaluation methods is therefore essential.
2. Text Rendering in Multimodal Image Generation: From “Being Able to Draw” to “Drawing It Right”
Traditional image generation models optimize for pixel-level visual realism, and text was often treated as ordinary texture in the early days. But text is fundamentally a discrete symbol sequence governed by strict grammatical and glyph constraints, which sets it apart from natural textures:
- High structural complexity: Chinese characters have radicals, stroke order, and overall structure; a single wrong stroke can change the meaning or even turn a character into a non-word.
- Strong semantic coupling: Text content must stay consistent with the image semantics—poster theme, scene context, product information—which requires the model to combine visual understanding with language modeling.
- Low error tolerance in evaluation: A slightly off color in an illustration is harmless, but one wrong character can severely reduce the usability of the whole image.
For these reasons, text-rendering ability is becoming the key divide between “demo-level” and “production-level” image generation models. A production-grade model must not only render legible text, but also ensure that characters, words, sentences, and layout relationships remain usable.
3. Training Multimodal Image Generation on Domestic Chips: The Compute Engineering Behind Text Rendering
In the past, training very large multimodal models relied heavily on specific acceleration hardware and mature software ecosystems. To train from scratch on domestic chips and other heterogeneous compute platforms, teams must clear several key hurdles.
Operator and Framework Adaptation
Mainstream training depends on a large number of operators and composite structures, such as attention, normalization, and convolution. On heterogeneous chips, these operators must be implemented one by one, with numerical-precision alignment to keep results within an acceptable error range versus the reference implementation; otherwise training may diverge or fail to converge. In practice, align the forward pass first, then the backward pass: compare layer by layer the maximum absolute error of forward activations and backward gradients, and locate the first operator that exceeds the threshold.
Distributed Parallelism and Communication Optimization
Large-model training relies on combining strategies such as data parallelism, tensor parallelism, and pipeline parallelism. Different hardware has different interconnect bandwidth and collective-communication implementations. When communication becomes the throughput bottleneck, first assess the bottleneck from communication ratio and bandwidth utilization, then redesign the parallelism partitioning scheme and communication-overlap strategy.
Mixed Precision and Numerical Stability
To balance speed against memory usage, training commonly uses mixed precision. But different chips support floating-point formats to varying degrees, so a balance must be struck among precision, performance, and stability. If loss scaling or gradient clipping is not enough to eliminate numerical anomalies, check for overflow, rounding modes, and scaling factors of key layers.
Software Stack and Observability
Mature long-running training depends on thorough logging, metrics collection, and fault-recovery mechanisms. On a relatively new hardware ecosystem, it is even more important to build out engineering capabilities such as training monitoring, checkpoint resume, and anomaly localization. At a minimum, collect throughput, loss, gradient norm, device temperature and throttling, and slow-node metrics to stay stable during long training runs.
When training goes wrong, do not simply conclude that “training is hard to converge.” Focus instead on observable signals: loss suddenly becoming NaN or Inf, gradient norm persistently spiking, and abnormal growth in per-layer activation magnitude. Localization actions can include comparing forward activations and backward gradients layer by layer against the reference implementation to find the first operator that exceeds the threshold.
Quick Troubleshooting Checklist for Training Divergence
- Get the full training pipeline running on a small model with a small dataset.
- Align forward results and confirm activation magnitudes in key layers are reasonable.
- Align backward gradients and confirm the gradient norm is within a reasonable range.
- Check overflow and rounding modes to avoid numerical runaway under mixed precision.
- Locate the first diverging layer and its corresponding operator.
- Roll back or switch the numerical format based on the findings.
- Enable checkpoint-resume protection to reduce losses from long training runs.
- Re-test and then gradually scale up model and data size.
Adaptation conclusions vary by chip model, driver version, and software stack version.
Common Pitfalls: Why Do Generated Characters Go Missing or Run Together?
Problem: Generated images show missing characters, merged strokes, characters running together, or garbled meaning. Causes: The model treats text as texture, character-structure constraints are insufficient, training-data coverage is inadequate, or resolution and layout context are lacking. Fixes: Add Chinese and English data plus long- and short-text data, strengthen glyph-to-text alignment supervision, use OCR read-back verification, and regenerate or fall back on failed samples.
4. Scientific Evaluation of Multimodal Image Generation: Quantifying Visual Text Quality
“How accurately is the text rendered” needs quantifiable, reproducible metrics rather than subjective impressions. The industry typically uses metrics such as text accuracy and normalized edit distance, but you must first unify the measurement conventions: the OCR recognizer version and language model, whether Chinese is split by character or by word, and whether spaces and punctuation are removed—all of these affect results.
| Metric | Meaning | Calculation | Direction | Strengths | Limitations |
|---|---|---|---|---|---|
| Word Accuracy | Match ratio between recognized and target text | Correctly recognized units / target units | Higher is better | Intuitive and easy to understand | Depends on OCR and tokenization conventions |
| CER | Character error rate | Character edit operations / reference characters | Lower is better | Suited to character-based text like Chinese | Insensitive to word order and layout |
| WER | Word error rate | Word edit operations / reference words | Lower is better | Suited to English or tokenized text | Heavily affected by Chinese word-segmentation conventions |
| BLEU | n-gram overlap | Based on n-gram precision with weighting | Higher is better | Measures local fragment overlap | Insensitive to glyph errors and Chinese characters |
| NED | Normalized edit distance similarity | 1 − edit distance / max(recognized length, target length) | Higher is better | Comprehensively reflects character-level differences | Requires stated conventions to avoid confusion with the distance direction |
Word Accuracy
Using OCR output as the basis, recognition errors affect both accuracy and NED. It answers “what proportion of the generated text matches the target,” but only after the OCR model, language tokenization, and punctuation-handling rules are clearly defined.
Normalized Edit Distance (NED)
NED = 1 − EditDistance(recognized text, target text) / max(len(recognized text), len(target text)).
Under this convention, 1 means a perfect match and 0 means no match; for Chinese it is counted by character. This must be distinguished from the normalized edit distance (a distance measure) where smaller is better. If a report says “higher NED is better,” the similarity convention above should be used; if the distance convention is used, it should state that lower values are better.
The Peculiarity of Long-Text Rendering
When an image must hold a passage of text, the model has to handle text layout, row-and-column alignment, and contextual consistency at the same time. The difficulty of long text comes mainly from single-character errors accumulating as the character count grows, and from the structural complexity introduced by layout planning and line-break alignment. For evaluation, report metrics in layers: tally short and long text separately, and Chinese and English separately, then weight them by business priority—so that a single aggregate score does not mask scenario differences.
How to Choose Metrics for Chinese, English, and Long-Text Scenarios?
Problem: Metric choices differ for Chinese vs. English and short vs. long text. Causes: Chinese is counted by character while English is counted by word or character; long text is more concerned with cumulative errors and layout. Fixes: For Chinese, prioritize character-level CER or character-level Word Accuracy; for English, combine WER and BLEU; for long text, add layered statistics and manual spot checks on top of character-level metrics.
5. From Technology to Deployment: Engineering Points for Text-Heavy Applications
Better text-rendering ability directly unlocks a set of applications that were previously hard to automate:
- AI hand-copied reports and knowledge cards: Automatically lay out structured knowledge points with illustrations into illustrated, text-and-image reports.
- Marketing posters and illustrations: Automatically produce finished visual assets with accurate headlines, slogans, and body copy.
- E-commerce and packaging design: Overlay accurate specifications, prices, and descriptive text onto product images.
In these scenarios, model output cannot rely on subjective preview alone. Establish engineering practices directly tied to text rendering: first use OCR read-back to automatically verify the generated image; when verification fails, trigger a retry or regeneration; set character-count and font-size limits per scenario to avoid layout overflow; and before batch generation, run a small-sample spot check and record failure types.
At the same time, brand names, trademarks, prices, and specifications in posters, packaging, and e-commerce imagery must be checked for accuracy and factual consistency after generation; commercial fonts must be properly licensed; content must comply with advertising and labeling regulations; and human or rule-based review is recommended before publishing.
6. Summary
The competitive focus of image generation is shifting from “how good the picture looks” to “whether the text is correct.” For text rendering in multimodal image generation to truly cross this divide, models need deep integration of visual understanding and language modeling, and teams need to complete a full engineering effort on domestic heterogeneous compute—operator adaptation, distributed training, and precision tuning. Combined with a quantitative evaluation system centered on text accuracy and NED, along with review and read-back verification in real business contexts, only when numerical consistency, parallel efficiency, and the evaluation loop are all satisfied can a “text-capable image generation model” move from a demo to sustainable, scalable production practice.
