Multimodal Large Model Training: Methods, Data, Staged Optimization, and Evaluation
Training multimodal large models is not simply about injecting visual features into a language model. This article outlines a reproducible engineering workflow covering task unification, model architecture, data composition, staged training, loss design, evaluation, common failure modes, and production deployment considerations. The goal is to show how data mix, visual token budgets, positional encoding, and staged optimization can be made consistent so that a generative backbone can understand images, video, and text within one parameter set and one decoding pipeline.
Multimodal Large Model Training: Methods, Data, Staged Optimization, and Evaluation
The goal of a multimodal large model is to let one generative backbone understand images, video, and text within the same set of parameters and the same decoding pipeline, and then perform tasks such as captioning, question answering, localization, and reasoning. Training is not equivalent to “simply concatenating visual features into a language model.” It is a reproducible loop of data, alignment, optimization, and evaluation. The following sections describe common engineering practices without tying the discussion to a specific product, with emphasis on transferable methods.
1. Unify Tasks Before Designing the Model
Mainstream approaches converge multimodal tasks into conditional generation as much as possible: given a text instruction and one or more visual inputs, the model autoregressively predicts subsequent tokens. Capabilities such as retrieval, classification, and segmentation are often expressed through instruction templates, special tokens, or lightweight external heads rather than training a completely different system for every task. The benefit is a unified loss function, mixed training data, and a unified inference path.
A typical architecture has three parts.
- Visual encoding: Convert images or video frames into spatial feature sequences. The encoder needs to capture both local texture and global semantics. A common choice is a hierarchical visual backbone that preserves features at different scales.
- Cross-modal alignment module: Compress or resample visual sequences of variable length and resolution into tokens that the language model can consume. The alignment module can be a cross-attention resampler or a lighter linear or perceptual projection layer. The value of resampling is to control the number of visual tokens and prevent high resolution from directly blowing up the context.
- Language backbone: Responsible for reasoning and generation. The backbone can be a dense model or a mixture-of-experts (MoE) structure. MoE mainly reduces the number of activated parameters; it does not automatically guarantee multimodal performance. Whether visual information is stably injected remains a key issue.
Positional information must express both text order and the two-dimensional structure of images, or the three-dimensional structure of video. In practice, methods such as rotary position embedding are extended into multidimensional positions so that the same attention mechanism can handle long text, distinguish row-column relationships between image patches, and represent temporal order in video. If positional encoding is flattened only along one dimension, the model can easily lose spatial adjacency relationships.
2. Data Determines the Upper Bound
Training data is usually organized into three layers rather than a single “image-text pair” dataset.
- Large-scale weakly supervised image-text data: Drawn from public webpages, image-library captions, document screenshots, and similar sources, this data is used to establish coarse alignment. It is noisy and requires deduplication, language filtering, image-text relevance scoring, and sensitive-content filtering.
- Interleaved image-text and documents: A passage of text with multiple images, tables, or page screenshots inserted. This type of data trains the model to “look at which image and cite which text span,” which is more important for multi-image question answering and document understanding.
- High-quality instruction and preference data: Question-answer pairs, reasoning steps, refusal samples, and correction samples constructed manually or with model assistance. This data turns “being able to align” into “following instructions and answering in a well-formed way.”
Video data requires separate handling of the temporal dimension. Frame sampling cannot be too sparse, or motion is lost; it also cannot be too dense, or token and storage costs increase sharply. A common strategy is keyframes plus uniform sampling, using timestamps or frame indices as positional signals. Long-video understanding depends on memory mechanisms: sliding windows, streaming memory, or hierarchical summarization compress previously viewed clips into a revisitable state instead of indefinitely stacking raw frames.
Sampling ratios are more critical than “the more data, the better.” If the ratio between continued text pretraining samples and multimodal samples is imbalanced, two types of degradation can occur: pure-text capability is washed out, or visual question answering only recites image captions without reasoning. In engineering, data should be bucketed by task type, and the ratio should be adjusted dynamically based on loss curves and validation sets rather than hard-coded once.
3. Staged Training Is More Stable
3.1 Alignment Pretraining
At this stage, the language backbone is usually frozen or updated with a small learning rate, while the visual encoder and alignment module are trained to place visual tokens into the representation space already learned by the language model. The objective is often next-token prediction: image tokens and text are concatenated into one sequence, and cross-entropy is computed only at text positions. Retrieval-style contrastive loss is sometimes used as an auxiliary objective to pull matching image-text pairs closer and push mismatched pairs apart, but the main generative objective is more conducive to later instruction following.
The resolution strategy should be decided at this stage. Fixed resolution is simple to implement, but small text in documents and fine-grained objects can become blurred. Dynamic resolution crops or buckets images according to aspect ratio, then feeds multi-scale features into the alignment module, trading off compute and detail. Regardless of the scheme, the bucketing rules used in training and inference must be consistent; otherwise, positional encoding and visual token length will mismatch.
3.2 Joint Pretraining or Continued Training
After alignment stabilizes, more parameters are unfrozen, and the model is trained on a mixture of interleaved image-text data, multi-image data, short video, and pure text. The learning rate is usually lower than during language pretraining, with gradient clipping, mixed precision, and activation checkpointing. Visual tokens can be sampled dynamically: simple backgrounds retain fewer tokens, while text-dense or object-dense regions retain more, to control sequence length.
At this stage, two types of metrics should be monitored: whether language benchmarks regress noticeably, and whether multimodal validation sets for captioning, document question answering, and multi-image reasoning improve in tandem. A decline in training loss alone is not enough, because the model may learn to ignore images and guess answers only from question text.
3.3 Instruction Fine-Tuning
Diverse instructions expose model capabilities: visual question answering, comparing two images, describing a region, answering from a video clip, and outputting in a specified format. Instructions should cover negation, counting, spatial relationships, and “information not present in the image”; otherwise, the model will habitually hallucinate. System prompts and user content should be distinguished in the template so the model does not treat the instruction itself as the scene to describe.
3.4 Preference Optimization and Inference-Time Enhancement
When paired good and bad responses are available, preference optimization can directly increase the relative probability of preferred responses rather than relying only on the single standard answer used in supervised fine-tuning. Preference data should include factuality, refusal behavior, safety boundaries, and format adherence, not just “better prose.” At test time, multi-candidate generation, self-consistency, or finer visual cropping can be used for enhancement. These are inference strategies and cannot replace alignment during training.
If dense prediction tasks such as segmentation and detection are to be integrated into the same system, the usual approach is to add task tokens and mask decoding, or attach dedicated heads to visual features. Streaming memory is suitable for interactive video: after a user clicks or draws a box, the model combines the current frame with historical memory to update the result. Such heads and the generative backbone can be trained in stages: first ensure semantic alignment, then train pixel-level output.
4. Loss, Evaluation, and Common Failures
The main generative loss is token-level cross-entropy. Visual positions generally do not receive a “predict image token” loss unless image generation is also being performed. Contrastive loss and region-token loss are auxiliary only, and their weights should not overpower the main loss.
Evaluation should be broken down rather than summarized by a single score:
- Image-text matching and captioning: Whether alignment has been established.
- Documents and small text: Whether dynamic resolution is effective.
- Multi-image and long video: Whether citation and memory are correct.
- Hallucination and refusal: Whether the model fabricates objects that do not exist in the image.
- Pure-text capability: Confirming that multimodal training has not damaged the language foundation.
Common failures and countermeasures are as follows.
- Ignoring the image: Improve image-text relevance filtering and check in the loss whether accuracy drops significantly when the image is removed.
- Resolution collapse: Use the same bucketing for training and validation; assign separate weighting to document-style data.
- Context explosion: Use resampling or a dynamic visual token cap; for long video, switch to segmented summaries and then aggregate.
- Language regression: Preserve a sufficient pure-text ratio and apply early stopping on language validation sets.
- Hallucination: Add negative samples of the “not present in the image” type and use preference data to penalize unsupported details.
5. Engineering Deployment Considerations
On a training cluster, visual encoding is often the throughput bottleneck. Image decoding, frame extraction, and augmentation should be completed asynchronously in the data pipeline, while GPUs consume only packed features or pixel tensors. Checkpoints should save the visual encoder, alignment module, and language backbone together; restoring only language weights can cause alignment to fail.
Logs and experiment management should record data mix, resolution buckets, visual token cap, freezing strategy, learning rate, and sequence length distribution. These factors often have a greater impact on results than swapping in a nominally “new architecture.” Object storage is suitable for raw media and packed training samples, container platforms are suitable for launching multi-machine training, and monitoring and alerting should watch for loss spikes, data-read gaps, and validation regression. When implementing in a cloud environment such as Baidu AI Cloud, data versioning, permission isolation, and training job auditing should be included in the same process to avoid irreproducible “manual dataset copying.”
A schematic single-step training loop can be summarized as follows:
batch = sample(text, images_or_frames, instruction, answer)vision = encode(batch.media, resolution_bucket)v_tokens = resample(vision, max_visual_tokens)seq = concat(instruction, v_tokens, answer)loss = cross_entropy(predict(seq), answer_positions_only)loss.backward()
This pseudocode emphasizes three points: visual tokens have a cap, loss is applied only at answer positions, and resolution bucketing is determined before encoding. A real implementation must also add padding masks, multi-image boundary markers, and distributed gradient synchronization.
6. How to Judge Whether Training Was Done Correctly
A usable multimodal model should simultaneously satisfy the following: it can indicate which image or which video segment an answer came from; its answer changes reasonably when the image is occluded or replaced; it proactively denies content that is not present in the image; and memory usage and latency for long documents and long videos remain within budget. The core of the training method is not stacking more modules, but making data mix, visual token budget, positional encoding, and staged optimization consistent with one another. First stabilize alignment, then unfreeze for joint training, and finally constrain behavior clearly with instructions and preferences. This is currently a more reliable path and one that makes problems easier to diagnose.
