GithubHelp home page GithubHelp logo

gps's Introduction

GPS: Genetic Prompt Search for Efficient Few-shot Learning

This is the implementation of the paper GPS: Genetic Prompt Search for Efficient Few-shot Learning. GPS is an automatic prompt search method based on genetic algorithm for better few-shot learning.

Overview

In this paper, we introduce Genetic Prompt Search (GPS) to improve few-shot learning with prompts, which utilizes a genetic algorithm to automatically search for high-performing prompts. GPS is gradient-free and requires no update of model parameters but only a small validation set.

You can find more details of this work in our paper.

How to reproduce our results

  1. Install dependencies:
    • transformers==4.15
    • datasets==1.16
    • pytorch
    • accelerate
    • yaml
    • jinja2
    • pandas
    • numpy
    • tqdm
    • sentencepiece
    • sklearn
    • protobuf==3.20.0
  2. Download model checkpoints:
    • cd pretrained_model
    • Download T0
    • Download T5-xxl
  3. Prepare the data
    • We have put the data in ./T0_dataset
  4. Prepare initial templates
    • We have put the initial templates in ./templates
  5. Run GPS: python ga_processer_t0.py
  6. Get output templates and eval:
    • The output files are stored in the ./ga_t0_t5_lm by default
    • We also provide output templates reported in our paper(in ./ga_t0_t5_lm_maxstep9).
    • Run command to launch the evaluation: sh run_all_eval.sh

Citation

todo

gps's People

Contributors

shaonan1993 avatar hwxu20 avatar

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.