A Practical Guide to Recommendation System Architecture and Methods
This article provides a concise overview of recommendation systems, covering their definition, core framework of recall, ranking, and re‑ranking, various recall strategies including multi‑path and vector‑based methods, similarity calculations, and practical implementation details such as AB testing and code examples.
1. Overview
This article offers a brief introduction to recommendation systems, explaining their purpose, basic framework, and key components.
2. Product Recommendation System
2.1 Definition of Recommendation System
Recommendation systems address information overload by helping users discover items of interest and uncover latent preferences.
2.2 Architecture
The core pipeline consists of three stages: recall, ranking, and re‑ranking.
Request Flow
When a user opens a page, the front‑end sends user identifiers (e.g., PIN or UUID) to the back‑end. The back‑end selects strategy configurations via AB testing, then invokes the appropriate recall, ranking, and re‑ranking modules. Multiple recall paths generate candidate items, which are sorted, enriched with price and image information, and finally presented. User interactions are logged for later analysis.
Why Use a Recall‑Ranking‑Re‑ranking Funnel?
From a performance perspective, it reduces the candidate set from millions to a few items, controlling the inference cost of complex ranking models. From a goal perspective, each module has distinct responsibilities.
Recall
Recall quickly filters a large item pool to a manageable candidate set. Multi‑path recall combines different strategies or simple models to improve recall rate while maintaining speed.
2.3.1 Advantages and Disadvantages of Multi‑Path Recall
High recall and speed, but each path requires manual tuning and may produce redundant candidates.
2.3.2 Recall Categories
Recall can be divided into non‑personalized and personalized approaches.
Non‑personalized recall: hot items, new arrivals.
Personalized recall: tag‑based, region‑based, collaborative filtering.
Collaborative Filtering
CF includes user‑based, item‑based, and model‑based methods that compute item similarity using cosine similarity or Jaccard index.
Jaccard formula: J(A,B) = |A∩B| / |A∪B|.
Vector Recall
Vectorized recall learns low‑dimensional embeddings for users and items, turning recall into a nearest‑neighbor search, which improves generalization and diversity.
Training can use models such as word2vec; online retrieval employs ANN algorithms like LSH, HNSW, or product quantization.
2.4 Ranking
Ranking refines candidates, with coarse ranking handling large volumes and fine ranking delivering the final order. Wide & Deep models combine a linear “wide” part for memorization with a deep neural part for generalization.
2.5 Re‑ranking
Re‑ranking adjusts the fine‑ranked list to achieve global optimality and meet business goals, using algorithms such as Maximal Marginal Relevance (MMR) to balance relevance and diversity.
def MMR(itemScoreDict, similarityMatrix, lambdaConstant=0.5, topN=20):
s, r = [], list(itemScoreDict.keys())
while len(r) > 0:
score = 0
selectOne = None
for i in r:
firstPart = itemScoreDict[i]
secondPart = 0
for j in s:
sim2 = similarityMatrix[i][j]
if sim2 > secondPart:
secondPart = sim2
equationScore = lambdaConstant * (firstPart - (1 - lambdaConstant) * secondPart)
if equationScore > score:
score = equationScore
selectOne = i
if selectOne is None:
selectOne = i
r.remove(selectOne)
s.append(selectOne)
return (s, s[:topN])[topN > len(s)]3. Conclusion
The article provides a high‑level overview of recommendation systems, outlining their architecture and key modules, and encourages further study and refinement in practical applications.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
JD Cloud Developers
JD Cloud Developers (Developer of JD Technology) is a JD Technology Group platform offering technical sharing and communication for AI, cloud computing, IoT and related developers. It publishes JD product technical information, industry content, and tech event news. Embrace technology and partner with developers to envision the future.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
