Exploring Re-Ranking Strategies for E-commerce Search
Coen Baars, Arian Stolwijk
26 November 2024
Coen Baars
CTO & Co-founder at Giftomatic
Tech-enthusiast with 20 years of experience in Search Relevance, Web Development, and UX
Rotterdam, the Netherlands
Arian Stolwijk
Head of Engineering at Giftomatic
Amersfoort, the Netherlands
About Giftomatic�
Today’s Agenda
A “simple” search example
How to improve search results using rerankers
Conclusion
Alice
Alice is a clever and trendy 16-year old teenager who loves experimenting with makeup and perfecting her style. She has a passion for beauty, fashion.
Amsterdam, the Netherlands
Alice's Christmas Wish List
Alice's Christmas Wish List
The Elves Quest
Time for Santa’s little helpers to start their search for Alice!
Part 1
Lexical Search (BM25)
Lexical Search (BM25)
Query: “Red backpack for School”
User-context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
✅
Semantic Search
Query Vector
[0.12, 5.04, 0.02, 0.93, …, 2.34]
Document Vectors
[0.11, 4.02, 0.00, 1.10, …, 2.54]
[0.0, 99.04, 0.01, 4.93, …, 1.30]
[0.12, 3.52, 0.65, 0.64, …, 9.23]
…
https://www.sbert.net/examples/applications/semantic-search/README.html
similarity(
query_vector,
doc_vector
)
Semantic Search
Semantic Search
Query: “Red backpack for School”
User context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
✅
Hybrid search scores
Hybrid Search
Query: “Red backpack for School”
User context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
Hybrid Search
Query: “Red backpack for School”
User context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
How to improve search results using re-rankers
Overview of various reranking techniques
Part 2
{Arian}
Re-ranker Strategies
Re-ranker Strategies
Reciprocal Rank Fusion
Reciprocal Rank Fusion
Doc | Retriever A | Retriever B | Score A | Score B | Total |
A | 1 | 5 | 1/1 | 1/5 | 1.2 |
B | 2 | 4 | 1/2 | 1/4 | 0.75 |
C | 3 | 3 | 1/3 | 1/3 | 0.5 |
D | 4 | 1 | 1/4 | 1/1 | 1.25 |
E | | 2 | 0 | 1/2 | 0.5 |
Maximal Marginal Relevance (MMR)
RRF/MMR
Query: “Red backpack for School”
User context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
✅
✅
Large Language Models
Large Language Models
Large Language Models
Large Language Model
Query: “Red backpack for School”
User context: “teenager, girl/woman, likes: beauty, fashion, luxury”
Criteria: Create a diverse resultset matching the query and user-context.
Discussion:
Is this what we expected, or do we need to improve?
✅
✅
✅
✅
Other Re-rankers
Re-rankers Spectrum
Simple
Expensive
RRF*
MMR
Learning To Rank*
Cross Encoder*
Rerank API*
LLM
*Supported in elasticsearch, e.g. through 8.16 retrievers
Conclusion
-> Search is difficult
-> Re-rankers are a good way to improve results
-> There is no magical AI solution or a one size fits all
-> Every situation needs a different solution
Thank you for listening!
Time for questions
We are hiring!
Coen Baars
Arian Stolwijk