                                    GMAIL: Generative Modality Alignment for generated Image Learning



         CLIP Flow:
                                                           Real                 Projection                            CLIPCap
          Inference on
                                                       Image Encoder            For Real                               (GPT)
           real images


                                          Image-text alignment



    “A plate of fruit is on the table.”                 Text Encoder   Gen-real alignment                  LLM         LLaVA



                                          Image-text alignment


   Gen-CLIP Flow:
                                                         Generated               Projection
         Training on                                                                                                  LLaMA-3
                                                       Image Encoder           For Generated
    generated images




Figure 1. Illustration of the proposed framework for vision-language tuning with Gen-Real alignment from diffusion models. We
propose a method that explicitly aligns a CLIP trained on real images with another CLIP model trained on generated images and then
leverages the aligned CLIP to train state-of-the-art vision-language models on generated images (i.e., Gen-CLIP Flow). For inference with
real images, the original CLIP is used to process real images, thereby avoiding discrepancies between real and generated modalities.

used for real images. During fine-tuning, we employ a                          3.3. Alignment with Vision-Language Models
cross-modality alignment loss to minimize the feature space
                                                                               Our alignment strategy is designed to enhance the integra-
discrepancy between generated and real images (see Eq. 1).
                                                                               tion of generated data into vision-language models, par-
This contrastive alignment loss encourages the model fg to
                                                                               ticularly large language models (LLMs) such as CLIP-
learn representations that place generated and real images
                                                                               Cap (Mokady et al., 2021), LLaVA (Liu et al., 2023), and
with the same descriptions close to each other in the latent
                                                                               Llama3 (Meta, 2024). This extension of GMAIL ensures
space, while maintaining their distinct modality-specific
                                                                               that generated images can be utilized effectively within these
characteristics. To maintain computational efficiency and
                                                                               models for tasks such as image captioning, retrieval, and
prevent catastrophic forgetting of real image representations,
                                                                               long-form question answering.
we apply Low-Rank Adaptation (LoRA) (Hu et al., 2022)
during fine-tuning. LoRA introduces lightweight, efficient                     Gen-Real Alignment. The key to our framework is the
updates to the model, ensuring that the alignment process                      cross-modality alignment loss, which ensures that generated
does not degrade the model’s ability to generalize across                      images are embedded within the same latent space as real
different data modalities.                                                     images, while maintaining their distinct characteristics. The
                                                                               alignment loss is formulated as:
CLIP Flow: Inference on Real Images. In the inference
phase with real images, the model fg fine-tuned on gen-                                          1        X
erated images in the Gen-CLIP flow can be deployed to                              Lalign = −
                                                                                                |B|
process real images through the original image encoder of                                             (xg ,xr )∈B

fr without further fine-tuning. By keeping the pre-trained                                           exp(sim(fg (xg ), fr (xr ))/τ )
                                                                                             log P                                       ,   (1)
CLIP model for real images unchanged during the generated                                        x′r ∈B exp(sim(fg (xg ), fr (x′r ))/τ )
image training process, we ensure that the learned repre-
sentations from the generated data remain aligned with real                    where xg and xr represent generated and real images, fg and
data. The CLIP flow leverages these aligned representations                    fr are their corresponding image representations, sim(·, ·)
for inference on real images, allowing the model to gen-                       denotes cosine similarity between embeddings, and τ is
eralize well to real-world data without suffering from the                     a temperature parameter. This loss encourages generated
typical mode collapse associated with over-reliance on gen-                    images to be aligned with their real counterparts, facilitating
erated content. This dual-model structure allows the model                     effective transfer of knowledge across both modalities.
to benefit from the complementary strengths of both real
                                                                               CLIPCap (Mokady et al., 2021) combines CLIP’s image
and generated images, ensuring that it performs robustly
                                                                               embeddings with a transformer-based language model to
during real-world deployment while still benefiting from the
                                                                               generate captions from images. By aligning generated im-
scalability of generated training data. Note that the encoder
                                                                               ages with real image embeddings, we ensure that CLIPCap
fine-tuned with the LoRA and the projection for real is used
                                                                               can generate high-quality captions from both real and gener-
on real images during inference time.
                                                                               ated data. Fine-tuning CLIPCap with our alignment frame-

                                                                           4
