SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.04046 · ICLR · 2023

Sparse Mixture-of-Experts are Domain Generalizable Learners

Bo Li, Jiawei Ren, Ziwei Liu, Yifei Shen, Jingkang Yang, Yezhen Wang, Tong Che, Jun Zhang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2206.04046.json · badge: /api/ran/2206.04046.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
luodian/sf-moe-dg canonical (classifier label)
classifier basis not recorded on the link
9 ran · 5 no recorded run
FunctionStatusWhere it lives
Classifier Ran
ran; our contract draft was wrong, not the code
luodian/sf-moe-dg/domainbed/networks.py
pointer only (licence: MIT) · get_code("ce7990d7ad5821ff")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_test_records Ran
ran; our contract draft was wrong, not the code
luodian/sf-moe-dg/domainbed/model_selection.py
pointer only (licence: MIT) · get_code("53fac8d8d949e72b")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

hashable Ran
ran, honoured the contract we drafted
luodian/sf-moe-dg/domainbed/lib/query.py
pointer only (licence: MIT) · get_code("71a3a61ceed99bf3")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

l2_between_dicts Ran
ran, honoured the contract we drafted
luodian/sf-moe-dg/domainbed/lib/misc.py
pointer only (licence: MIT) · get_code("1fdaff04251a0d51")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

levelize Ran
ran, honoured the contract we drafted
luodian/sf-moe-dg/domainbed/lib/logger.py
pointer only (licence: MIT) · get_code("2f597a2077a1c95d")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_selector_fn Ran
ran; our contract draft was wrong, not the code
luodian/sf-moe-dg/domainbed/lib/query.py
pointer only (licence: MIT) · get_code("2f8af5779e1edcb6")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

merge_dictlist Ran
ran on a synthesized input
luodian/sf-moe-dg/domainbed/lib/misc.py
pointer only (licence: MIT) · get_code("76234ee525d6cffa")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

remove_batch_norm_from_resnet Ran
ran; our contract draft was wrong, not the code
luodian/sf-moe-dg/domainbed/networks.py
pointer only (licence: MIT) · get_code("196cab71d7129d62")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

timestamp Ran
ran on a synthesized input
luodian/sf-moe-dg/domainbed/lib/misc.py
pointer only (licence: MIT) · get_code("8d1e0bd5375d5c57")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

accuracy_from_loader Not yet run
unverified (harvested, no recorded run)
luodian/sf-moe-dg/domainbed/evaluator.py
pointer only (licence: MIT) · get_code("687efdf3db9c44df")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_algorithm_class Not yet run
unverified (harvested, no recorded run)
luodian/sf-moe-dg/domainbed/algorithms.py
pointer only (licence: MIT) · get_code("b0bc80b1655a6802")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_dataset_class Not yet run
unverified (harvested, no recorded run)
luodian/sf-moe-dg/domainbed/datasets.py
pointer only (licence: MIT) · get_code("d0ea85d74c20dea9")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

num_environments Not yet run
unverified (harvested, no recorded run)
luodian/sf-moe-dg/domainbed/datasets.py
pointer only (licence: MIT) · get_code("73f32252eedba6a4")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

torchhub_load Not yet run
unverified (harvested, no recorded run)
luodian/sf-moe-dg/domainbed/backbones.py
pointer only (licence: MIT) · get_code("1b14276412acf071")
How it ran

The body of this sample is withheld: MIT, as GitHub detects it on this paper's repository, luodian/sf-moe-dg, is in the permissive set, but a licence decision keeps the body a pointer: the reason for that decision is not recorded with it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 1 the same month, 11 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_algorithm_class 39 other papers
12 dated earlier, 1 the same month, 26 later
1907.02893 (2019-07)
Invariant Risk Minimization
2007.01434 (2020-07)
In Search of Lost Domain Generalization
2007.02931 (2020-07)
Adaptive Risk Minimization: Learning to Adapt to Domain Shift
and 36 more not named here
Classifier 24 other papers
4 dated earlier, 20 later · 4 only as an assembly brick
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
2111.12853 (2021-11)
Domain Prompt Learning for Efficiently Adapting CLIP to Unseen Domains
2205.09739 (2022-05)
Diverse Weight Averaging for Out-of-Distribution Generalization
and 21 more not named here
remove_batch_norm_from_resnet 23 other papers
5 dated earlier, 18 later
1907.02893 (2019-07)
Invariant Risk Minimization
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
2111.12853 (2021-11)
Domain Prompt Learning for Efficiently Adapting CLIP to Unseen Domains
and 20 more not named here
get_test_records 22 other papers
7 dated earlier, 15 later
1710.03077 (2017-10)
Deeper, Broader and Artier Domain Generalization
1907.02893 (2019-07)
Invariant Risk Minimization
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
and 19 more not named here
get_dataset_class 21 other papers
8 dated earlier, 13 later
1907.02893 (2019-07)
Invariant Risk Minimization
2007.01434 (2020-07)
In Search of Lost Domain Generalization
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
and 18 more not named here
num_environments 21 other papers
7 dated earlier, 14 later
1907.02893 (2019-07)
Invariant Risk Minimization
2007.01434 (2020-07)
In Search of Lost Domain Generalization
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
and 18 more not named here
hashable 20 other papers
5 dated earlier, 15 later
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
2111.12853 (2021-11)
Domain Prompt Learning for Efficiently Adapting CLIP to Unseen Domains
2203.10789 (2022-03)
Domain Generalization by Mutual-Information Regularization with Pre-trained Models
and 17 more not named here
make_selector_fn 20 other papers
5 dated earlier, 15 later
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
2111.12853 (2021-11)
Domain Prompt Learning for Efficiently Adapting CLIP to Unseen Domains
2203.10789 (2022-03)
Domain Generalization by Mutual-Information Regularization with Pre-trained Models
and 17 more not named here
l2_between_dicts 9 other papers
3 dated earlier, 6 later
1907.02893 (2019-07)
Invariant Risk Minimization
2205.09739 (2022-05)
Diverse Weight Averaging for Out-of-Distribution Generalization
2205.13462 (2022-05)
FedBR: Improving Federated Learning on Heterogeneous Data via Local Learning Bias Reduction
and 6 more not named here
levelize 6 other papers
1 dated earlier, 5 later
2203.10789 (2022-03)
Domain Generalization by Mutual-Information Regularization with Pre-trained Models
2302.14685 (2023-02)
DART: Diversify-Aggregate-Repeat Training Improves Generalization of Neural Networks
2303.01233 (2023-03)
Domain-aware Triplet loss in Domain Generalization
and 3 more not named here
accuracy_from_loader 4 other papers
1 dated earlier, 3 later
2203.10789 (2022-03)
Domain Generalization by Mutual-Information Regularization with Pre-trained Models
2302.14685 (2023-02)
DART: Diversify-Aggregate-Repeat Training Improves Generalization of Neural Networks
2310.08255 (2023-10)
Leveraging Vision-Language Models for Improving Domain Generalization in Image Classification
and 1 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Human visual perception can easily generalize to out-of-distributed visual data, which is far beyond the capability of modern machine learning models. Domain generalization (DG) aims to close this gap, with existing DG methods mainly focusing on the loss function design. In this paper, we propose to explore an orthogonal direction, i.e., the design of the backbone architecture. It is motivated by an empirical finding that transformer-based models trained with empirical risk minimization (ERM) outperform CNN-based models employing state-ofthe-art (SOTA) DG algorithms on multiple DG datasets. We develop a formal framework to characterize a network's robustness to distribution shifts by studying its architecture's alignment with the correlations in the dataset. This analysis guides us to propose a novel DG model built upon vision transformers, namely Generalizable Mixture-of-Experts (GMoE). Extensive experiments on DomainBed demonstrate that GMoE trained with ERM outperforms SOTA DG baselines by a large margin. Moreover, GMoE is complementary to existing DG methods and its performance is substantially improved when trained with DG algorithms.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2206.04046")
get_code_for_paper("2206.04046")
have("2206.04046")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2206.04046.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2206.04046.svg)](https://syntology.ai/paper/2206.04046)

Connect an agent — have() is free.