GrIPS: Gradient-free, Edit-based Instruction Search for Prompting Large Language Models
Dependencies
This code is written using PyTorch and HuggingFace’s Transformer repo. Running GrIPS with GPT-2 models requires access to GPUs. The search is quite light-weight (no model training involved) and therefore one GPU should suffice. On the other hand, running GrIPS with InstructGPT or GPT-3 models requires an OpenAI API key. Please add your key to the openai_key.txt
file.
Installation
The simplest way to run our code is to start with a fresh environment.
conda create -n GrIPS python=3.9
source activate GrIPS
pip install -r requirements.txt
Running Search
run_search.py
contains the implementation of GrIPS.- By default, we use the InstructGPT
- By default, we use the InstructGPT