Skip to main content
QUICK REVIEW

[Paper Review] Sigmoid Loss for Language Image Pre-Training

Xiaohua Zhai, Basil Mustafa|arXiv (Cornell University)|Mar 27, 2023
Multimodal Machine Learning ApplicationsComputer Science12 citations
TL;DR

The paper introduces a memory-efficient sigmoid-based loss (Sigmoid loss) for language–image pre-training, enabling large-batch training and often outperforming softmax losses at smaller batch sizes (e.g., 32k) with strong zero-shot results.

ABSTRACT

We propose a simple pairwise Sigmoid loss for Language-Image Pre-training (SigLIP). Unlike standard contrastive learning with softmax normalization, the sigmoid loss operates solely on image-text pairs and does not require a global view of the pairwise similarities for normalization. The sigmoid loss simultaneously allows further scaling up the batch size, while also performing better at smaller batch sizes. Combined with Locked-image Tuning, with only four TPUv4 chips, we train a SigLiT model that achieves 84.5% ImageNet zero-shot accuracy in two days. The disentanglement of the batch size from the loss further allows us to study the impact of examples vs pairs and negative to positive ratio. Finally, we push the batch size to the extreme, up to one million, and find that the benefits of growing batch size quickly diminish, with a more reasonable batch size of 32k being sufficient. We release our models at https://github.com/google-research/big_vision and hope our research motivates further explorations in improving the quality and efficiency of language-image pre-training.

Motivation & Objective

  • Motivate a simpler, memory-efficient alternative to softmax-based contrastive losses for image–text pre-training.
  • Investigate how batch size interacts with a sigmoid loss versus softmax loss across CLIP-like and LiT-like architectures.
  • Demonstrate practical training setups that achieve strong zero-shot and retrieval performance with limited compute.
  • Explore robustness to data noise and the impact of positive/negative pair composition in sigmoid-based pre-training.

Proposed method

  • Propose a sigmoid-based loss that treats all image–text pairs as independent binary classifications, avoiding global batch normalization required by softmax-based InfoNCE.
  • Introduce a learnable bias term b and temperature-like parameter t to stabilize early training and improve convergence.
  • Provide a memory-efficient, “chunked” implementation that reduces |B|^2 memory to b^2 by processing negatives across devices without all-gathers.
  • Adapt the sigmoid loss to two language–image pre-training pipelines: SigLiT (LiT-style) and SigLIP (CLIP-style).
  • Conduct extensive experiments across batch sizes (from 512 to 1M), languages (multi-lingual setup), and model sizes to compare against softmax baselines.

Experimental results

Research questions

  • RQ1Does the sigmoid loss improve language–image pre-training quality compared with softmax loss, especially at small batch sizes?
  • RQ2How does training batch size affect performance, stability, and efficiency for SigLiT/SigLIP?
  • RQ3Can sigmoid-based pre-training scale to very large batch sizes with practical memory and compute constraints?
  • RQ4What is the impact of data noise and batch composition (positive/negative ratio) on sigmoid-based pre-training?
  • RQ5Is a multilingual pre-training setup equally effective with sigmoid loss, and what batch size is optimal across languages?

Key findings

  • Sigmoid loss outperforms softmax when batch size is below 16k, with the gap narrowing at larger batch sizes.
  • A SigLiT model trained on four TPUv4 chips achieves 84.5% ImageNet zero-shot accuracy (g/14, L model, 20k batch, 4 days).
  • A SigLiT model with B/8 and L* configuration reaches 79.7% zero-shot ImageNet after 1 day on four TPUv4 chips.
  • With memory-efficient chunked implementation, batch sizes up to one million are feasible, but performance saturates around 32k—32k is typically sufficient (and often optimal) for SigLIP/SigLiT, including multilingual setups.
  • SigLIP (WebLI English data) outperforms CLIP baselines at sub-32k batch sizes and scales to larger batches with substantial efficiency gains; multilingual variants (mSigLIP) reach strong XM3600 results (e.g., 34.9% text-to-image retrieval on XM3600 with Base model).
  • Stabilizing large-batch training benefits from lowering optimizer β2 (e.g., Adam/AdaFactor β2 from 0.999 to 0.95).
  • Bias term initialization (b = -10, t′ = log 10) consistently improves early training behavior and final performance.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.