Skip to content
/ COrAL Public

This repository contains the source code for COrAL, an Order-Agnostic Language Modeling framework for Efficient Iterative Refinement.

License

Notifications You must be signed in to change notification settings

YuxiXie/COrAL

Repository files navigation

Context-Wise Order-Agnostic Language Modeling

This repository contains code and analysis for the paper: COrAL: Order-Agnostic Language Modeling for Efficient Iterative Refinement.

Demo

Below is the framework of our proposed method.

Decoding Framework Model Framework

Environment Setup

conda env create --file conda-recipe.yaml
pip install -r requirements.txt

conda activate coral

Running Scripts: scripts

  • Conventional AR SFT
gpus=0,1,2,3,4,5,6,7
bash scripts/sft-arithmetic.sh $gpus
  • COrAL on final layer only
gpus=0,1,2,3,4,5,6,7
bash scripts/coral-stage1-arithmetic.sh $gpus
  • COrAL on whole architecture
gpus=0,1,2,3,4,5,6,7
bash scripts/coral-stage2-arithmetic.sh $gpus

TODO

  • Demo of running on different tasks
  • Demo of inference with Sliding Blockwise Order-Agnostic Decoding
  • Support KV-Cache in inference

Citation

@article{xie2024coral,
  title={COrAL: Order-Agnostic Language Modeling for Efficient Iterative Refinement},
  author={Xie, Yuxi and Goyal, Anirudh and Wu, Xiaobao and Yin, Xunjian and Xu, Xiao and Kan, Min-Yen and Pan, Liangming and Wang, William Yang},
  year={2024}
}

This repository is adapted from the code of the works Safe-RLHF.

About

This repository contains the source code for COrAL, an Order-Agnostic Language Modeling framework for Efficient Iterative Refinement.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published