← Open Source
median-research-group

LibMTL

A PyTorch Library for Multi-Task Learning.

Model DevelopmentDeep Learning FrameworksPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
2.59k
Stars
233
Forks
+-1
This week
4
Contributors
Created 2021-12-18 · Updated 2026-10-11 · #8492 today
Top developers
Baijiong-Linmedian-research-groupValerianRey

median-research-group/LibMTL is ranked 8,492 with 2,593 stars.

Same-category comparison

median-research-group/LibMTL is ranked 8,492 among these 8 peers; alibaba/pipcook is ranked 8,491.

Same-category comparison
NameRankMetrics
knazeri/edge-connect8,475
Language:
Python
Stars:
2,622
Forks:
526
Description:
EdgeConnect: Structure Guided Image Inpainting using Edge Prediction, ICCV 2019 https://arxiv.org/abs/1901.00212.
meta-pytorch/torchrec8,479
Language:
Python
Stars:
2,613
Forks:
708
Description:
Pytorch domain library for recommendation systems.
coqui-ai/STT8,485
Language:
C++
Stars:
2,604
Forks:
295
Description:
🐸STT - The deep learning toolkit for Speech-to-Text. Training and deploying STT models has never been so easy.
alibaba/pipcook8,491
Language:
TypeScript
Stars:
2,594
Forks:
212
Description:
Machine learning platform for Web developers.
s3prl/s3prl8,508
Language:
Python
Stars:
2,569
Forks:
538
Description:
Self-Supervised Speech Pre-training and Representation Learning Toolkit.
MaybeShewill-CV/lanenet-lane-detection8,510
Language:
Python
Stars:
2,568
Forks:
891
Description:
Unofficial implemention of lanenet model for real time lane detection.
yifan123/flow_grpo8,514
Language:
Python
Stars:
2,553
Forks:
172
Description:
[NeurIPS 2025] An official implementation of Flow-GRPO: Training Flow Matching Models via Online RL.
automl/Auto-PyTorch8,524
Language:
Python
Stars:
2,540
Forks:
299
Description:
Automatic architecture search and hyperparameter optimization for PyTorch.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryDeep Learning Frameworks
Stars2,593
Forks233
Contributors4
Created date2021-12-18
Updated date2026-10-11
Stars in 1 day0
Stars in 7 days-1
Rank8,492
Previous rank8,553
Rank change61
7-day stars rank16,878
Previous 7-day stars rank16,884
7-day stars rank change6
Total stars rank5,127
Previous total stars rank5,120
Total stars rank change-7
README summary

LibMTL LibMTL is an open-source library built on PyTorch for Multi-Task Learning (MTL). See the latest documentation for detailed introductions and API instructions. :bangbang: A comprehensive survey on **Gradient-based Multi-Objective Deep Learning** is now available on arXiv, along with an awesome list. News **[Apr 21 2025]** Added support for UPGrad. **[Feb 18 2025]** Added support for a bilevel method Auto-Lambda (TMLR 2022). **[Feb 17 2025]** Added support for FAMO (NeurIPS 2023), SDMGrad (NeurIPS 2023), and

MoDo (NeurIPS 2023; JMLR 2024). **[Feb 06 2025]** Added support for two bilevel methods: MOML (NeurIPS 2021; AIJ 2024), FORUM (ECAI 2024). **[Sep 19 2024]** Added support for FairGrad (ICML 2024). **[Aug 31 2024]** Added support for ExcessMTL (ICML 2024). **[Jul 24 2024]** Added support for STCH (ICML 2024). **[Feb 08 2024]** Added support for DB-MTL. **[Aug 16 2023]**: Added support for MoCo (ICLR 2023). Many thanks to the author's help @heshandevaka. **[Jul 11 2023]** Paper got accepted to

JMLR. **[Jun 19 2023]** Added support for Aligned-MTL (CVPR 2023). **[Mar 10 2023]**: Added QM9 and PAWS-X examples. **[Jul 22 2022]**: Added support for Nash-MTL (ICML 2022). **[Jul 21 2022]**: Added support for Learning to Branch (ICML 2020). **[Mar 29 2022]**: Paper is now available on the arXiv. Table of Content Features Overall Framework Supported Algorithms Supported Benchmark Datasets Installation Quick Start Download Dataset Run a Model Citation Contributor Contact Us Acknowledgements License Features **Unified**: LibMTL provides

a unified code base to implement and a consistent evaluation procedure including data processing, metric objectives, and hyper-parameters on several representative MTL benchmark datasets, which allows quantitative, fair, and consistent comparisons between different MTL algorithms. **Comprehensive**: LibMTL supports many state-of-the-art MTL methods including 8 architectures and 16 optimization strategies. Meanwhile, LibMTL provides a fair comparison of several benchmark datasets covering different fields. **Extensible**: LibMTL follows the modular design principles, which allows users to flexibly and conveniently

add customized components or make personalized modifications. Therefore, users can easily and fast develop novel optimization strategies and architectures or apply the existing MTL algorithms to new application scenarios with the support of LibMTL . Overall Framework Each module is introduced in Docs. Install Quick Start We use the NYUv2 dataset as an example to show how to use LibMTL . Download Dataset The NYUv2 dataset we used is pre-processed by mtan. Run a Model The complete training code for the

NYUv2 dataset is provided in examples/nyu. py is the main file for training on the NYUv2 dataset. You can find the command-line arguments by running the following command. For instance, running the following command will train an MTL model with EW and HPS on NYUv2 dataset. Citation If you find LibMTL useful for your research or development, please cite the following: Contributor LibMTL is developed and maintained by Baijiong Lin. Contact Us If you have any question or

suggestion, please feel free to contact us by raising an issue or sending an email to bj. Acknowledgements We would

Frequently asked questions

How many stars and forks are recorded?

median-research-group/LibMTL has 2,593 stars and 233 forks.

What is the repository rank?

median-research-group/LibMTL is ranked 8,492.

What language and category are recorded?

median-research-group/LibMTL has 2,593 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

median-research-group/LibMTL is compared with alibaba/pipcook, ranked 8,491 with 2,594 stars.

README

LibMTL

LibMTL is an open-source library built on PyTorch for Multi-Task Learning (MTL). See the latest documentation for detailed introductions and API instructions.

:star: Star us on GitHub — it motivates us a lot!

:bangbang: A comprehensive survey on Gradient-based Multi-Objective Deep Learning is now available on arXiv, along with an awesome list. Check it out!

News

  • [Apr 21 2025] Added support for UPGrad.
  • [Feb 18 2025] Added support for a bilevel method Auto-Lambda (TMLR 2022).
  • [Feb 17 2025] Added support for FAMO (NeurIPS 2023), SDMGrad (NeurIPS 2023), and MoDo (NeurIPS 2023; JMLR 2024).
  • [Feb 06 2025] Added support for two bilevel methods: MOML (NeurIPS 2021; AIJ 2024), FORUM (ECAI 2024).
  • [Sep 19 2024] Added support for FairGrad (ICML 2024).
  • [Aug 31 2024] Added support for ExcessMTL (ICML 2024).
  • [Jul 24 2024] Added support for STCH (ICML 2024).
  • [Feb 08 2024] Added support for DB-MTL.
  • [Aug 16 2023]: Added support for MoCo (ICLR 2023). Many thanks to the author's help @heshandevaka.
  • [Jul 11 2023] Paper got accepted to JMLR.
  • [Jun 19 2023] Added support for Aligned-MTL (CVPR 2023).
  • [Mar 10 2023]: Added QM9 and PAWS-X examples.
  • [Jul 22 2022]: Added support for Nash-MTL (ICML 2022).
  • [Jul 21 2022]: Added support for Learning to Branch (ICML 2020). Many thanks to @yuezhixiong (#14).
  • [Mar 29 2022]: Paper is now available on the arXiv.

Table of Content

Features

  • Unified: LibMTL provides a unified code base to implement and a consistent evaluation procedure including data processing, metric objectives, and hyper-parameters on several representative MTL benchmark datasets, which allows quantitative, fair, and consistent comparisons between different MTL algorithms.
  • Comprehensive: LibMTL supports many state-of-the-art MTL methods including 8 architectures and 16 optimization strategies. Meanwhile, LibMTL provides a fair comparison of several benchmark datasets covering different fields.
  • Extensible: LibMTL follows the modular design principles, which allows users to flexibly and conveniently add customized components or make personalized modifications. Therefore, users can easily and fast develop novel optimization strategies and architectures or apply the existing MTL algorithms to new application scenarios with the support of LibMTL.

Overall Framework

Each module is introduced in Docs.

Supported Algorithms

LibMTL currently supports the following algorithms:

Optimization Strategies Venues Arguments
Equal Weighting (EW) - --weighting EW
Gradient Normalization (GradNorm) ICML 2018 --weighting GradNorm
Uncertainty Weights (UW) CVPR 2018 --weighting UW
MGDA (official code) NeurIPS 2018 --weighting MGDA
Dynamic Weight Average (DWA) (official code) CVPR 2019 --weighting DWA
Geometric Loss Strategy (GLS) CVPR 2019 Workshop --weighting GLS
Projecting Conflicting Gradient (PCGrad) NeurIPS 2020 --weighting PCGrad
Gradient sign Dropout (GradDrop) NeurIPS 2020 --weighting GradDrop
Impartial Multi-Task Learning (IMTL) ICLR 2021 --weighting IMTL
Gradient Vaccine (GradVac) ICLR 2021 --weighting GradVac
Conflict-Averse Gradient descent (CAGrad) (official code) NeurIPS 2021 --weighting CAGrad
MOML NeurIPS 2021 --weighting MOML
Nash-MTL (official code) ICML 2022 --weighting Nash_MTL
Random Loss Weighting (RLW) TMLR 2022 --weighting RLW
Auto-Lambda (official code) TMLR 2022 --weighting AutoLambda
MoCo ICLR 2023 --weighting MoCo
Aligned-MTL (official code) CVPR 2023 --weighting Aligned_MTL
FAMO (official code) NeurIPS 2023 --weighting FAMO
SDMGrad (official code) NeurIPS 2023 --weighting SDMGrad
MoDo (official code) NeurIPS 2023 --weighting MoDo
FORUM ECAI 2024 --weighting FORUM
STCH (official code) ICML 2024 --weighting STCH
ExcessMTL (official code) ICML 2024 --weighting ExcessMTL
FairGrad (official code) ICML 2024 --weighting FairGrad
DB-MTL arXiv --weighting DB_MTL
UPGrad (official code) arXiv --weighting UPGrad
Architectures Venues Arguments
Hard Parameter Sharing (HPS) ICML 1993 --arch HPS
Cross-stitch Networks (Cross_stitch) CVPR 2016 --arch Cross_stitch
Multi-gate Mixture-of-Experts (MMoE) KDD 2018 --arch MMoE
Multi-Task Attention Network (MTAN) (official code) CVPR 2019 --arch MTAN
Customized Gate Control (CGC), Progressive Layered Extraction (PLE) ACM RecSys 2020 --arch CGC, --arch PLE
Learning to Branch (LTB) ICML 2020 --arch LTB
DSelect-k (official code) NeurIPS 2021 --arch DSelect_k

Supported Benchmark Datasets

Datasets Problems Task Number Tasks multi-input Supported Backbone
NYUv2 Scene Understanding 3 Semantic Segmentation+
Depth Estimation+
Surface Normal Prediction ✘ ResNet50/
SegNet
Cityscapes Scene Understanding 2 Semantic Segmentation+
Depth Estimation ✘ ResNet50
Office-31 Image Recognition 3 Classification ✓ ResNet18
Office-Home Image Recognition 4 Classification ✓ ResNet18
QM9 Molecular Property Prediction 11 (default) Regression ✘ GNN
PAWS-X Paraphrase Identification 4 (default) Classification ✓ Bert

Installation

  1. Create a virtual environment

    conda create -n libmtl python=3.10
    conda activate libmtl
    
  2. Clone the repository

    git clone https://github.com/median-research-group/LibMTL.git
    
  3. Install LibMTL

    pip install torch==2.3.0+cu121 torchvision==0.18.0+cu121 -f https://download.pytorch.org/whl/torch_stable.html
    pip install torch-scatter==2.1.2+pt23cu121 torch_sparse==0.6.18+pt23cu121 -f https://pytorch-geometric.com/whl/torch-2.3.0+cu121.html
    
    cd LibMTL
    pip install -r requirements.txt
    pip install -e .
    

Quick Start

We use the NYUv2 dataset as an example to show how to use LibMTL.

Download Dataset

The NYUv2 dataset we used is pre-processed by mtan. You can download this dataset here.

Run a Model

The complete training code for the NYUv2 dataset is provided in examples/nyu. The file main.py is the main file for training on the NYUv2 dataset.

You can find the command-line arguments by running the following command.

python main.py -h

For instance, running the following command will train an MTL model with EW and HPS on NYUv2 dataset.

python main.py --weighting EW --arch HPS --dataset_path /path/to/nyuv2 --gpu_id 0 --scheduler step --mode train --save_path PATH

More details is represented in Docs.

Citation

If you find LibMTL useful for your research or development, please cite the following:

@article{lin2023libmtl,
  title={{LibMTL}: A {P}ython Library for Multi-Task Learning},
  author={Baijiong Lin and Yu Zhang},
  journal={Journal of Machine Learning Research},
  volume={24},
  number={209},
  pages={1--7},
  year={2023}
}

Contributor

LibMTL is developed and maintained by Baijiong Lin.

Contact Us

If you have any question or suggestion, please feel free to contact us by raising an issue or sending an email to bj.lin.email@gmail.com.

Acknowledgements

We would like to thank the authors that release the public repositories (listed alphabetically): CAGrad, dselect_k_moe, MultiObjectiveOptimization, mtan, MTL, nash-mtl, pytorch_geometric, and xtreme.

License

LibMTL is released under the MIT license.

Nearby in the ranking
Similar items