MoMo: A shared encoder Model for text, image and multi-Modal representations

Rakesh Chada, Zhaoheng Zheng, Pradeep NatarajanarXiv 2023

TL;DR

MoMo introduces a highly efficient, single-stream Transformer encoder that handles text, image, and multimodal tasks using a single unified set of weights. By employing a clever three-stage training pipeline and simultaneous gradient accumulation, MoMo outperforms larger architectures like FLAVA on macro-average benchmarks while using only 40% of the parameters and 33% of the training data.

What Problem Does This Paper Address?

State-of-the-art vision-language models typically rely on complex multi-encoder architectures—for instance, maintaining separate text and image encoders that feed into a third, joint multimodal encoder. While effective, these dual-stream models are computationally expensive, memory-intensive, and cumbersome to deploy in production pipelines.

Single-stream alternatives exist, but they traditionally struggle to perform well across all three domains (text-only, image-only, and multimodal) simultaneously. A common pitfall is that training a shared model independently on one modality often leads to "forgetting" or information loss in another. MoMo tackles this challenge by creating a compact, unified model that excels across all three task types without requiring modality-specific modules or experts.

Figure 2. Illustrations of how models process input data across various modalities. Language tasks: (a) Encoder-only architecture; (b) Encoder-decoder architecture. Vision tasks: (c) Convolutional Neural Networks; (d) Vision Transformers. Multimodal tasks: (e) Similarity-based metric; (f) Multimodal transformer with ConvNets; (g) Multimodal transformer with duo-transformers; (f) MoMo: Mul- tiple tasks across multiple modalities through an all-in-one unified transformer.

Methods

The authors implement three core strategies to achieve a high-performing, unified encoder:

  1. Unified Architecture: MoMo uses a single Transformer encoder (12 layers, 768 hidden dimension) for all tasks. Once text tokens and image patches are embedded into a shared latent space, they pass through the exact same transformer layers.
  2. Multi-Stage Training Pipeline: To carefully balance modality representations, training is broken into three sequential stages:
  3. Stage 1: Unimodal vision training using Masked Image Modeling (MIM).
  4. Stage 2: Joint training on unimodal text (Masked Language Modeling - MLM) and unimodal images (MIM).
  5. Stage 3: Joint training on unimodal text and multimodal image-text data using cross-modal masking, global contrastive, and image-text matching losses.
  6. Cross-Modality Gradient Accumulation (CMGA): To prevent information loss during joint training, MoMo samples from multiple datasets simultaneously during each training step. It accumulates gradients from both modalities before performing a single unified weight update.
  7. Efficiency via Masking: Following Masked Autoencoders (MAE), the encoder only processes the visible (unmasked) tokens or patches. This drastically shortens the input sequence length and accelerates training. Shallow, modality-specific decoders are used during pre-training to reconstruct the masked data but are discarded during downstream fine-tuning.
Figure 3. The architecture and training stages of MoMo. The model is first trained with unimodal image datasets. Then simultaneously with unimodal image and unimodal text datasets. And finally, simultaneously, with unimodal text and multimodal image-text datasets. Each stage is executed sequentially and is initialized from the previous stage model’s weights. For downstream task fine-tuning, the decoder is discarded and only the encoder weights are used.

Datasets

  • Pre-training Datasets:
  • Vision: ImageNet-1K (1M images)
  • Text: Wikipedia & Books Corpus (6.6M documents)
  • Multimodal: PMD-Subset (26.6M image-text pairs extracted from COCO, SBU Captions, Conceptual Captions, Visual Genome, and RedCaps).
  • Evaluation Benchmarks: The model was evaluated on the GLUE benchmark (for text), ImageNet linear probing (for vision), and VQAv2, COCO, and Flickr30K (for multimodal retrieval and classification).

Key Insights and Ideas

  • True Modality Agnosticism: Unlike models that use "modality-specific experts" (like VLMo), MoMo proves that the exact same transformer layers can successfully map and process text, pixels, and their combinations without specialized sub-networks.
  • The Necessity of Simultaneous Learning: The authors' ablation studies revealed that training on text alone causes vision performance to plummet (from 52.9% to 9.5% on ImageNet during Stage 2). Forcing the model to ingest both modalities simultaneously via CMGA is crucial to maintaining balanced representations.
  • Implicit Cross-Modal Grounding: High masking ratios (75%) in multimodal training force the model to look across modalities to reconstruct missing data. As a result, the model inherently learns to map text words to specific spatial regions in an image without explicit bounding-box supervision.
Figure 4. Attention maps on predicting masked words through MoMo at stage 3. Heatmaps are obtained through Transformer- MM-Explainability [11]. MoMo is able to capture meaningful re- gions for MLM through cross-modality attentions.

Key Results

  • State-of-the-Art Efficiency: MoMo (110M parameters) achieves a higher macro-average score (78.9%) across vision, language, and multimodal tasks than FLAVA (77.6% with 241M parameters) and CLIP (69.2% with 220M parameters).
  • Data & Parameter Savings: It achieves these results using only ~2/5ths of FLAVA's parameters and 1/3rd of its image-text training pairs (27M vs 70M).
  • Inference Speedup: The unified architecture yields up to a 35% speedup during inference on multimodal tasks like Visual Question Answering (VQA) because it eliminates multi-encoder pipeline overhead.
  • Scalability: Replacing the ViT-B backbone with a ViT-L (MoMo-Large, 335M parameters) brought massive gains, boosting VQAv2 by 3.8% and image-text retrieval by up to 8%.
Figure 1. Comparison with FLAVA [62] and CLIP [57]: MoMo achieves the best macro average across vision, language and mul- timodal benchmarks, which is the mean of the average of all 3 task types, with ≈2/5th the parameters and 1/3rd the training image- caption pairs.

Limitations and Future Work

Despite its strong average performance, the base MoMo model slightly lags behind FLAVA on specific tasks like VQAv2 and Flickr30K image retrieval. The authors hypothesize that this gap is primarily a data-scaling issue rather than an architectural limitation.

Moving forward, the team plans to scale MoMo to larger transformer backbones, pre-train on larger datasets to close the retrieval gaps, and extend the unified encoder framework to support additional modalities like audio and video.

Summary updated

BibTeX
@misc{chada2023momo,
  author = {Rakesh Chada and Zhaoheng Zheng and Pradeep Natarajan},
  title = {{MoMo: A shared encoder Model for text, image and multi-Modal representations}},
  year = {2023},
  eprint = {2304.05523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.05523},
}
Figure