In this article
  1. Before you start
  2. Why interviewers ask this
  3. Multi-task ranking from first principles
  4. Worked example
  5. Trade-offs and edge cases
  6. How to answer it in an interview
  7. Common mistakes
  8. Follow-up questions
  9. Sources

Before you start

This page is one step of the recommendation system design guide.

Why interviewers ask this

Candidates report this topic in machine learning system design rounds, for example when an interviewer asks what changes if the business wants the type of engagement and not one engagement probability. The question separates people who name a model from people who know what is trained, what is served and where the two differ.

A weak answer says "predict click and like with one network." A strong answer names the heads, writes the loss as a weighted sum, and says the ranking weights are a separate product choice. A Staff-level answer adds what breaks: tasks that fight each other, rare labels and logged data that only covers items the old system showed.

Multi-task ranking from first principles

Output head
An output head is the last small part of a neural network that turns the shared internal representation into one prediction, such as the probability of a click, so a model with several heads makes several predictions from one pass over the same input.
Fusion score
A fusion score is the single number used to sort candidates, built by multiplying each head's prediction by a weight and adding the results, so one ordered list comes out of several different predictions.
Negative transfer
Negative transfer is the loss in accuracy on one task that happens when it is trained together with another task whose needs differ, so the joint model does worse than a model trained on that task alone.
Multi-gate mixture-of-experts (MMoE)
A multi-gate mixture-of-experts is a layer that replaces one shared body with several shared expert networks and gives each task its own gate, a small softmax that decides how much of each expert that task uses.

In plain words

Think of a restaurant critic. The critic tastes one dish. Then the critic fills in separate scores for flavour, presentation and value. One tasting feeds all the scores. The analogy breaks where the scores meet. The critic's final grade is a human choice about what matters. A recommender needs that choice written down as numbers.

In precise terms, a multi-task ranking model learns one shared representation of a user, an item and their context. It adds one head per response. Later it combines the heads into one ordering.

Step 1: One shared body feeds one head per user response

A multi-task ranking model has one shared body that reads the user, the item and the context, and one output head per user response. Input: features of one user and one candidate. Output: several numbers, for example the probability of a click, of a like and of a share, plus perhaps a regression head for watch time.

Several heads exist because responses differ in base rate and in value: clicks are common and shallow, shares are rare and strong. A single blended label hides that trade-off. Sharing the body is called hard parameter sharing in Ruder's overview of multi-task learning and saves compute, since one pass serves every head. Zhao et al. (2019) describe a YouTube ranking system with several competing objectives. You now know the shape: one body, many heads. The next step shows how the heads become one ordered list.

Step 2: Fusion weights turn head outputs into one ranking score

A fusion score turns the heads' predictions into one number per candidate: the score is the sum over tasks of a weight times that head's probability. Input: the head outputs for each candidate. Output: one score, used only to sort.

The weights express what the product values and are tuned against product goals. Take two candidate videos with illustrative predictions: video A has click 0.10, like 0.02 and share 0.005; video B has click 0.20, like 0.01 and share 0.001. With equal weights of 1, video B scores 0.211 and video A 0.125, so B ranks first. With weights 1, 5 and 20, video A scores 0.30 and video B 0.27, so A ranks first.1

The model did not change. Only the fusion weights did, which is why they are a business decision. They are separate from the loss weights of Step 3, which shape training.

Step 3: A weighted sum of task losses trains all the heads together

The training loss of a multi-task ranking model is a weighted sum of one loss per head. Input: a batch of impressions with a label per task. Output: one number to minimise, which pushes the shared body toward all tasks at once.

L=∑twtLt

Binary heads such as click use cross-entropy loss, and a regression head such as watch time uses a regression loss. The TensorFlow Recommenders multi-task tutorial treats the loss weights as hyperparameters: a large weight on one task makes the model focus on that task. Raising a loss weight changes what the body learns; it does not change how candidates are sorted afterwards, because sorting uses the fusion weights of Step 2. Tuning the two sets of weights is two separate jobs with two separate checks.

Step 4: Per-task gates over shared experts reduce interference

A multi-gate mixture-of-experts gives each task its own softmax gate over a pool of shared expert networks. Input: the same features. Output: for each task, a mix of expert outputs chosen by that task's gate.

Ma et al. (2018) introduced it because multi-task models can suffer when tasks are only weakly related. Gates let related tasks lean on the same experts and unrelated tasks lean on different ones. Tang et al. (2020) name two failures, negative transfer and what they call the seesaw effect, and propose Progressive Layered Extraction (PLE), which adds task-specific experts beside shared ones.

The failure called seesaw effect is one where a task improves while another task degrades. In the diagram, the experts replace the single shared body, and each task's gate weights the expert outputs that feed that task's head. Zhao et al. combine a mixture of experts with a shallow tower that models selection bias. You now have the whole system: heads, a fusion score, a weighted loss and gated experts.

Shared layers feed heads that serve two different jobsA shared body feeds click, like and share heads. All three heads feed a fusion score used for sorting and a weighted loss used for training. In the gated design, shared experts feed the heads through per-task gates.Sharedbodyuser, item,contextClickheadLikeheadShareheadFusionscoreserving:sortsWeightedlosstrainingonlySharedexpertsreplacethe bodyTask gatesper-tasksoftmaxDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/multi-task-ranking.html

One shared body feeds several heads, and the heads serve two different jobs: a ranking score at serving and a weighted loss in training.CC BY 4.0 — source: What is multi-task ranking, and how does it work?
Step-by-step description
  1. One body, one head per response.
  2. Weighted heads give one ranking score.
  3. Task losses are weighted for training.
  4. Per-task gates mix shared experts.
  • A multi-task ranking model has one shared body and one output head per user response.
  • A fusion score turns all the heads' predictions into one number per candidate.
  • A weighted sum of all the task losses trains the heads together.
  • Per-task gates weight shared experts, and the gated outputs feed the heads.

Knowing it is half the job. Saying it is the other half.

Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.

Start Free Trial →

Worked example

Four impressions with three tasks show the loss by hand. The labels and predictions are illustrative. With loss weights of 1, 2 and 4, the mean cross-entropy is 0.3284 for click, 0.4415 for like and 0.3214 for share. The weighted terms are 0.3284, 0.8830 and 1.2855, so the training loss is 2.497, against 1.0913 with equal weights.1 The share head has the lowest mean loss (0.3214) yet contributes the largest term (1.2855), only because its loss weight is the largest.

For the gates, take three shared experts with illustrative outputs 1.0, -0.5 and 2.0. A click gate with logits 1, 0, 0 gives expert weights 0.5761, 0.2119 and 0.2119, so the click head sees a mix of 0.894. A share gate with logits 0, 0, 1 gives 0.2119, 0.2119 and 0.5761, a mix of 1.2582.1 The same experts feed both heads in different proportions.

With equal fusion weights video B wins, with weights 1, 5 and 20 video A wins, and the training loss changes with its own separate weights.
QuantityValue (illustrative)
Fusion score of video A, equal weights0.125
Fusion score of video B, equal weights0.211
Fusion score of video A, weights 1, 5, 200.30
Fusion score of video B, weights 1, 5, 200.27
Training loss, loss weights 1, 2, 42.497
Training loss, equal loss weights1.0913
Click gate mix0.894
Share gate mix1.2582
Fusion weights alone can reverse the order of two videosGrouped bars of illustrative fusion scores: with equal weights video B scores 0.211 and video A 0.125, and with weights 1, 5 and 20 video A scores 0.3 and video B 0.27.Fusion score00.20.4Equal1, 5, 20Fusion weightsVideo AVideo B0.1250.30.2110.27Diagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/multi-task-ranking.html
Changing only the fusion weights reverses the order of the same two videos.CC BY 4.0 — source: What is multi-task ranking, and how does it work?
Text description of the diagram
  • With equal fusion weights video B scores 0.211 and video A scores 0.125.
  • With weights 1, 5 and 20 video A scores 0.30 and video B scores 0.27.

Trade-offs and edge cases

Sharing parameters trades cost and data efficiency against interference. Each design in the figure below sits at a different point on that line.

Each sharing design trades cost against interferenceTable comparing hard parameter sharing, multi-gate mixture-of-experts and progressive layered extraction by what the tasks share and which risk each design targets.QuestionHardsharingMMoEPLEWhat is sharedone bodyexperts,own gatesshared andown expertsCostlowestmoreexpertsmostexpertsRisk targetednoneweak tasklinksseesaweffectDiagram: Interview Clozo, CC BY 4.0 ·interview.clozo.ai/blog/multi-task-ranking.html
The designs differ in how much of the model every task shares, which decides how much one task can disturb another.CC BY 4.0 — source: What is multi-task ranking, and how does it work?
Text description of the diagram
  • Hard parameter sharing uses one shared body for all tasks.
  • A multi-gate mixture-of-experts gives each task its own gate over shared experts.
  • Progressive layered extraction adds task-specific experts beside shared ones.

The fusion score is not always a linear sum: some systems combine heads multiplicatively, as a product of probabilities each raised to a power, and the weighted sum is the simplest form. Either form assumes the head probabilities are calibrated, meaning a predicted 0.1 happens about one time in ten; a miscalibrated head silently distorts the fusion score.

More tasks do not always help. Negative transfer and the seesaw effect, both named by Tang et al., mean a new head can lower an existing one, so each added task needs a held-out check on every other task.

Rare labels are hard: a share head sees few positives, and new items have no history, a problem covered in the cold start problem in recommender systems.

Logged data is biased. Items appear in the logs only because an earlier system showed them, called selection bias, and position changes clicks; Zhao et al. add a shallow tower for it. Clicks alone can reward clickbait, so satisfaction signals are added as further heads, as Zhao et al. describe.

How to answer it in an interview

Interviewer asks

How would you build a ranking model when the business wants likes, comments and shares, not just clicks?

A strong answer

I would use multi-task ranking: a shared body over user, item and context features, with one head per response. I train with a weighted sum of per-task losses, cross-entropy for the binary heads. At serving I combine head probabilities into one score with separate fusion weights that the product team tunes. Where tasks interfere, I would use per-task gates over shared experts. I would watch for negative transfer, rare labels like shares, and selection bias in the logs.

The spoken structure: name the heads, give the loss, separate loss weights from fusion weights, then name what breaks.

Common mistakes

  • "One head predicting engagement is enough." (wrong) Engagement types differ in base rate and value, and one label hides that. (right) "I predict each response separately and weight them when ranking."
  • "The loss weights are the ranking weights." (wrong) They shape training only. (right) "Loss weights train the body; fusion weights sort candidates, and I tune them separately."
  • "More tasks always help." (wrong) Negative transfer and the seesaw effect show they can hurt. (right) "I add a task only if the other tasks hold up on held-out data."
  • "Click probability is the objective." (wrong) It can reward clickbait. (right) "I pair clicks with satisfaction signals."

Follow-up questions

What are the challenges with multitask learning?

The main ones are negative transfer, the seesaw effect, choosing loss weights, rare labels for some tasks and selection bias in logged data. Mixture-of-experts gates and task-specific experts target the first two.

What is the cost function for it?

It is a weighted sum of per-task losses, with cross-entropy for binary heads and a regression loss for continuous ones such as watch time. The weights are hyperparameters, as the TensorFlow Recommenders tutorial describes.

What if I want the probability of the type of engagement (like, comment, share)?

Add one head per type, each with its own label and loss, on the same shared body. At serving, weight the type probabilities by how much each type is worth to the business.

What are we trying to optimize in a ranking system?

State a business goal, then pair metrics so one cannot be gamed alone, for example click-through rate paired with bounce rate, so that clickbait that gets clicks but is left at once does not look like a win. Each metric maps to a head or to the fusion weights.

How do you choose the loss weights?

Treat them as hyperparameters and search them, with a grid or Bayesian search, scored on a held-out set against the metrics the product cares about. Alternatively learn them: Kendall, Gal and Cipolla (2018) weigh each task's loss by its learned uncertainty, an option that avoids hand tuning. Keep this separate from the fusion weights.

Does a single combined classifier still have a place next to the task heads?

A single combined classifier is a cheap baseline and a useful comparison, but it hides which response drives the score. The recommendation system design guide places ranking inside the full pipeline.

Key takeaways
  • Multi-task ranking uses one shared body and one head per user response.
  • Fusion weights sort candidates; loss weights train the body; tune them separately.
  • Per-task gates over shared experts reduce interference between weakly related tasks.
  • Negative transfer, rare labels and selection bias are the failure modes to name.

Sources

  1. Recommending What Video to Watch Next: A Multitask Ranking System — ACM RecSys 2019 (Zhao et al.); accessed 2026-10-26, 10 Sep 2019
  2. Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts — ACM KDD 2018 (Ma et al.); accessed 2026-10-26, 19 Jul 2018
  3. Progressive Layered Extraction (PLE): A Novel Multi-Task Learning Model for Personalized Recommendations — ACM RecSys 2020 (Tang et al.); accessed 2026-10-26, 22 Sep 2020
  4. An Overview of Multi-Task Learning in Deep Neural Networks (arXiv 1706.05098) — arXiv (Ruder); accessed 2026-10-26, 15 Jun 2017
  5. Multi-Task Learning Using Uncertainty to Weigh Losses for Scene Geometry and Semantics (arXiv 1705.07115) — arXiv (Kendall, Gal, Cipolla); v3, read 2026-10-26, 24 Apr 2018
  6. Multi-task recommenders — TensorFlow Recommenders documentation (undated page; read 2026-10-26), 26 Oct 2026