atlas

Research map / Architectures and efficiency / RNNs and normalization

Breaking the Memory Barrier of Contrastive Loss via Tile-Based Strategy

CVPR 2025 · Architectures and efficiency › RNNs and normalization · approach: Dataset condensation and flow estimation · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes Inf-CL, a tile-based, multi-level (cross-GPU ring + in-GPU fused kernel) computation of the contrastive loss log-sum-exp that avoids materializing the full similarity matrix, enabling CLIP training at batch sizes up to millions.

Problem

Contrastive loss memory grows quadratically with batch size because the full image-text similarity matrix must be instantiated for the log-sum-exp, limiting large-batch contrastive training.

Approach

Decompose the contrastive loss into a positive term and a log-sum-exp term, compute LSE over tiles of the similarity matrix with a numerically stable cumulative merge, recompute tiles in the backward pass, and combine ring-based cross-GPU communication with fused in-GPU kernels.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace vanilla contrastive loss with Inf-CLViT-B/16 CLIP · Laion400M, batch size 64K, ImageNet Validationtop-1 accuracy: 74.74 -> 74.93No clear effect
Increase batch size from 64K to 256KInf-CL with ViT-B/16 · Laion400M, ImageNet Validationtop-1 accuracy: 74.93 -> 75.12Helped
Increase batch size from 64K to 1024KInf-CL with ViT-B/16 · Laion400M, ImageNet Validationtop-1 accuracy: 74.93 -> 73.58Hurt
Increase batch size from 64K to 256KInf-CL with ViT-B/16 · Laion400M, ImageNet-OODtop-1 accuracy: 66.77 -> 67.15Helped
Increase batch size from 64K to 1024KInf-CL with ViT-B/16 · Laion400M, MSCOCO image-to-text retrievaltop-1 accuracy: 26.01 -> 24.53Hurt
Add cross-GPU tiling without in-GPU tiling (ablation)Inf-CL · ViT-B/16 training, global batch size 64K, 4×A800loss memory (GB): 16.96 -> 4.81Helped
Add in-GPU tiling to cross-GPU tiling (ablation)Inf-CL · ViT-B/16 training, global batch size 64K, 4×A800loss memory (GB): 4.81 -> 0.81Helped
Add data offloadInf-CL · ViT-L/14 training, 8×A800maximum batch size: 448k -> 4096kHelped

Surprising findings

Limitations

Experimental setup

Datasets: LAION-400M CC3M CC12M

Benchmarks: ImageNet ImageNet-v2 ObjectNet ImageNet-OOD MSCOCO

Metrics: zero-shot top-1 accuracy peak GPU memory (GB) maximum batch size training speed (time per iteration/epoch) image-to-text and text-to-image retrieval R@1

Baselines: CLIP vanilla loss OpenCLIP local loss DisCo-CLIP Gradient Cache

Builds on: CLIP Gradient Cache FlashAttention Ring Attention OpenCLIP DisCo-CLIP

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy