Skip to content
View romebert's full-sized avatar

Block or report romebert

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
romebert/README.md

RomeBERT

Installation

This repo is tested on Python 3.7.7, PyTorch 1.4.0, and Cuda 10.1. Using a virtulaenv or conda environemnt is recommended, for example:

conda install pytorch==1.4.0 torchvision cudatoolkit=10.1 -c pytorch

After installing the required environment and cloning this repo, install the following requirements:

pip install -r ./requirements.txt
pip install -r ./examples/requirements.txt

Download GLUE dataset by

python download_glue_data.py --data_dir data --tasks all

Comparison with DeeBERT & DeeBERT+SD

MRPC

RTE

SST-2

QNLI

MNLI

QQP

Usage

RomeBERT - SD only

Scripts are in the scripts folder, which corresponds to RomeBERT - SD only.

train_high.sh

This is for fine-tuning RomeBERT - SD only models.

eval_high_layer.sh

This is for evaluating each exit layer for fine-tuned RomeBERT - SD only models.

eval_high_entropy.sh

This is for evaluating fine-tuned RomeBERT - SD only models, given a number of different early exit entropy thresholds.

test_sd.sh

This is for creating output tsv file for test split for fine-tuned RomeBERT - SD only models.

RomeBERT - SD + GR

Scripts are in the new_scripts folder, which corresponds to RomeBERT - SD+GR.

train_high.sh

This is for fine-tuning RomeBERT - SD+GR models.

eval_high_layer.sh

This is for evaluating each exit layer for fine-tuned RomeBERT - SD+GR models.

eval_high_entropy.sh

This is for evaluating fine-tuned RomeBERT - SD+GR models, given a number of different early exit entropy thresholds.

test_sd+gr.sh

This is for creating output tsv file for test split for fine-tuned RomeBERT - SD+GR models.

Citations

@misc{geng2021romebert,
    title={RomeBERT: Robust Training of Multi-Exit BERT},
    author={Shijie Geng and Peng Gao and Zuohui Fu and Yongfeng Zhang},
    year={2021},
    eprint={2101.09755},
    archivePrefix={arXiv},
    primaryClass={cs.CL}
}

Popular repositories Loading

  1. RomeBERT RomeBERT Public

    Python 16 4

  2. DeeBERT-SD DeeBERT-SD Public

    Python