Manuscript Offprint

arXiv:2610.29939

ERCLIP: Small-Data Adaptation of CLIP for Free-Length Image-Text Retrieval

Hoang-Bao Le, Allie Tran, Binh T. Nguyen, Liting Zhou, Cathal Gurrin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Hoang-Bao Le 1^{1}, Allie Tran 1^{1}, Binh T. Nguyen 2^{2}, Liting Zhou 1^{1}, Cathal Gurrin 1^{1}

1^{1} ADAPT Centre, School of Computing, Dublin City University, Dublin, Ireland

2^{2} Ho Chi Minh University of Science, Vietnam National University, Ho Chi Minh City, Vietnam

bao.le2@mail.dcu.ie, {allie.tran, liting.zhou, cathal.gurrin}@dcu.ie

Abstract. CLIP's 77-token text encoder truncates detailed image descriptions. We present ERCLIP, a small-data adaptation of CLIP for long-caption image-text retrieval. During training, a long caption is split into sentences that the CLIP text encoder encodes independently; the sentence embeddings are fused by mean pooling or a gated residual Transformer scorer and receive their own contrastive loss. At inference ERCLIP is an unmodified CLIP dual encoder: test captions are still read through the 77-token window, and only training sees the full caption. We find that this fine-tuning erodes CLIP's zero-shot classification, most when the fusion output is not a combination of CLIP embeddings, and add a frozen-CLIP preservation loss on the image and short-caption embeddings. With 20k pairs and one epoch, ERCLIP improves long-caption R@1 over CLIP by 6.5–11.2 points, closing 62–77% of the gap to LongCLIP with 2% of its long captions. Preservation recovers 1.5–2.1 ImageNet zero-shot points (30–42% of the loss) and adds up to 2.4 points of COCO image-to-text R@1, at no inference cost.

Keywords: image-text retrieval · long captions · CLIP adaptation · small-data learning

1 Introduction

CLIP dual encoders align images and text in a shared embedding space and support both retrieval and zero-shot recognition [16]. Their text encoders, however, read at most 77 tokens, so detailed descriptions are truncated and the discarded facts never reach the embedding. Long-context methods extend the positional embeddings, match features across caption lengths, or learn token selection [25,22,14,21]. They rely on large long-caption corpora and rarely report what the adaptation does to the tasks CLIP already solves, a cost documented for classification fine-tuning [20,7] but not for long-caption retrieval.

We study the opposite regime: 20k image-caption pairs, 2% of the long captions used by LongCLIP, and one epoch on one GPU. ERCLIP splits each long caption into sentences that fit the original encoder, fuses their embeddings, and aligns the result with the image. The sentence pathway exists only in training, so the adapted model keeps CLIP's architecture, 77-token context, and inference cost; at test time long captions are still truncated, but the part the encoder

Le et al.

reads is better aligned with the image. We observe that this adaptation erodes zero-shot classification by an amount that depends on the fusion module and grows with training, and we limit it with a gated residual fusion initialised at mean pooling and a frozen-CLIP preservation loss.

Our contributions are (i) a sentence-level scheme that adapts CLIP to long captions from 20k pairs without changing its inference; (ii) evidence that the fusion module sets the cost to zero-shot ability, which motivates gated residual fusion and a label-free preservation loss; and (iii) a joint evaluation of long-caption retrieval, short-caption retrieval, and zero-shot classification at one fixed budget. The ingredients are not new (Sec. 2); our focus is their behaviour under scarce data.

References (25)

  • Sharegpt4v: Improving large multi-modal models with better captions
  • Finetune like you pretrain: Improved finetuning of zero-shot vision models
  • Long short-term memory
  • Scaling up visual and vision-language representation learning with noisy text supervision
  • Overcoming catastrophic forgetting in neural networks
  • Learning multiple layers of features from tiny images.(2009)
  • Fine-tuning can distort pretrained features and underperform out-of-distribution
  • Blip-2: Bootstrapping language-image pretraining with frozen image encoders and large language models
  • Blip: Bootstrapping language-image pre-training for unified vision-language understanding and generation
  • Supervision exists everywhere: A data efficient contrastive language-image pre-training paradigm
  • Learning without forgetting
  • Microsoft COCO: Common Objects in Context
  • Decoupled Weight Decay Regularization
  • TULIP: Token-length upgraded CLIP. In: The Thirteenth International Conference on Learning Representations
  • DOCCI: Descriptions of Connected and Contrasting Images
  • Learning transferable visual models from natural language supervision
  • Exploring the limits of transfer learning with a unified text-to-text transformer
  • Imagenet large scale visual recognition challenge
  • A picture is worth more than 77 text tokens: Evaluating clip-style models on dense captions
  • Robust fine-tuning of zero-shot models
  • Himo-clip: Modeling semantic hierarchy and monotonicity in vision-language alignment
  • Smartclip: Modular vision-language alignment with identification guarantees
  • ALIP: Adaptive Language-Image Pre-Training with Synthetic Caption (opens the publisher in a new tab)
  • Sigmoid loss for language image pre-training
  • Long-clip: Unlocking the long-text capability of clip