Model Reference
Shaped offers a rich library of model policies that power retrieval, scoring, and ranking within your recommendation and search systems. These policies range from classic collaborative filtering techniques and rule-based heuristics to state-of-the-art deep learning architectures. Explore the available policies below to understand their capabilities and how to configure them for optimal performance.
Model types in Shapedโ
Shaped systems typically use a combination of:
- HuggingFace embedding models (zero-shot): Pre-trained encoders used to generate embeddings without training on your interaction data. These are commonly used for vector search retrieval (semantic text search, similarity, content filtering) and as feature inputs to downstream trained models.
- Trained embedding models: Models trained or fine-tuned on your data to learn user and item representations (e.g., matrix factorization, two-tower retrieval, sequential models). These are often used for candidate retrieval, similarity, and as features for scoring.
- Scoring models: Point-wise models used in the scoring stage to produce a relevance score for a (user, item) pair, typically using rich feature sets.
Trained embedding and scoring models are trained on the data in your engine and retrained continuously based on your configured training schedule.
Embedding modelsโ
Embedding models are trained to represent items and users in vector space.
For pre-trained, zero-shot embedding generation, see HuggingFace embedding models.
๐งฉ ALS
Matrix Factorization (Alternating Least Squares) for implicit feedback collaborative filtering.
๐งฉ SVD
Matrix Factorization (Singular Value Decomposition inspired) for collaborative filtering, often including biases.
๐ก ELSA
Scalable Linear Shallow Autoencoder for implicit feedback recommendations using factorized structure.
โจ EASE
Embarrassingly Shallow Autoencoder with a simple closed-form solution for item collaborative filtering.
๐ผ Two-Tower
Scalable deep learning model with separate user and item networks for efficient candidate retrieval.
๐ beeFormer
Fine-tunes sentence Transformers on interaction data, bridging semantic and behavioral signals.
๐ Item2Vec
Learns item embeddings based on co-occurrence within interaction sequences (Word2Vec adaptation).
โก๏ธ SASRec
Self-Attentive Sequential Recommendation model using Transformers for next-item prediction.
โ๏ธ BERT4Rec
Bidirectional Transformer (BERT) for sequential recommendation via masked item prediction.
โ GSASRec
Improved SASRec (Generalized Self-Attentive) reducing overconfidence in sequential models.
HuggingFace embedding models (zero-shot)โ
HuggingFace models are used for generating embeddings in a zero-shot way. They can be used for:
- Vector search retrieval: Semantic search, similarity lookup, and content filtering using the embedding vector index.
- Downstream features: As feature inputs to trained embedding models (e.g., two-tower, beeFormer) and scoring models (e.g., LightGBM, Wide and Deep).
In v2, HuggingFace embeddings are configured in your engine index.embeddings via
the hugging_face encoder. See
Use a pre-trained model.
If you prefer embeddings trained on your data, you can also encode with trained models and use them in the same retrieval and scoring flows.
๐ Sentence Transformers
Text embedding models used for semantic search, similarity, and as features for downstream models.
๐ผ๏ธ CLIP, OpenCLIP, SigLIP
Multimodal encoders used for image and cross-modal retrieval, and image features in ranking.
๐ท๏ธ Jina, Nomic, Marqo
Common providers for text and multimodal embedding models on HuggingFace.
๐ง E5, BGE, GTE families
Popular embedding model families, typically published as compatible Sentence Transformers.
You will typically use these embeddings in two places:
- Index configuration: Create one or more embeddings in
index.embeddings. Seeengine-recipesandFeature types. - Queries: Retrieve with vector search (
text_search(mode='vector', ...)) or similarity (similarity(embedding_ref=..., ...)). SeeVector search retrieverandShapedQL: text_search().
Common gotchas:
- Modality matters: Text encoders should be used with text fields, and CLIP-style
encoders can be used with image URL fields. See
Create embeddings for text and image features. - Private models: If the model is private, you will need a HuggingFace token at
train time. See
Invalid Huggingface model.
Supported HuggingFace model collectionsโ
Shaped supports HuggingFace embedding models from:
- Sentence Transformers: Any compatible model from the HuggingFace Sentence Transformers collection.
- CLIP: Any compatible model from the HuggingFace CLIP collection.
Common providers and architecturesโ
In addition to the collections above, users commonly use models from providers and families like:
- Jina AI: Text and multimodal embedding models published on HuggingFace (e.g.,
jinaai/jina-clip-v2). - Nomic AI: Text embedding models published on HuggingFace (e.g.,
nomic-ai/*). - Marqo: Domain-tuned multimodal retrieval/embedding models published on HuggingFace (e.g., Marqo-published CLIP-style models).
- Other common embedding families: E5, BGE, and GTE models, when published as compatible Sentence Transformers or CLIP-style encoders.
- Other common multimodal architectures: OpenCLIP and SigLIP variants, when published as compatible CLIP-style encoders.
Commonly used modelsโ
These are common examples used in our v2 docs:
sentence-transformers/all-MiniLM-L6-v2sentence-transformers/modernbertAlibaba-NLP/gte-modernbert-baseopenai/clip-vit-base-patch32
Scoring modelsโ
Scoring models are used to rank items by relevance or other predicted business metrics (e.g., engagement, predicted click-through-rate, conversion).
Zero-shot scoring and rerankingโ
For text-heavy search use cases, Shaped also supports zero-shot rerankers and rank fusion methods that work well on a small candidate set.
These are score-stage expressions, so they can be used for both search and
recommendations anywhere score(expression='...') is supported.
๐ ColBERTv2
Late-interaction text reranker for high-quality retrieval and reranking.
๐งพ Cross-encoders
Zero-shot text reranking by scoring each (query, item) pair.
๐ Reciprocal rank fusion (RRF)
Robustly fuse lexical and vector ranked lists using ranks.
โ๏ธ Linear interpolation
Blend retrieval scores and model outputs with explicit weights.
๐ณ LightGBM
Efficient Gradient Boosting Decision Tree framework, suitable for ranking (e.g., LambdaMART).
๐ณ XGBoost
Scalable Gradient Boosting Decision Tree framework, effective for classification and ranking tasks.
โ Wide & Deep
Combines a wide linear model (memorization) and a deep neural network (generalization) for scoring.
๐ DeepFM
Combines Factorization Machines (FM) and Deep Neural Networks (DNN) for interaction modeling.
#๏ธโฃ Ngram
Simple sequential model predicting based on fixed-length interaction counts (n-grams).
๐ Rising Popularity
Trending policy ranking items by recent increase in engagement (momentum).