Efficient Visual Representation Learning And Evaluation
Etsy compares EfficientNetB0 and the EfficientFormer-l3 hybrid vision transformer as backbones for image embeddings that power visual search and visually similar recommendations, fine-tuned with a four-task multitask setup on two 16GB P100 GPUs. Embeddings are evaluated after each epoch with brute-force nearest-neighbor Recall@K callbacks on intra-item, review-photo and ad-click datasets, plus an experimental set where Stable Diffusion turns text search queries into image queries. EfficientNetB0 (~5M params, 1.7ms on iPhone 12) offers the best latency, while EfficientFormer-l3 (~30M params, 2.7ms) gives up to +17% Recall@5 and +0.65% CTR in A/B tests. The Stable Diffusion pipeline was sped up with token merging and fp16 to about 500 images per hour on one T4.
Related posts
- Image Similarity with Hugging Face Datasets and Transformers
Hugging Face mediumAdeptAn image similarity system can be built by embedding images with a fine-tuned Vision Transformer (CLS token from the last hidden state) and ranking candidates by cosine similarity against a query embedding. The walkthrough uses 🤗 Transformers' AutoModel and 🤗 Datasets' batched map() to embed a 100-image subset of the Beans dataset, then retrieves top-k matches from the test split. For scale, brute-force search over 768-d embeddings becomes costly in memory and compute, so dimensionality reduction via random projection and locality-sensitive hashing, or a FAISS index through Datasets' add_faiss_index(), is recommended.
- Training and Finetuning Multimodal Embedding & Reranker Models with Sentence Transformers
Hugging Face mediumAdeptFinetuning Qwen3-VL-Embedding-2B with Sentence Transformers for Visual Document Retrieval raised NDCG@10 from 0.888 to 0.947. On the author's evaluation data, that beats every tested VDR model, including models up to 4x larger. The walkthrough covers each training component: loading VLM or Router-composed multimodal models, formatting image/text triplet datasets, CachedMultipleNegativesRankingLoss with mini_batch_size=1 so a batch size of 64 fits in GPU memory via gradient caching, MatryoshkaLoss for truncatable embeddings (near-peak quality at 512 dims), training arguments, and an InformationRetrievalEvaluator built with hard negatives. It also extends the same approach to training multimodal rerankers.
- Open Preference Dataset for Text-to-Image Generation by the 🤗 Community
Hugging Face easyNoviceData is Better Together released an Apache 2.0 text-to-image preference dataset of 10K pairs, with over 30K annotations from more than 250 community members collected in under two weeks. Imgsys prompts were deduplicated, filtered for NSFW content with text and image classifiers plus manual review, and rewritten with distilabel across style categories and simple versus complex variants. Images came from FLUX.1-dev and Stable Diffusion 3.5 Large. Annotators found FLUX better for anime, manga and 3D, and SD3.5 better for cinematic and art styles. A LoRA fine-tune of FLUX-dev on the chosen samples improved its weaker art and cinematic outputs.
- Advancing Generative Recommendation Inference: our collaboration with NVIDIA on TensorRT LLM
Spotify Engineering hardMasterSpotify consolidated its LLM-based generative recommendation inference onto TensorRT LLM, working with NVIDIA to add the features it had been splitting across engines. vLLM handled beam search for semantic-ID candidate generation, but its beam search runs outside the core GPU engine and recomputes partially filled KV blocks. SGLang supplied multi-item candidate scoring, and personalization came from soft tokens that project existing user embeddings into the LLM's embedding space. The upstream additions were multi-sequence beam search, out-of-tree models for a custom Qwen3 soft-token plugin, embedding injection and multi-item scoring, which cut costs on Qwen3 1.7B by up to 54% for beam search and 7% for scoring.
- NeoMME: an efficient Multimodal-native and Multilingual Encoder
Hugging Face hardMasterNeoMME is a family of 260M and 800M multilingual multimodal encoders that feed text tokens and raw 32×32 image patches through a single bidirectional Transformer, trained from scratch with a masked discrete-diffusion text objective instead of reusing a vision tower or causal LM. High text-masking rates on image-text pairs force the model to ground predictions in visual evidence. Fine-tuned ColPali-style for visual document retrieval, NeoMME-Retriever outputs dense and late-interaction embeddings in one pass and sits on the ViDoRe v3 size/nDCG@10 Pareto frontier (0.523 at 260M, near ColQwen2.5 with 14× fewer parameters). The 260M model encodes ~51 pages/s at 2048×2048 on an L40S, about twice ColModernVBERT, and hierarchical token pooling plus asymmetric quantization cut index storage from ~1.5 MB to 6 kB per page while keeping over 95% of retrieval quality.