microsoft / LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

huggingface.co
Total runs: 23.6K
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: November 20 2024
zero-shot-classification

Introduction of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

Model Details of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

LLM2CLIP: Extending the Capability Boundaries of CLIP through Large Language Models
Weiquan Huang 1* , Aoqi Wu 1* , Yifan Yang 2† , Xufang Luo 2 , Yuqing Yang 2 , Liang Hu 1 , Qi Dai 2 , Xiyang Dai 2 , Dongdong Chen 2 , Chong Luo 2 , Lili Qiu 2

1 Tongji Universiy, 2 Microsoft Corporation
* Equal contribution
† Corresponding to: [email protected]

[📂 GitHub] [🆕 Blog] [📜 LLM2CLIP]

In this paper, we propose LLM2CLIP, a novel approach that embraces the power of LLMs to unlock CLIP’s potential. By fine-tuning the LLM in the caption space with contrastive learning, we extract its textual capabilities into the output embeddings, significantly improving the output layer’s textual discriminability. We then design an efficient training process where the fine-tuned LLM acts as a powerful teacher for CLIP’s visual encoder. Thanks to the LLM’s presence, we can now incorporate longer and more complex captions without being restricted by vanilla CLIP text encoder’s context window and ability limitations. Our experiments demonstrate that this approach brings substantial improvements in cross-modal tasks. Our method directly boosted the performance of the previously SOTA EVA02 model by 16.5% on both long-text and short-text retrieval tasks, transforming a CLIP model trained solely on English data into a state-of-the-art cross-lingual model. Moreover, when integrated into mul- timodal training with models like Llava 1.5, it consistently outperformed CLIP across nearly all benchmarks, demonstrating comprehensive performance improvements.

LLM2CLIP performance
summary_tab
**It's important to note that all results presented in the paper are evaluated using PyTorch weights. There may be differences in performance when using Hugging Face (hf) models.**
Model Details
  • Model Type: vision foundation model, feature backbone
  • Pretrain Dataset: CC3M, CC12M, YFCC15M and Recap-DataComp-1B(30M subset)
Usage
Huggingface Version

Image Embeddings

from PIL import Image
from transformers import AutoModel
from transformers import CLIPImageProcessor
import torch

image_path = "CLIP.png"
model_name_or_path = "LLM2CLIP-Openai-L-14-336" # or /path/to/local/LLM2CLIP-Openai-L-14-336

processor = CLIPImageProcessor.from_pretrained("openai/clip-vit-large-patch14-336")
model = AutoModel.from_pretrained(
    model_name_or_path, 
    torch_dtype=torch.float16,
    trust_remote_code=True).to('cuda').eval()

image = Image.open(image_path)
input_pixels = processor(images=image, return_tensors="pt").pixel_values.to('cuda')

with torch.no_grad(), torch.cuda.amp.autocast():
    outputs = model.get_image_features(input_pixels)

Retrieval

from PIL import Image
from transformers import AutoModel, AutoConfig, AutoTokenizer
from transformers import CLIPImageProcessor
import torch
from llm2vec import LLM2Vec

processor = CLIPImageProcessor.from_pretrained("openai/clip-vit-large-patch14-336")
model_name_or_path = "microsoft/LLM2CLIP-Openai-L-14-336" # or /path/to/local/LLM2CLIP-Openai-L-14-336
model = AutoModel.from_pretrained(
    model_name_or_path, 
    torch_dtype=torch.float16,
    trust_remote_code=True).to('cuda').eval()

llm_model_name = 'microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned'
config = AutoConfig.from_pretrained(
    llm_model_name, trust_remote_code=True
)
llm_model = AutoModel.from_pretrained(llm_model_name, config=config,trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(llm_model_name)
llm_model.config._name_or_path = 'meta-llama/Meta-Llama-3-8B-Instruct' #  Workaround for LLM2VEC
l2v = LLM2Vec(llm_model, tokenizer, pooling_mode="mean", max_length=512, doc_max_length=512)

captions = ["a diagram", "a dog", "a cat"]
image_path = "CLIP.png"

image = Image.open(image_path)
input_pixels = processor(images=image, return_tensors="pt").pixel_values.to('cuda')

with torch.no_grad(), torch.cuda.amp.autocast():
    image_features = model.get_image_features(input_pixels)
    text_features = l2v.encode(captions, convert_to_tensor=True).to('cuda')
    text_features = model.get_text_features(text_features)

    image_features /= image_features.norm(dim=-1, keepdim=True)
    text_features /= text_features.norm(dim=-1, keepdim=True)

    text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)

print("Label probs:", text_probs)
BibTeX & Citation
@misc{huang2024llm2clippowerfullanguagemodel,
      title={LLM2CLIP: Powerful Language Model Unlock Richer Visual Representation}, 
      author={Weiquan Huang and Aoqi Wu and Yifan Yang and Xufang Luo and Yuqing Yang and Liang Hu and Qi Dai and Xiyang Dai and Dongdong Chen and Chong Luo and Lili Qiu},
      year={2024},
      eprint={2411.04997},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2411.04997}, 
}

Runs of microsoft LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned on huggingface.co

23.6K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co Model

More LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned license Visit here:

https://choosealicense.com/licenses/apache-2.0

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co is an AI model on huggingface.co that provides LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned's model effect (), which can be used instantly with this microsoft LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned model. huggingface.co supports a free trial of the LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned model, and also provides paid use of the LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned. Support call LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned model through api, including Node.js, Python, http.

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co Url

https://huggingface.co/microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

microsoft LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned online free

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co is an online trial and call api platform, which integrates LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned's modeling effects, including api services, and provides a free online trial of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned, you can try LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned online for free by clicking the link below.

microsoft LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned online free url in huggingface.co:

https://huggingface.co/microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned install

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned is an open source model from GitHub that offers a free installation service, and any user can find LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned on GitHub to install. At the same time, huggingface.co provides the effect of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned install, users can directly use LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned install url in huggingface.co:

https://huggingface.co/microsoft/LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

Url of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned

LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co Url

Provider of LLM2CLIP-Llama-3-8B-Instruct-CC-Finetuned huggingface.co

microsoft
ORGANIZATIONS

Other API from microsoft

huggingface.co

Total runs: 681.1K
Run Growth: 208.0K
Growth Rate: 30.53%
Updated:February 03 2022
huggingface.co

Total runs: 595.8K
Run Growth: -131.1K
Growth Rate: -22.00%
Updated:November 25 2025
huggingface.co

Total runs: 535.6K
Run Growth: 307.0K
Growth Rate: 57.32%
Updated:April 08 2024
huggingface.co

Total runs: 511.8K
Run Growth: -531.5K
Growth Rate: -103.84%
Updated:December 08 2025
huggingface.co

Total runs: 289.1K
Run Growth: -22.3K
Growth Rate: -7.70%
Updated:February 14 2024
huggingface.co

Total runs: 117.8K
Run Growth: -147.4K
Growth Rate: -125.12%
Updated:November 08 2023
huggingface.co

Total runs: 117.6K
Run Growth: -1.2K
Growth Rate: -1.03%
Updated:February 29 2024
huggingface.co

Total runs: 100.0K
Run Growth: -425
Growth Rate: -0.42%
Updated:August 28 2025
huggingface.co

Total runs: 69.7K
Run Growth: -13.1K
Growth Rate: -18.74%
Updated:November 25 2025
huggingface.co

Total runs: 68.7K
Run Growth: -18.2K
Growth Rate: -26.47%
Updated:December 03 2025
huggingface.co

Total runs: 54.8K
Run Growth: -232.3K
Growth Rate: -374.28%
Updated:September 26 2022
huggingface.co

Total runs: 48.2K
Run Growth: -6.0K
Growth Rate: -12.09%
Updated:December 23 2021
huggingface.co

Total runs: 39.6K
Run Growth: -76.2K
Growth Rate: -162.45%
Updated:February 03 2023
huggingface.co

Total runs: 35.8K
Run Growth: -105.9K
Growth Rate: -296.01%
Updated:May 12 2026
huggingface.co

Total runs: 32.5K
Run Growth: 28.2K
Growth Rate: 86.85%
Updated:April 23 2026
huggingface.co

Total runs: 27.1K
Run Growth: -74.6K
Growth Rate: -216.41%
Updated:March 23 2023
huggingface.co

Total runs: 23.6K
Run Growth: -5.9K
Growth Rate: -24.43%
Updated:April 24 2023