Ranking vs matching
- In classic recsys / ads ranking, items are non-rival
- Same reel recommended to a million users costs nothing
- Greedy argmax per request is approximately the global optimum
- Closest exception is ads budget: the budget is rival, and the pacing multiplier is its λ. Same math shows up below
- In matching (jobs, dating), the resource is attention and capacity, which is rival
- If the model surfaces candidate X to 500 recruiters, X can respond to maybe 10
- Greedy per request is provably sub-optimal. Optimal rankings must account for both sides’ preferences and capacity constraints
maximize Σ_{r,c} match_prob(r, c) · x_{r,c}subject to Σ_c x_{r,c} ≤ K_r (recruiter review capacity) Σ_r x_{r,c} ≤ K_c (candidate attention capacity)where x_{r,c} = show candidate c to recruiter r (1) or not (0). The LP relaxes it to a fraction between 0 and 1(LP = Linear Programming)K_r = how many candidates recruiter r can review; K_c = how many messages candidate c can handle
- It is an asymmetric marketplace
- Recruiter reviews ~100 candidates in a session; candidate applies to ~20 jobs
- Volumes, rate limits and session structure differ on both sides
- Dating / matrimony are relatively symmetric
- Running example: candidate recs to a recruiter
- I will use it as reference for this post
- Measuring congestion
- Load: InMails per candidate per week (p95, share going to the top 1% of candidates)
- Overlap: how many recruiters were shown the same candidate in a week
- Damage: reply rate vs inbox load. If reply rate falls as pending messages rise, the candidate is congested
- Flip side: matching candidates who got zero InMails (starvation)
Two probabilities and their labels
p_send(r,c)= P(recruiter messages candidate | shown). Is the candidate suitable?p_reply(r,c)= P(candidate accepts | messaged). Will they respond? This is where “candidate has 30 pending InMails” livesp_match = p_send × p_reply
Two interlocking funnels, joining at the mutual event:
Outbound (recruiter acts first): shown → profile view → InMail sent → InMail accepted ◀Inbound (candidate acts first): shown → view JD → apply ────────────→ recruiter replies ◀ │Joint: interview → offer → hireWe are focus on outbound here. So first mutual event is "In mail accepted"
| p_send | p_reply | |
|---|---|---|
| Positive | InMail sent (or saved to pipeline) | InMail accepted |
| Negative | shown and seen, no action | declined, or no reply after N days |
| Training rows | recruiter impressions | sent InMails only |
| Label latency | minutes | days |
| Density | dense | sparse |
Which label to train on: the earliest event that needs both sides to act. LinkedIn Recruiter uses InMail Accept as the signal of two-way interest (LinkedIn Eng, 2019). One-sided clicks say nothing about mutual fit.
Four things that make the labels hard:
- Delayed terminal label
- Hire lands weeks later. Train on the mutual proxy, validate on hire
- If a change improves reply rate but not hire rate, you’ve started optimizing politeness instead of matching
- Right censoring: no outcome yet ≠ negative
- Wait a window before calling a negative; use fast explicit signals early
- LinkedIn’s applicant model: ~30% of positives known within a day, negatives conclusive after 14 days, earlier negatives inferred if the recruiter replies to later applicants (LinkedIn Eng, 2020)
- Ambiguous negatives (positive-unlabelled data)
- No reply could mean bad fit, recruiter on leave, or req already filled
- Drop rows from inactive recruiters and closed reqs before training
- Selection bias and self-fulfilling labels
- p_reply only sees candidates recruiters chose to message, but it scores everyone shown. Same as CVR in ads: trained on clicks, served on impressions
- Fix: ESMM-style training over the full impression space.
- Supervise
- p_send
- p_send·p_reply
- p_reply is learned implicitly
- Supervise
- Position bias compounds into allocation: whoever ranks high collects labels and stays high. Position feature + small exploration
One model or two?
- (a) Two separate models
- (b) Shared trunk, two heads (standard MTML)
- (c) Shared trunk with expert gating (MMoE / PLE), when the heads start fighting
- MMoE: several shared expert networks; each head has its own gate that picks a mix of experts
- PLE: MMoE plus experts private to each head, so one head’s gradients can’t overwrite the other’s
| Shared trunk + 2 heads | Separate models | |
|---|---|---|
| Sparse p_reply | Dense p_send labels shape the representation the sparse head uses | p_reply trains on little data |
| Selection bias | ESMM trick needs both heads in one graph | Handled separately per model |
| Conflicting features | Negative transfer: inbox load raises p_send (desirable profile) and lowers p_reply (saturated). One head usually loses | Each model uses the feature its own way |
| Label cadence | Waits for the slowest label, or trains on censored p_reply labels | p_send retrains hourly, p_reply daily |
| Ownership | One change retrains both heads; loss weight between heads is one more knob | Independent launches, calibration and debugging |
| Serving | One feature fetch, one call | Two calls, duplicate infra |
- Default: shared trunk + two heads
- Add gating (MMoE/PLE) or keep conflicting features head-specific when per-head metrics show a seesaw
- seesaw – improving one head’s metric makes the other’s worse
- Split p_reply into its own model when label cadence becomes the bottleneck
- Either way, calibrate each head on its own before combining
Combining into one score
Combiners that ignore capacity
- Naive product of two marginals:
p(r→c) × p(c→r)- p(r->c) = recruiter likes candidate
- p(c->r) candidate like recruiter
- Assumes independence. A genuinely good fit pushes both up together, so it understates true matches and overstates one-sided ones
- Understatement for true match
- score – 0.9 * 0.9 = 0.81 ( which is less than 0.9)
- Overstatement if one side is enthusiastic
- score = 0.8 * 0.1 = 0.08
- True mutual match is near 0
- Understatement for true match
- Chain rule:
p_send × p_reply- p_reply is conditional on the message, clean way to write would be p(reply | message)
- P-send = p(r->c)
- This is P(mutual match), not a heuristic. Model the second head conditionally and the product is correct
- Harmonic mean (RECON, dating)
- Harmonic mean of the two one-sided compatibility scores,
2 / (1/s₁ + 1/s₂) - It has no probability meaning
- Punishes imbalance harder than the product: (0.9, 0.1) → 0.18 but (0.3, 0.3) → 0.30, where the product ties both at 0.09
- Other choices in the literature: arithmetic, geometric, weighted mean (survey)
- Harmonic mean of the two one-sided compatibility scores,
- Weighted geometric:
p_send^α · p_reply^β- taking log ->
α·log p_send + β·log p_reply - Candidate-scarce market: candidate attention is the bottleneck, so β > α. Protecting candidates from noise keeps the market liquid
- It flips by segment: senior backend engineers are candidate-scarce, entry-level generalist roles are job-scarce, in the same product at the same time
- taking log ->
- Calibration compounds when you multiply
- 20% overestimate on both heads → 1.2 × 1.2 = 1.44, a 44% overestimate on the product
- A constant miscalibration doesn’t reorder; one that varies by segment does, and any threshold or λ comparison breaks
- Calibrate each head per segment; monitor the product’s calibration separately
- All of these say this pair is likely to match. None says whether the candidate’s attention is better spent elsewhere. That is the job of λ
Adding capacity: the λ term
Refine the candidate constraint. What fills an inbox is messages, not impressions:
Σ_r x_{r,c} · p_send(r,c) ≤ K_c
Relax it with λ_c ≥ 0 (and recruiter capacity with μ_r). The coefficient on each x_{r,c} becomes:
p_send·p_reply − λ_c·p_send − μ_r
Inside one recruiter’s request μ_r is the same for every candidate, so it only sets how many to show. Rank by:
score(r,c) = p_send(r,c) · ( p_reply(r,c) − λ_c )
- λ_c = shadow price of one more message in candidate c’s inbox
- Uncongested candidate: λ_c = 0, the score falls back to the plain product
- Congested candidate (30 pending): λ_c > 0, so they surface only where p_reply is high enough to be worth the slot
- Feature or λ? Both, for different jobs
- Inbox load as a feature keeps p_reply honest about the candidate’s current state
- λ enforces a policy (≤ K_c messages a week) and prices the opportunity cost to other recruiters. A feature alone just predicts lower and lower while recruiters keep messaging
- Feature-only control can oscillate: congested → down-ranked → inbox clears → up-ranked → congested. Let the model estimate affinity; let λ do traffic control
Where λ comes from
A ladder, simplest first:
- Hand-tuned global weight
- One λ (or α, β) picked by A/B. Simple; blind to which candidate is congested
- Forecast + rule-based penalty
- LinkedIn’s LiJAR for job recs: forecast how many applications a job will get by expiry, then promote under-supplied and penalize over-supplied jobs (KDD’17). λ in spirit, rules in practice
- Offline dual solve, online serve
- Solve the dual on a sample of traffic daily or hourly, store λ per entity, rank with the primal-from-dual formula at serve time
- Origin: click shaping via Lagrangian duality. At LinkedIn scale: DuaLip, whose use cases include job-recommendation matching under job-apply budgets
- Online dual ascent (a controller)
- Every window:
λ_c ← max(0, λ_c + η·(messages_c − K_c)) - Self-correcting, no solver. η too large → oscillation, too small → lag. Same loop as ad budget pacing
- Every window:
- Predicted λ
λ_c = f(features of c and its segment). Helps cold-start candidates and smooths millions of noisy λs- One practical recipe: regress on the λs from the offline solve
Tuning the knobs
- What is left to tune once λ_c is computed
- K_c: a product decision. How many InMails a week is too many?
- α, β per segment; the controller step η
- A/B grid
- A few arms, one primary metric plus guardrails. Slow, coarse
- Offline replay (counterfactual / IPS) to prune the grid
- Misses market effects. Replay can’t see two recruiters competing for one candidate
- Online Bayesian optimization
- LinkedIn feed: maximize the primary metric subject to secondary metrics not dropping past a threshold; posterior updated hourly, parameters assigned per member by hashing (Agarwal et al., KDD’18)
- Their feed score already carries a job-apply term:
S = p_VA + x_EFS·p_EFS + x_JA·p_JA
- Experiment design
- Arms compete for the same candidates’ inboxes, so candidate-level randomization leaks
- Randomize by market cluster (geo × job family) or by recruiter, or use switchbacks
- Metrics to watch
- Mutual accepts per recruiter session (primary)
- Hires (lagging check on the proxy)
- p95 InMails per candidate per week (congestion)
- Share of candidates and jobs with zero engagement (starvation)
Summary
One thing worth internalizing again – why don’t we build model to predict p(match) directly ?
Pros of keeping it separate
- Allows traffic control with λ_c
- denser label
- Separate model training cadense
- Not much of a benefit if using ESMM on shared arch
- Easy to debug / explain
- Why the pair did not get the match
- Build new products and monetization opportunities
- “likely to respond” badge for recruiter
Pros of combing
- Calibration error does not multiply
- ESMM is giving you p_match anyways











