feat(aggregation): Add ExcessMTL#747
Merged
ValerianRey merged 8 commits intoJun 24, 2026
Merged
Conversation
5143ce9 to
d4a29f8
Compare
d4a29f8 to
5a6358f
Compare
This was referenced Jun 20, 2026
ValerianRey
requested changes
Jun 23, 2026
ValerianRey
left a comment
Member
There was a problem hiding this comment.
Tyvm for the PR! This is only a partial review, but it's gonna be easier to review the rest after those things are adressed I think.
ValerianRey
reviewed
Jun 23, 2026
Member
|
Ty for the updates! This is much cleaner! I'll make the thorough round of review soon |
ValerianRey
reviewed
Jun 24, 2026
ValerianRey
left a comment
Member
There was a problem hiding this comment.
Very good job ty!
It's honestly one of the hardest implementations we've ever made!
Got a few things to fix still, and then we can merge.
ValerianRey
approved these changes
Jun 24, 2026
…essMTL Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(aggregation): Add ExcessMTLWeighting
Implements
ExcessMTLWeightingfrom Robust Multi-Task Learning with Excess Risks (He et al., ICML 2024).At each forward call, per-task excess risks are estimated via a second-order Taylor approximation (Equations 6-7) using an AdaGrad-style diagonal Hessian accumulated across all calls. Task weights are then updated via an exponentiated gradient step (Equation 9) and normalised to the probability simplex.
Design notes
_grad_sum([m, n], accumulates squared gradients) and_weights([m], current task weights). Both move with.to(device)and appear instate_dict().n_warmup_steps, default0): during warmup, weights stay uniform and gradient statistics are collected. On the first post-warmup call, the average excess risk over the warmup period is saved as a normalisation baseline (initial_w), following Appendix C.1. Settingn_warmup_steps=0matches the official implementation and LibMTL behaviour (first call's excess used as baseline directly).[1/m, ..., 1/m]and always sum to 1, following the paper (vs. LibMTL's sum-to-m)._n_steps: stored as a registered buffer (scalartorch.long) so warmup progress survives checkpointing. Zeroed in-place inreset()to preserve device placement.References