How do you combine and weight loss components in a multi-task learning objective?

Quick Overview

Asks how to combine several task losses into one multi-task training objective and how to choose their weights. Tests reasoning about loss scales, gradient conflict between tasks, and the trade-offs between fixed and adaptive weighting schemes.

How do you combine and weight loss components in a multi-task learning objective?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: medium

Interview Round: Other

A model shares an encoder across several tasks, and each task has its own loss. How do you combine and weight the loss components in a multi-task learning objective? ```hint Scales first Compare the typical size of each task's loss, and of its gradient on the shared layers, before choosing any weights. ``` ```hint When weights are not enough Think about a shared parameter whose gradients from two tasks point in opposite directions. Can any choice of weights make both tasks improve? ``` ### What a Strong Answer Covers - The form of the combined objective and why choosing the weights is the hard part - Why equal weights usually fail: loss scale, gradient magnitude, learning speed and conflicting gradients - At least one static approach and at least one adaptive weighting method, with how each works - Methods that change the gradients themselves when tasks conflict - A practical way to pick and check the weights, including per-task monitoring ### Follow-up Questions - In uncertainty weighting, why is the $\log \sigma_i$ term needed, and what happens to the learned weights without it? - With Adam as the optimizer, does multiplying one task's loss by 10 do the same thing as with plain SGD? Which parameters does it affect? - How would you set the weight of an auxiliary task whose only purpose is to help the main task? - How do you tell negative transfer apart from a bad choice of weights?

Overview: Asks how to combine several task losses into one multi-task training objective and how to choose their weights. Tests reasoning about loss scales, gradient conflict between tasks, and the trade-offs between fixed and adaptive weighting schemes.

General logo
General
Nov 24, 2026
mediumMachine Learning EngineerOtherMachine Learning
0
0

A model shares an encoder across several tasks, and each task has its own loss. How do you combine and weight the loss components in a multi-task learning objective?

What a Strong Answer Covers Guidance

  • The form of the combined objective and why choosing the weights is the hard part
  • Why equal weights usually fail: loss scale, gradient magnitude, learning speed and conflicting gradients
  • At least one static approach and at least one adaptive weighting method, with how each works
  • Methods that change the gradients themselves when tasks conflict
  • A practical way to pick and check the weights, including per-task monitoring

Follow-up Questions Guidance

  • In uncertainty weighting, why is the log⁡σi\log \sigma_i term needed, and what happens to the learned weights without it?
  • With Adam as the optimizer, does multiplying one task's loss by 10 do the same thing as with plain SGD? Which parameters does it affect?
  • How would you set the weight of an auxiliary task whose only purpose is to help the main task?
  • How do you tell negative transfer apart from a bad choice of weights?