From Pre-trained to Fine-tuned: Nextdoor’s Path to Effective Embedding Applications
Nextdoor evolved its entity embeddings for posts, comments, users and search queries in three stages. It started with pre-trained multilingual SBERT models, then fine-tuned a query model with self-supervised contrastive learning on search-session co-occurrence, and finally fine-tuned a two-tower model on notification-click and feed labels with multi-task learning. The labeled fine-tuning cut dimensionality by more than 10x while improving user-post cosine similarity by up to 16%, and HNSW-based query expansion cut latency by more than 10x. Because downstream rankers are tree-based, the embeddings are served through a FeatureStore as cosine-similarity and dot-product affinity features, with transforms computed inside the store to reduce network and serving costs.
Related posts
- User foundation models for Grab
Grab Engineering hardMasterGrab built a transformer-based user foundation model that jointly learns from tabular user attributes and time-series clickstream data to produce general-purpose user embeddings, replacing siloed hand-engineered features. A universal key:value tokenisation with custom positional embeddings and attention masks treats tabular columns as an unordered set and events as an ordered sequence. Modality-specific adapters (pre-trained language models for text, embedding layers for IDs, custom encoders for locations and numbers) feed an alignment layer before the transformer. Pre-training is unsupervised, combining masked token reconstruction with next-action prediction across verticals, so the embeddings serve many downstream tasks such as ads, fraud detection and churn prediction, or the model can be fine-tuned directly.
- From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart
Instacart Tech hardMasterInstacart replaced its BERT-based ads retrieval model, which scored every atomic product ID in a fixed vocabulary, with a generative model that autoregressively decodes Semantic IDs (RQ-VAE codeword sequences) via beam search. The goal was to fix vocabulary bottlenecks, cold-start bias toward popular items, and incoherent candidate sets. Prompts combine a retailer-type token, user history SIDs and cart SIDs. SIDs shrink embedding parameters 125x and give new products coverage from day one, while beam width and temperature act as dials between precision and diversity. Serving moved from Python on CPU to a Go service on TensorRT-LLM and Triton. Mean latency dropped 10–17% despite roughly twice the candidates, and A/B tests showed +5% CTR and +34% add-to-carts.
- Training and Finetuning Multi-Vector Embedding Models with Sentence Transformers
Hugging Face mediumAdeptSentence Transformers v6.0 adds a MultiVectorEncoder model type for ColBERT-style late-interaction retrieval, with a full training stack covering models, datasets, losses, training arguments, evaluators and the trainer. A guide walks through finetuning on MIRIAD medical question-passage pairs. The resulting mLateOn-medical model, trained in 14.5 hours on one RTX 3090, beats every general-purpose dense, sparse, lexical and multi-vector retriever the author tested. Key findings: '-unsupervised' checkpoints taken before supervised finetuning adapt to a new domain better than finished ones, which barely improved or regressed. Lifting the 180–512 token document caps matters too, since truncation cost up to 0.24 NDCG@10 on long passages. A punctuation skiplist shrinks the index by 9.6% with a slight quality gain, and CachedMultiVectorMultipleNegativesRankingLoss allows large effective batch sizes.
- Getting Started With Embeddings
Hugging Face mediumAdeptEmbeddings turn text or images into fixed-length vectors that capture meaning, so semantic similarity becomes a distance calculation. A walkthrough builds a small FAQ matcher: it embeds 13 Medicare FAQs into 384-dimensional vectors with sentence-transformers/all-MiniLM-L6-v2 through the Hugging Face Inference API, hosts the vectors as a CSV dataset on the Hub, then embeds a user query and ranks the top 5 FAQs by cosine similarity with util.semantic_search. Practical notes include retrying the first API call while the model loads, and using FAISS via add_faiss_index as an alternative search path.
- Importance of offline evaluation to guide model choice
OLX Tech mediumAdeptOLX compared open-source multilingual text embedding models against its in-house Item2vec model for similar-item recommendations by building an offline evaluation dataset from user interaction pairs, weighting favorites and chat replies above clicks and favoring recent activity. Candidate models were filtered from the MTEB leaderboard by memory, latency, text-only modality and multilingual support. Offline recall tracked MTEB scores, and multilingual-e5-small won across languages. Fine-tuning it with Sentence Transformers and MultipleNegativesRankingLoss improved recall@5, especially for low-resource languages like Uzbek and Kazakh, with gains plateauing after 40 epochs. In A/B testing, pure embedding similarity missed relevance signals such as location and price, so a reranker blending normalized location distance with similarity score, tuned by grid search, was added after retrieval.