The Learned Rerank stage uses machine learning to personalize search results based on historical user interactions. It learns which document features predict engagement for different user segments and reranks results accordingly.
Stage Category : SORT (Personalized reordering)Transformation : N documents → top_n documents (personalized ranking)
When to Use
Use Case Description Personalization Rank based on user preferences A/B optimization Learn from click/conversion data Marketplace ranking Optimize for engagement metrics Content recommendations Personalize content feeds
When NOT to Use
Scenario Recommended Alternative No interaction data rerank (static model)Privacy-sensitive contexts Non-personalized ranking Cold-start users Fall back to rerank Explainability required Standard scoring
Parameters
Parameter Type Default Description model_idstring Required Trained personalization model user_idstring {{INPUT.user_id}}User for personalization featuresarray auto Document features to consider top_ninteger 10Number of results to return exploration_ratefloat 0.1Exploration vs exploitation (0-1) fallbackstring rerankFallback for cold-start
Features
The learned rerank stage can use various document features:
Feature Type Examples Content Category, topic, length, sentiment Metadata Author, date, source, price Engagement Historical CTR, conversion rate Contextual Time of day, device, location
Configuration Examples
Basic Learned Rerank
Custom Features
High Exploration
With Fallback
{
"stage_type" : "sort" ,
"stage_id" : "learned_rerank" ,
"parameters" : {
"model_id" : "search_personalization_v1" ,
"user_id" : "{{INPUT.user_id}}" ,
"top_n" : 10
}
}
How Learned Rerank Works
Feature Extraction : Extract relevant features from each document
User Profile Lookup : Retrieve learned preferences for the user
Score Prediction : Predict engagement probability for each doc
Exploration/Exploitation : Balance known preferences with discovery
Rank : Order by predicted engagement score
Bandit Learning
The system uses contextual bandits to:
Exploit : Rank highly items the user is likely to engage with
Explore : Occasionally show diverse items to learn preferences
Update : Learn from user interactions (clicks, purchases, etc.)
Output Schema
{
"document_id" : "doc_123" ,
"content" : "Document content..." ,
"score" : 0.85 ,
"learned_rerank" : {
"personalization_score" : 0.92 ,
"exploration_boost" : 0.0 ,
"user_segment" : "tech_enthusiast" ,
"top_features" : [ "category:technology" , "source:verified" ]
}
}
Metric Value Latency 20-50ms Model inference Real-time Cold-start fallback Automatic Update frequency Near real-time
Training the Model
Learned rerank models are trained on interaction data:
{
"interaction_type" : "click" ,
"user_id" : "user_123" ,
"document_id" : "doc_456" ,
"query" : "machine learning tutorials" ,
"position" : 3 ,
"features" : {
"category" : "education" ,
"author_verified" : true ,
"length" : "long"
}
}
Contact Mixpeek support to set up learned rerank model training for your use case.
Common Pipeline Patterns
Personalized Search
[
{
"stage_type" : "filter" ,
"stage_id" : "semantic_search" ,
"parameters" : {
"query" : "{{INPUT.query}}" ,
"vector_index" : "text_extractor_v1_embedding" ,
"top_k" : 100
}
},
{
"stage_type" : "sort" ,
"stage_id" : "learned_rerank" ,
"parameters" : {
"model_id" : "search_personalization_v1" ,
"user_id" : "{{INPUT.user_id}}" ,
"top_n" : 20
}
}
]
Hybrid Personalization
[
{
"stage_type" : "filter" ,
"stage_id" : "hybrid_search" ,
"parameters" : {
"query" : "{{INPUT.query}}" ,
"vector_index" : "text_extractor_v1_embedding" ,
"top_k" : 50
}
},
{
"stage_type" : "sort" ,
"stage_id" : "rerank" ,
"parameters" : {
"model" : "bge-reranker-v2-m3" ,
"top_n" : 30
}
},
{
"stage_type" : "sort" ,
"stage_id" : "learned_rerank" ,
"parameters" : {
"model_id" : "user_preferences_v2" ,
"user_id" : "{{INPUT.user_id}}" ,
"exploration_rate" : 0.15 ,
"top_n" : 10
}
}
]
E-Commerce Product Ranking
[
{
"stage_type" : "filter" ,
"stage_id" : "semantic_search" ,
"parameters" : {
"query" : "{{INPUT.query}}" ,
"vector_index" : "product_embedding" ,
"top_k" : 100
}
},
{
"stage_type" : "filter" ,
"stage_id" : "structured_filter" ,
"parameters" : {
"conditions" : {
"field" : "metadata.in_stock" ,
"operator" : "eq" ,
"value" : true
}
}
},
{
"stage_type" : "sort" ,
"stage_id" : "learned_rerank" ,
"parameters" : {
"model_id" : "product_ranker" ,
"user_id" : "{{INPUT.user_id}}" ,
"features" : [
"metadata.category" ,
"metadata.price" ,
"metadata.brand" ,
"engagement.purchase_rate"
],
"top_n" : 24
}
}
]
Comparison with Other Reranking
Stage Personalized Learning Latency rerankNo Static model 50-100ms learned_rerankYes Online learning 20-50ms mmrNo N/A 10-50ms
Privacy Considerations
Aspect Implementation User data Aggregated features only Opt-out Supported via user settings Data retention Configurable per organization Anonymization User IDs can be hashed
Error Handling
Error Behavior Unknown user_id Use fallback ranker Model not found Fail with error Missing features Use available features Timeout Return unranked results
Rerank - Static cross-encoder reranking
MMR - Diversity-aware ranking
Interactions - Logging user interactions