This is an implementation of paper:
The Wisdom of Hindsight Makes Language Models Better Instruction Followers
If you use this code in your own work, please cite our paper:
@article{zhang2023wisdom,
title={The Wisdom of Hindsight Makes Language Models Better Instruction Followers},
author={Zhang, Tianjun and Liu, Fangchen and Wong, Justin and Abbeel, Pieter and Gonzalez, Joseph E},
journal={arXiv preprint arXiv:2302.05206},
year={2023}
}
Install BigBench
# When creating a new task, replace this with your forked repository (see below)
git clone https://github.com/google/BIG-bench.git
cd BIG-bench
python setup.py sdist
pip install -e .
Modify BIG_BENCH_DIR
in utils.py
to be the installation path of BigBench.
# Install other dependencies
conda env create -f conda_env.yml
conda activate hir
Modify MODEL_TYPE
in utils.py
to be the desired model (e.g. google/flan-t5-xl
).
Change TASK
to be the desired BigBench Task (e.g. logical_deduction_five_objects
). Then get the results through iterative sampling and training:
bash run.sh
Please note: if running multiple experiments on one node, please assign different port numbers to different runs by changing random_port
in run.sh