{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/dselect-k-differentiable-selection-in-the","title":"DSelect-k: Differentiable Selection in the Mixture of Experts with Applications to Multi-Task Learning","arxiv_id":"2106.03760","date":"2021-06-07","proceeding":"NeurIPS 2021 12","authors":["Hussein Hazimeh","Zhe Zhao","Aakanksha Chowdhery","Maheswaran Sathiamoorthy","Yihua Chen","Rahul Mazumder","Lichan Hong","Ed H. Chi"],"abstract":"The Mixture-of-Experts (MoE) architecture is showing promising results in improving parameter sharing in multi-task learning (MTL) and in scaling high-capacity neural networks. State-of-the-art MoE models use a trainable sparse gate to select a subset of the experts for each input example. While conceptually appealing, existing sparse gates, such as Top-k, are not smooth. The lack of smoothness can lead to convergence and statistical performance issues when training with gradient-based methods. In this paper, we develop DSelect-k: a continuously differentiable and sparse gate for MoE, based on a novel binary encoding formulation. The gate can be trained using first-order methods, such as stochastic gradient descent, and offers explicit control over the number of experts to select. We demonstrate the effectiveness of DSelect-k on both synthetic and real MTL datasets with up to $128$ tasks. Our experiments indicate that DSelect-k can achieve statistically significant improvements in prediction and expert selection over popular MoE gates. Notably, on a real-world, large-scale recommender system, DSelect-k achieves over $22\\%$ improvement in predictive performance compared to Top-k. We provide an open-source implementation of DSelect-k.","url_abs":"https://arxiv.org/abs/2106.03760v3","url_pdf":"https://arxiv.org/pdf/2106.03760v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"dselect-k-differentiable-selection-in-the","repo_url":"https://github.com/google-research/google-research/tree/master/dselect_k_moe","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"jax","reach":null},{"paper_slug":"dselect-k-differentiable-selection-in-the","repo_url":"https://github.com/Andy1314Chen/PaddleRec","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"dselect-k-differentiable-selection-in-the","repo_url":"https://github.com/PaddlePaddle/PaddleRec/tree/master/models/multitask/dselect_k","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"paddle","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"mixture-of-experts","task_name":"Mixture-of-Experts"},{"task_slug":"multi-task-learning","task_name":"Multi-Task Learning"},{"task_slug":"recommendation-systems","task_name":"Recommendation Systems"}],"methods":[{"method_slug":"dselect-k","method_name":"DSelect-k"}],"datasets_introduced":[],"methods_introduced":[{"slug":"dselect-k","name":"DSelect-k","full_name":"DSelect-k"}],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.03760","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.03760"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/PaddlePaddle/PaddleRec/tree/master/models/multitask/dselect_k","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/google-research/google-research/tree/master/dselect_k_moe","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Andy1314Chen/PaddleRec","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":1,"unverified":8},"by_repo_kind":{"official":{"samples":2,"ran":1,"repositories":1},"listed":{"samples":7,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"c7f7716bc175db79","entry":"SmoothStep","repo":"google-research/google-research","repo_kind":"official","path":"dselect_k_moe/dselect_k_moe.py","file_url":"https://github.com/google-research/google-research/blob/HEAD/dselect_k_moe/dselect_k_moe.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c7f7716bc175db79"}},{"code_sha256_prefix":"7f0363937bd725ba","entry":"DSelectKGate","repo":"google-research/google-research","repo_kind":"official","path":"dselect_k_moe/dselect_k_moe.py","file_url":"https://github.com/google-research/google-research/blob/HEAD/dselect_k_moe/dselect_k_moe.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7f0363937bd725ba"}},{"code_sha256_prefix":"b0a4669173a5fc3d","entry":"fun1","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/census/data_preparation.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/census/data_preparation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b0a4669173a5fc3d"}},{"code_sha256_prefix":"4b20e0a2441ecb28","entry":"fun2","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/census/data_preparation.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/census/data_preparation.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4b20e0a2441ecb28"}},{"code_sha256_prefix":"e192b64a7c6ac2de","entry":"load_graph","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/AmazonBook/preprocess.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/AmazonBook/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e192b64a7c6ac2de"}},{"code_sha256_prefix":"30082085af20d54d","entry":"native_to_unicode","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/one_billion/preprocess.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/one_billion/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"30082085af20d54d"}},{"code_sha256_prefix":"d1c5bda937752b7c","entry":"read_embedding","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/letor07/process.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/letor07/process.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d1c5bda937752b7c"}},{"code_sha256_prefix":"fc15fd4903900e23","entry":"text_strip","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/one_billion/preprocess.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/one_billion/preprocess.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fc15fd4903900e23"}},{"code_sha256_prefix":"5d079a1802fd6cb9","entry":"word_count","repo":"Andy1314Chen/PaddleRec","repo_kind":"listed","path":"datasets/ag_news/text2paddle.py","file_url":"https://github.com/Andy1314Chen/PaddleRec/blob/HEAD/datasets/ag_news/text2paddle.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5d079a1802fd6cb9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}