M7-048M7: Retrieval, Ranking & RecSys学习排序 (LTR)Medium
⚡Flashcard Drill➔Mastery:

Explain the Taxonomy and Classification of Ranking Features in Search and Recommendation

🎯 Active Recall Self-Check (Draft First, Verify After)
Login-free practice tracker: recall core answer, audit pitfalls, and log review status.
Step 1 · Draft your concise answer & assumptions
Step 2 · Check Pitfalls & Follow-up Inquiries
Next: M7-049 →
📐 Mathematical Definition
features: query+doc+query-doc+context\text{features}:\ \text{query}+\text{doc}+\text{query-doc}+\text{context}
⚡ One-Sentence Core Answer
Ranking features are systematically categorized into query features, document/item features, query-document interaction features, and user context features; dense interaction features deliver the strongest discriminative power but demand the highest compute.

📌 Key Takeaways

  • •
    Four-quadrant taxonomy: Query features (intent, length), Document features (quality, historical CTR), Interaction features (BM25, cosine similarity), User/Context features (device, location, real-time session).
  • •
    Cross-interaction dominance: Features measuring exact and semantic alignment between query and candidate account for 60%+ of ranking model gain.
  • •
    Precomputation economics: Item and query features can be precomputed offline; interaction and user context features must be computed live in real-time.

📐 Mathematical Derivations

Systematic & Architectural Taxonomy: The Four Feature Pillars.

(1) Query-Only Features (Q-Features):
Independent of candidate documents. Evaluated once per query request:
- Syntactic: Query token count, character length, language ID, punctuation presence.
- Semantic Intent: Navigational, informational, transactional classification probabilities.
- Historical & Popularity: Historical query frequency, historical query reformulation rate, seasonal query trends.

(2) Document / Item-Only Features (D-Features):
Independent of incoming queries. Precomputed offline and cached in low-latency stores (Redis / Feature Store):
- Intrinsic Quality: PageRank score, spam likelihood score, content length, visual aesthetic score, brand authority rating.
- Behavioral Priors: 7-day impression count, historical global click-through rate (CTRpriorCTR_{\text{prior}}), conversion rate, return rate.
- Freshness: Elapsed hours since publication/update: Δt=tnow−tpub\Delta t = t_{\text{now}} - t_{\text{pub}}.

(3) Query-Document Interaction Features (QD-Features):
The core engine of relevance. Must be evaluated dynamically for all KK candidates:
- Lexical Matching: BM25 score, TF-IDF score, exact match in title/body/URL/anchor, phrase proximity distance, cover density.
- Dense Semantic Similarity: Bi-encoder cosine similarity E(q)TE(d)E(q)^T E(d), ColBERT MaxSim score, cross-encoder logit score.
- Behavioral Intersection: Historical co-click frequency for pair (q,d)(q, d) across historical search logs.

(4) User & Context Features (U/C-Features):
Captures personal preferences and real-time situational environment:
- User Profile: Long-term interest category embeddings, purchasing power tier, age/gender demographics.
- Real-Time Session: Embeddings of last 5 clicked items in current session, dwell time on previous document.
- Contextual Environment: Geolocation, client device type (iOS/Android/Desktop), network speed (5G/WiFi), hour of day, day of week.

🏭 Production Trade-offs

In-Depth Analysis & Engineering Trade-offs: ① The compute hierarchy vs. latency budget—D-features are 100% precomputed offline and fetched via bulk key-value lookups (<1 ms< 1\text{ ms}); QD-features (e.g., cross-encoders or complex ngram proximity) must be computed for all KK candidates in real time (10–25 ms10\text{--}25\text{ ms}). Allocating expensive interaction features strictly to downstream fine ranking protects upstream coarse ranking budgets. ② Target encoding & high-cardinality ID features—using raw categorical IDs (user_id, item_id) causes extreme sparsity and overfitting; hashing tricks (Hashing Vectorizer) or learned low-dimensional embeddings (e.g., 64-dim entity vectors) represent items robustly. ③ Historical CTR smoothing (Bayesian Smoothing)—for cold-start documents with 2 impressions and 1 click, raw CTR is 50%; using beta-binomial empirical Bayes smoothing: CTR~=clicks+αimpressions+α+β\widetilde{\text{CTR}} = \frac{\text{clicks} + \alpha}{\text{impressions} + \alpha + \beta} shrinks unreliable estimates toward the global prior. ④ Real-time streaming features vs. batch features—features computed via streaming engines (Flink / Kafka) within 5 seconds of user action (e.g., 'viewed shoe category 3 times in last 2 minutes') produce 3x higher feature importance than 24-hour batch aggregations. ⑤ Feature drift and correlation management—highly correlated features (e.g., BM25 title score and BM25 body score) cause tree models to split inconsistently; pruning collinear features speeds up inference by 20% with zero metric degradation. ⑥ Interview takeaway—structure features into the standard four quadrants (Query, Document, Query-Doc Interaction, User/Context), explain why interaction features dominate relevance, detail Bayesian smoothing for cold-start CTR, and address real-time streaming feature infrastructure.
⚠️ Common Interview Pitfalls
  • ✕
    Attempting to evaluate complex query-document cross-encoder interactions at the coarse ranking stage on thousands of candidates, breaching SLAs.
  • ✕
    Using unsmoothed raw historical CTR on low-impression cold items, allowing items with 1 click on 1 impression (100% CTR) to dominate rankings.
  • ✕
    Failing to separate precomputable static document features from dynamic real-time interaction features in feature store architectures.
🎯 Interviewer Follow-up Inquiries
  • ?
    How does Empirical Bayes (Beta-Binomial) smoothing prevent cold-start CTR estimates from distorting ranking scores?
  • ?
    What streaming feature infrastructure (e.g., Flink + Redis) guarantees sub-second updates for real-time user session features?
  • ?
    Why do query-document interaction features contribute the highest SHAP importance in search ranking compared to user demographic features?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

← PreviousM7-047: Explain Position Bias in Search Ranking and Algorithmic Debiasing via Inverse Propensity Scoring (IPS)📋 Back to BankNext →M7-049: Explain Multi-Objective Ranking Formulation, Loss Functions, and Pareto Optimization