TL;DR
HyFL-CLIP introduces a hyperbolic fine-tuning framework that adapts CLIP for robust long-context text-image alignment. By shifting from flat Euclidean space to negatively curved hyperbolic space, the model naturally captures hierarchical "part-whole" relationships between global captions and individual words or sentences. This geometric shift yields up to a 19.5% improvement in retrieval accuracy under text perturbations like word dropping and sentence shuffling.
What Problem Does This Paper Address?
Contrastive Language-Image Pre-training (CLIP) has revolutionized vision-language tasks, but it inherently struggles with long-context descriptions (>77 tokens). In real-world scenarios, long descriptions are rarely rigid; sentences get reordered, summarized, or partially omitted.
While prior works extended CLIP's context window by modifying positional encodings, they remain highly sensitive to these text perturbations. The authors identify the root cause as the standard Euclidean contrastive objective. Euclidean space forces a strict, one-to-one point matching that treats long captions as monolithic entities. It lacks a mechanism to model the hierarchical structure inherent in long text—specifically, how individual sentences or words (parts) relate to the overall description (the whole). Consequently, the global embedding often collapses onto a few salient tokens, making the model brittle if those tokens are altered or moved.
Methods
To overcome the limitations of Euclidean space, the authors propose HyFL-CLIP (Hyperbolic Fine-tuning for Long-context CLIP), which maps representations into the Lorentz (Minkowski) model of hyperbolic geometry. The framework relies on three core components:
- Cross-Manifold Similarity Distillation: To preserve the powerful short-text alignment already learned by standard CLIP, the model distills the similarity distributions from a Euclidean teacher into the hyperbolic student space using a Kullback-Leibler (KL) divergence loss.
- Hyperbolic Geodesic Contrastive Loss: Long text-image pairs are optimized directly on the Lorentz manifold using negative geodesic distance instead of standard cosine similarity.
- Hierarchical Entailment via Einstein Midpoint Aggregation: To model part-whole relationships, token-wise features are aggregated into a "parent" representation using a similarity-weighted Einstein midpoint (the hyperbolic counterpart to a center of mass). The model then enforces an entailment constraint: the global caption embedding must lie within an entailment cone projected from this aggregated midpoint.
Datasets
The model was trained and evaluated on several diverse datasets:
- Training: ShareGPT4V, containing 1.2 million image-caption pairs featuring highly descriptive, multi-sentence annotations (averaging 143.6 words).
- Long-Context Evaluation: DOCCI, DCI, Long-DCI, and Urban-1k, with dense captions ranging from 131.4 to 174.2 tokens.
- Short-Context & Intra-Modality Evaluation: COCO and Flickr30K (for short captions), alongside text-only retrieval datasets like nocaps, 20 Newsgroups, and IMDB Reviews.
Key Insights and Ideas
- The Geometry of Tolerance: The most compelling insight is that the hyperbolic entailment cone provides a geometric margin of tolerance. When a text prompt undergoes word dropout or sentence shuffling, the aggregated token midpoint shifts. However, because the global embedding only needs to remain within the cone's nonzero aperture rather than matching a exact point, the text-image alignment remains intact.
- Cross-Manifold Bridge: Rather than training a hyperbolic vision-language model from scratch on massive data, the authors successfully demonstrate how to bootstrap a mature Euclidean model (Open-CLIP) and warp its embedding space into a hyperbolic manifold without losing its foundational alignment.
Key Results
- Robustness to Perturbations: Under severe text modifications (such as dropping 50% of the words or shuffling sentence order), HyFL-CLIP consistently outperformed existing long-context models, showing up to a 19.5% relative improvement over the best prior Euclidean methods.
- Zero-Shot Retrieval: HyFL-CLIP achieved state-of-the-art performance across all major long-caption benchmarks (DOCCI, DCI, Urban-1k) using both ViT-B/16 and ViT-L/14 backbones.
- Generative Integration: The framework was successfully integrated into Stable Diffusion XL (SDXL). By mapping hyperbolic prompt embeddings back to the Euclidean tangent space via logarithmic mapping, the generative model followed long, detailed prompts much more faithfully, capturing fine-grained details that baseline models ignored.
Limitations and Future Work
While the paper demonstrates clear advantages, some limitations and areas for future work include:
- Generative Pipeline Overhead: Integrating hyperbolic text encoders into downstream generative models like SDXL requires mapping the embeddings back to Euclidean space via tangent space transformations, which adds an extra mathematical step during inference.
- Curvature Tuning: The model parameterizes curvature ($\kappa$) as a learnable variable. Although sensitivity analyses show stability, exploring how dynamic or multi-valued curvatures affect even longer documents remains an open question.
Summary updated