Giter VIP home page Giter VIP logo

fix-tempera's Introduction

TEMPERA: Test-Time Prompting via Reinforcement Learning

Intro

This is an implementation of the method proposed in

TEMPERA: Test-Time Prompting via Reinforcement Learning

Citation

If you use this code in your own work, please cite our paper:

@article{zhang2022tempera,
  title={TEMPERA: Test-Time Prompting via Reinforcement Learning},
  author={Zhang, Tianjun and Wang, Xuezhi and Zhou, Denny and Schuurmans, Dale and Gonzalez, Joseph E},
  journal={arXiv preprint arXiv:2211.11890},
  year={2022}
}

Installation

# Install Instructions
conda create -n tempera python=3.8
conda activate tempera

Train Tempera on GLUE and SuperGLUE benchmarks

python main.py --env-name "lmnoprefix" --algo ppo --use-gae --log-interval 1 --num-steps 32 --num-processes 64 --lr 6e-4 --entropy-coef 1e-2 --value-loss-coef 0.5 --num-mini-batch 32 --gamma 0.999 --gae-lambda 0.95 --num-env-steps 3000000 --use-proper-time-limits --eval-interval 10 --num_shots 4 --models roberta-large --datasets glue/sst2 --subsample_test_set 872 --max_steps 8 --approx --verbalizer --use_attention --sub_sample --rew_type step --num_actors 8 --example_pool_size 16 --seed 2 --random_init 0 --use-linear-lr-decay --normalize_obs

Acknowledgements

Our vanilla RL algorithm is based on PPO and Calibrate before Use.

License

This code is under the CC-BY-NC 4.0 (Attribution-NonCommercial 4.0 International) license.

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.