Hyperbolic multimodal retrieval built on frozen CLIP representations, combining Lorentz and Euclidean embedding spaces for compact and hierarchy-aware semantic search.
Meridian is a multimodal retrieval model built on top of CLIP ViT-B/16 that learns both hyperbolic (Lorentz) and Euclidean representations for images and text.
Unlike conventional retrieval systems that operate entirely in Euclidean space, Meridian maps semantic information onto a Lorentz manifold where hierarchical structure emerges naturally. This geometry enables cleaner semantic organization, improved hierarchy preservation, and compact multimodal representations while retaining strong retrieval performance.
Highlights
~4× Embedding Compression compared to the CLIP baseline
~1.5× Faster Retrieval through compact representations
Hierarchical Multimodal Retrieval
Hyperbolic + Euclidean Dual Representations
Adaptive Geometry Gating
Layer-Weighted Transformer Aggregation
Built on OpenAI CLIP ViT-B/16
Performance
Evaluation on MS-COCO retrieval.
Variant
i2t R@1
i2t R@5
i2t R@10
t2i R@1
t2i R@5
t2i R@10
Meridian (64d)
29.66
55.20
67.18
25.29
51.00
63.02
Where:
i2t = Image → Text Retrieval
t2i = Text → Image Retrieval
Retained ∼70–78% I2T and ∼87–91% T2I recall (R@5/10) relative to the full-dim CLIP zero-shot baseline, with ∼1.6× retrieval speedup on a 1.7M-item index.
Index tensors are stored on the Hub in FP16 format for storage efficiency and automatically converted to FP32 when loaded.
Encoding Text
python
1import torch
23inputs = model.processor(4 text=["a photo of a dog running on a beach"],5 return_tensors="pt",6 padding="max_length",7 max_length=77,8)910eos_indices = inputs["attention_mask"].sum(dim=1)-11112with torch.no_grad():13 out = model.encode_text(14 input_ids=inputs["input_ids"],15 attention_mask=inputs["attention_mask"],16 eos_indices=eos_indices,17)1819h_text = out["h_text"]20e_text = out["e_text"]
Instead of relying solely on the final transformer layer, Meridian learns weighted combinations across all transformer blocks.
4. Dual Representation Heads
Two parallel embedding spaces are learned:
Hyperbolic Lorentz embeddings
Euclidean embeddings
The hyperbolic branch maps features onto a Lorentz manifold using exponential-map operations.
5. Adaptive Gating
A learned gating mechanism dynamically combines hyperbolic and Euclidean similarities for each sample.
Training Note
The CLIP vision and text encoders remain completely frozen during training.
Meridian learns:
Layer aggregation weights
Hyperbolic projection heads
Euclidean projection heads
Adaptive gating modules
This enables improved hierarchical organization and retrieval behavior without modifying the pretrained CLIP backbone.
Hierarchy Comparison
Meridian is designed to preserve hierarchical structure more effectively than conventional Euclidean embeddings.
The examples below compare hierarchical organization produced by the original frozen CLIP embeddings against the representations learned by Meridian. The CLIP vision and text encoders remain frozen throughout training; improvements arise from Meridian's learned layer aggregation, projection heads, and adaptive gating modules.
OpenAI CLIP ViT-B/16
text
1Mixed Animal Region
2├── Dog
3├── Cat
4├── Flower
5├── Lion
6├── Tiger
7├── Tree
8└── Elephant
If you use concepts originating from MERU, please also cite:
bibtex
1@inproceedings{desai2023meru,
2 title = {Hyperbolic Image-Text Representations},
3 author = {Desai, Karan and Nickel, Maximilian and Rajpurohit, Tanmay and Johnson, Justin and Vedantam, Ramakrishna},
4 booktitle = {International Conference on Machine Learning},
5 year = {2023}
6}
Acknowledgements
Meridian builds upon several foundational projects:
OpenAI CLIP
OpenCLIP
MERU (Hyperbolic Image-Text Representations)
Special thanks to the authors of these projects for their contributions to multimodal representation learning.