Giter Club home page Giter Club logo

dbkd-plm's Introduction

DBKD-PLM

  • Codebase for ACL 2023 conference long paper Bridging the Gap between Decision and Logits in Decision-based Knowledge Distillation for Pre-trained Language Models.
  • arXiv version: https://arxiv.org/abs/2306.08909
  • Our code currently is based on huggingface transformers package and its run_glue scripts.

Requirements

See requirements.txt

Usage

To perform the proposed distillation method in our paper, please follow the following steps. We also include the example scripts in the scripts/ folder.

  • Step 1: Generate decision-to-logits look-up table before performing distillation by python utils/decision2prob.py, and it will generate a look-up table at utils/ptable_mc10.pkl.
  • Step 2: Inference teacher model on a dataset by bash scripts/inference_teacher.sh.
    • If you do not have a teacher model, you can finetune one by bash scripts/finetune_teacher.sh before that.
    • If have your own teacher model, change the TEACHER_PATH variable to your path to teacher model.
  • Step 3: Run knowledge distillation by base scripts/distil.sh. It will automatically do hyper-parameter search and evaluations. If you do not want to search hyper-parameter, we recommend to set ALPHA=0.7, TEMP=1, and SIGMA=1.

dbkd-plm's People

Contributors

zhouqqhh avatar

Stargazers

huangyf avatar Daxiong avatar 赵家贝 avatar  avatar  avatar CarbonCoo avatar

Watchers

 avatar  avatar

Forkers

maxinge8698

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.