---
title: "From Pre-trained to Fine-tuned: Nextdoor’s Path to Effective Embedding Applications"
description: "Nextdoor evolved its entity embeddings for posts, comments, users and search queries in three stages."
url: "https://swe.quest/articles/from-pre-trained-to-fine-tuned-nextdoor-s-path-to-effective-embedding-2fbc04ae74130a93"
canonical: "https://engblog.nextdoor.com/from-pre-trained-to-fine-tuned-nextdoors-path-to-effective-embedding-applications-3a13b56d91aa"
source: "Nextdoor Engineering"
published: "2023-09-07"
difficulty: "hard"
kind: "Case study"
reading_minutes: 11
tags: ["recommendation-systems","model-training","ml-platform","search","machine-learning"]
---

# From Pre-trained to Fine-tuned: Nextdoor’s Path to Effective Embedding Applications

A post on [Nextdoor Engineering](https://swe.quest/sources/nextdoor.md), published 2023-09-07, 11 min read, Case study. Original: [https://engblog.nextdoor.com/from-pre-trained-to-fine-tuned-nextdoors-path-to-effective-embedding-applications-3a13b56d91aa](https://engblog.nextdoor.com/from-pre-trained-to-fine-tuned-nextdoors-path-to-effective-embedding-applications-3a13b56d91aa)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [ML platforms](https://swe.quest/tags/ml-platform.md) (AI & ML)
- [Search](https://swe.quest/tags/search.md) (Backend & APIs)
- [Machine learning](https://swe.quest/tags/machine-learning.md) (AI & ML)

## Prerequisites

- sentence embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- two-tower models
- contrastive learning
- feature stores

## Keywords

Sentence-BERT, Nextdoor, hnswlib, SageMaker, Airflow, BERTopic, CLIP, PyTorch

## Related posts

- [User foundation models for Grab](https://swe.quest/articles/user-foundation-models-for-grab-98db1323e8d3fa5a.md): Grab Engineering · 2025-09-26 · Hard · 18 min read · Recommendations & ranking, Model training, Machine learning, ML platforms
  Grab 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.
- [From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart](https://swe.quest/articles/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-1eba18ee15c15a7e.md): Instacart Tech · 2026-06-02 · Hard · 13 min read · Recommendations & ranking, Ads, Inference & serving, ML platforms
  Instacart 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.
- [Training and Finetuning Multi-Vector Embedding Models with Sentence Transformers](https://swe.quest/articles/training-and-finetuning-multi-vector-embedding-models-with-sentence-transformers-454449569f0d4793.md): Hugging Face · 2026-08-26 · Medium · 27 min read · Model training, Search, Python, RAG & retrieval
  Sentence 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.
- [Getting Started With Embeddings](https://swe.quest/articles/getting-started-with-embeddings-f83c278b13779a68.md): Hugging Face · 2022-06-23 · Medium · 11 min read · Search, Machine learning, Python, Vector search
  Embeddings turn text or images into fixed-length vectors that capture meaning, so semantic similarity becomes a distance calculation.
- [Importance of offline evaluation to guide model choice](https://swe.quest/articles/importance-of-offline-evaluation-to-guide-model-choice-c0b684a1e0515b32.md): OLX Tech · 2025-10-07 · Medium · 5 min read · Recommendations & ranking, Evaluation, Model training, Vector search
  OLX 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
