Command Palette
Search for a command to run...
I0T: モダリティギャップをゼロにする埋め込み標準化手法
I0T: モダリティギャップをゼロにする埋め込み標準化手法
Na Min An Eunki Kim James Thorne Hyunjung Shim
概要
対照言語-画像事前学習(CLIP)は、画像-テキスト検索や分類などの下流タスクにおけるゼロショット推論を可能にする。しかし、近年CLIPを拡張する研究では、画像とテキストの埋め込みがそれぞれ異なる多様体に射影されることで生じる「モダリティギャップ」の問題が指摘されている。これは画像-テキスト対照学習の本来の目的から逸脱するものである。本研究では、この現象が画像エンコーダとテキストエンコーダがそれぞれ独立に持つモダリティ固有の特性に起因していることを明らかにした。このモダリティギャップに対処するため、2つの手法を提案する:(1)モダリティギャップをほぼゼロに低減する事後埋め込み標準化手法 I0T_post、(2)各エンコーダに2つの正規化層を追加することでモダリティギャップ問題を軽減する学習可能な手法 I0T。提案するI0Tフレームワークは、パラメータが固定された学習済みモデルの元の埋め込み表現を保持しつつ、モダリティギャップを大幅に低減できる。実用的には、I0T_postは広く利用されているCLIPScore(CLIP-S)に代わる説明可能な自動評価指標として機能しうる。コードは https://github.com/xfactlab/I0T で公開されている。
One-sentence Summary
KAIST AI proposes I0T, which identifies modality-specific encoder characteristics as the source of the modality gap in CLIP and addresses it through two variants, a post-hoc standardization (I0Tpost) and a trainable method with normalization layers, both reducing the gap to near zero while preserving original embeddings and offering an explainable alternative to CLIPScore.
Key Contributions
- The analysis categorizes the CLIP modality gap using cosine distance, length scale, and mean cosine distance, and shows that persistent peak activations in normalized image and text encoder embeddings theoretically limit cosine similarity and induce the gap.
- The paper introduces I0T_post, a post-hoc embedding standardization method that reduces the modality gap to approximately zero without retraining, preserves the semantic embedding representations of trained models, and can serve as an explainable alternative to CLIPScore.
- The paper introduces I0T_async, a trainable method that adds separate normalization layers for each modality, and experiments show that I0T_post and I0T_async reduce the modality gap and improve downstream performance compared with seven CLIP-based models and BLIP, with no additional training parameters for I0T_post and 10M extra training parameters for I0T_async.
Introduction
Vision language models such as CLIP are widely used for multimodal retrieval, captioning evaluation, and other zero shot tasks, but their image and text embeddings often occupy separate regions of the latent space. This modality gap makes cross modal similarity scores less reliable, especially in metrics like CLIPScore, where correct image text pairs can receive lower scores than irrelevant same modality pairs. Earlier methods mainly try to move embeddings closer or modify training objectives, but they do not fully identify the embedding patterns that cause the gap. The authors show that each encoder develops modality specific activation peaks, then propose the I0T framework to reduce the gap while preserving semantic performance through post hoc embedding standardization and an asynchronous training variant, also introducing I0TScore for cross modal evaluation.
Method
The authors propose a two stage framework, I0T, for vision language models such as CLIP. The overall goal is to reduce the separation between image and text embeddings while preserving the semantic information learned by the encoders. The framework is organized into two stages. The first stage is a plug and play semantic fine tuning module that can be skipped if the user only wants to address the modality gap. The second stage operates asynchronously after the first stage and focuses on removing modality specific characteristics from the normalized image and text embeddings.
In the first stage, the authors improve the semantic representations of CLIP by combining several fine tuning strategies. They follow the implementation style of Long CLIP, but use only long captions for alignment rather than a mixed caption setup. This reduces training cost while maintaining strong downstream performance. The training objective combines standard contrastive learning with cyclic alignment losses, which encourage image and text representations to remain mutually consistent. The combined objective is written as
LCyCLIP=LCLIP+0.25LIcyclic+0.25LCcyclic.The authors fine tune the CLIP encoders for three epochs using the AdamW optimizer with a learning rate of 1e−6 and a weight decay of 1e−2. The batch size is set to 128, and the contrastive temperature uses a log scale of 4.6052. This stage is designed to strengthen semantic alignment without directly attempting to eliminate the modality gap.
The second stage is applied after the semantic encoder is frozen. The authors first examine a post hoc way to reduce the modality gap. They observe that simple clipping of large activations is insufficient because the remaining activations can still contain shared directions that are characteristic of either the image encoder or the text encoder. To remove these shared modality specific patterns, the authors standardize the normalized embedding activations across all hidden dimensions. Let xi and yi be normalized image and text embedding activations, and let xˉ and yˉ be the mean vectors estimated for the image and text modalities. The standardized activations are
xi′=Normalize(xi−xˉ),yi′=Normalize(yi−yˉ).This operation removes the mean direction associated with each modality and then renormalizes the result. The comparison of the original activations, clipped activations, the proposed standardized activations, and a prior shifting method is shown below.
After standardization, the mean activations become close to zero across all hidden dimensions, and the variance patterns become more modality invariant. The authors argue that this is stronger than methods that only shift embedding clusters, because their approach directly removes the underlying activation patterns that contribute to the gap.
Although the post hoc method is effective, it requires estimating modality specific mean vectors from available data and therefore does not naturally support zero shot inference for a single sample. To address this limitation, the authors propose a learnable asynchronous method. They add two independent batch normalization layers, one for the image encoder and one for the text encoder. These layers are placed after the frozen encoders, so the original semantic parameters remain fixed while the new normalization parameters learn the modality specific means and variances.
During training, the model updates running means and variances for the normalized image and text activations. If xˉB and yˉB are the batch mean vectors, the running means are updated as
xˉt+1=αxˉB+(1−α)xˉt,yˉt+1=αyˉB+(1−α)yˉt.The authors use an averaging factor of α=0.1. The final running statistics after training, denoted by xˉtrain, yˉtrain, σxtrain, and σytrain, serve as learned modality specific characteristics. At inference, the transformed embeddings are obtained from the learned batch normalization statistics and affine parameters as
x^i=Normalize(Wimg(σxtrain+ϵxi−xˉtrain)+bimg), y^i=Normalize(Wtxt(σytrain+ϵyi−yˉtrain)+btxt).Here Wimg, Wtxt, bimg, and btxt are the affine weights and biases of the image and text normalization layers. The epsilon value is set to 1e−5 for numerical stability.
The authors train these normalization layers asynchronously after freezing the fine tuned encoders. This separation is central to the design because it prevents the gap reduction module from rewriting the semantic content already encoded by the CLIP encoders. The batch normalization layers therefore learn only the statistical offsets and scales associated with each modality.
To make the learned statistics more robust, the authors introduce a multimodal contrastive augmentation procedure based on unsupervised positive pairs. Dropout with rate 0.1 is applied to every multi-head attention layer in both the image and text encoders. This creates augmented image and text features, and the training loss is computed over all combinations of original and augmented features. Conceptually, the loss can be written as
LMCSIE=EI∈{I,Iaug},ET∈{T,Taug}∑L(EI,ET).This strategy enlarges the set of positive multimodal associations and helps the normalization layers learn modality specific statistics more reliably. The final architecture preserves the semantic encoder parameters while allowing the added normalization branches to absorb and neutralize the activation patterns that produce the image text embedding gap.
Experiment
The experiments first assess whether CLIP-based training and post-hoc alignment can reduce image-text modality gaps while preserving semantic quality across retrieval, classification, and human-ranking correlation tasks. Results show that the proposed asynchronous and post-hoc variants substantially shrink the gap without degrading downstream effectiveness, with the post-hoc method being especially strong in retrieval and competitive on correlation and classification benchmarks. The findings also support using the post-hoc model as an interpretable, reference-free evaluation metric and demonstrate that its alignment benefits saturate with a small sample subset.
Across Long-CLIP variants, adding cyclic losses improves downstream retrieval while the modality gap remains severe. MCSIE slightly reduces the gap but also slightly lowers downstream performance, whereas layer normalization does not meaningfully relieve the gap. Encoder-specific batch normalization produces a moderate gap, and the asynchronous variant performs best on gap reduction and retrieval. Cyclic-loss training can improve retrieval without eliminating the modality gap. Asynchronous batch normalization per encoder offers a stronger balance between lower modality gap and retrieval performance.
The comparison shows that reducing the modality gap can preserve competitive downstream performance, especially on retrieval tasks. The baseline model exhibits a severe modality gap, while the examined variants reduce the gap to low or moderate levels without broadly harming semantic evaluation. The results also suggest that gap reduction does not guarantee the best outcome on every downstream task. The baseline model shows a severe modality gap, while the gap-reduction methods produce much lower separation measures. The methods with reduced modality gap remain competitive on image-to-text and text-to-image retrieval. Classification and correlation performance does not consistently follow gap reduction, so gap size alone does not fully predict downstream quality.
Using more test samples for the post-hoc embedding shift steadily reduces the modality gap, with severity remaining low across all tested sample sizes. Retrieval performance improves rapidly at small sample sizes and then saturates, so large subsets are not necessary to achieve competitive image-text retrieval. The best retrieval results are obtained when the full test sample set is used. A small test subset can already produce a low modality gap severity level. Retrieval gains become modest after the sample count grows beyond small subsets. Using the entire test set gives the strongest overall retrieval performance.
The experiments evaluate gap-reduction strategies for Long-CLIP, including cyclic losses, MCSIE, layer normalization, encoder-specific batch normalization, and asynchronous batch normalization. Cyclic losses and asynchronous encoder-specific normalization improve retrieval while reducing modality gap, whereas MCSIE and layer normalization offer weaker or less favorable trade-offs. Additional analyses show that post-hoc embedding shift with modest test samples already yields low gap severity and near-saturated retrieval, though using the full set gives the best results. Overall, reducing the modality gap supports competitive retrieval but does not uniformly guarantee better performance across all downstream tasks.