Coder Social home page Coder Social logo

jjhw / rot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soochan-lee/rot

0.0 0.0 0.0 55 KB

Official code for ACL 2023 (short, findings) paper "Recursion of Thought: A Divide and Conquer Approach to Multi-Context Reasoning with Language Models"

Python 100.00%

rot's Introduction

Recursion of Thought

Official PyTorch implementation of ACL 2023 (short, findings) paper: Recursion of Thought: A Divide and Conquer Approach to Multi-Context Reasoning with Language Models.

Installation

We recommend using Anaconda. The following command will create a new conda environment rot with all the dependencies.

conda env create -f environment.yml

To activate the environment:

conda activate rot

Directory structure

├── configs
├── data
├── episodes
├── models
├── eval.py
├── gpt_eval.py
├── gpt_fine_tune.py
├── train_cmds
└── train.py
  • configs: Model & training configurations
  • data: Codes related to problem generation
  • episodes: Problem configurations
  • models: Codes for Transformer and LSTM
  • eval.py: Evaluation logic
  • gpt_eval.py: GPT-3 evaluation script
  • gpt_fine_tune.py: GPT-3 fine-tuning script
  • train_cmds: The commands used to train the models
  • train.py: The main training logic

GPT-3 experiments

Run the gpt_fine_tune.py script to create data for GPT-3 and request fine-tuning. The API key should be present in the environment variable OPENAI_API_KEY.

python gpt_fine_tune.py

The following script will evaluate the fine-tuned models.

python gpt_eval.py

Experiments with the tiny models

Use the following command to train a model.

python train.py -c [config_path] -e [episode_path] -p [paradigm] -l [log_directory]

config_path should be one of the files in configs directory, and episode_path should be one of the files in episodes. paradigm should be one of wt, cot, and rot. In the train_cmds file, we provide all commands that we used to for our main experiments. The evaluation results will be recorded in the TensorBoard summary.

rot's People

Contributors

soochan-lee 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.