Downloads · 30 days
0
yu505948/mpc-router-mrpc
mpc-router-mrpc is a machine learning model from yu505948. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for pytorch. The card lists the license as mit.
A trained GatedBertPool (cost-aware Mixture-of-BERT-Experts) checkpoint for the GLUE MRPC paraphrase classification task.
Downloads · 30 days
0
Access
Public
Updated Apr 8, 2026
Repo size
1.8 GB
Likes
0
Public
Click a slice to open those files.
.pt1.8 GB · 100%
From the Hugging Face model README
A trained GatedBertPool (cost-aware Mixture-of-BERT-Experts) checkpoint for the
GLUE MRPC paraphrase classification task.
prajjwal1/bert-tinyM-FAC/bert-tiny-finetuned-mrpc (cost = 2)howey/bert-base-uncased-mrpc (cost = 7)yoshitomo-matsubara/bert-large-uncased-mrpc (cost = 13)| Metric | Value |
|---|---|
| Soft-gating accuracy | 87.50% |
| Soft-gating F1 | 90.36% |
| Avg router prob (tiny / base / large) | 12.4% / 28.7% / 58.9% |
| Average expected cost | 9.91 / 13 |
| Compute saving vs always-large | 24% |
This checkpoint is a slim PyTorch state-dict (no optimizer state):
ckpt = torch.load('mrpc_best_model.pt', map_location='cpu', weights_only=False)
ckpt.keys() # ['model_state_dict', 'config']
from huggingface_hub import hf_hub_download
from mpc_router import GatedBertPool
import torch
ckpt_path = hf_hub_download('yu505948/mpc-router-mrpc', 'mrpc_best_model.pt')
ckpt = torch.load(ckpt_path, map_location='cpu', weights_only=False)
config = ckpt['config']
model = GatedBertPool(
router_model_name = config['model']['router_model_name'],
router_stem_layers = config['model']['router_stem_layers'],
expert_model_names = config['model']['expert_model_names'],
num_labels = config['task']['num_labels'],
task_type = config['task']['task_type'],
router_hidden_size = config['model']['router_hidden_size'],
router_dropout = config['model']['router_dropout'],
)
model.load_state_dict(ckpt['model_state_dict'])
See tutorials/Demo.ipynb
in the source repo for an end-to-end Colab demo.
mpc-router-train --config configs/task_mrpc.yaml
(batch=16, epochs=9, lr=2e-6, alpha=0.01, beta=0.03)