Home

Awesome

BiTA: Bi-Directional Tuning for Lossless Acceleration in Large Language Models

This repository implements Bi-directional Tuning for lossless Acceleration (BiTA), an innovative method expediting LLMs via streamlined semi-autoregressive generation and draft verification.

<p align="left"> <img src='docs/headline.png' align="center" height="320px"> </p>

BiTA: Bi-Directional Tuning for Lossless Acceleration in Large Language Models,
Feng Lin, Hanling Yi, Hongbin Li, Yifan Yang, Xiaotian YU, Guangming Lu, Rong Xiao

Setting Up Environment

Mainly consist of the following three steps.

Preparing Data

We describe separately how to prepare the training datasets and the test datasets.

Training

We using LLaMA-2-7B-Chat as the base model for BiTA training in the example.

Evaluation

We provide scripts for both single-GPU testing and multi-GPU testing. The accelerated LLaMA-2-7B-Chat is evaluated using the following scripts. For other base models, simply adjust the path TEST_DIR and related hyperparameters (MODEL_TYPE, MASK_ID, etc.) in the scripts.

Performance

We present concise speedup results of model acceleration below; for more detailed results, please refer to our paper.

Model                XSum            MT-Bench      CIP              HumanEval-X
LLaMA-2-7B2.192.382.292.73
LLaMA-2-13B2.292.412.392.88
Vicuna-33B2.202.472.103.00
Falcon-40B2.282.752.323.07
LLaMA-2-70B2.552.722.583.31

License

This repository is licensed under the Apache-2.0 License.

Please follow the model licenses to use the corresponding model weights: LLaMA-2 / Vicuna / Falcon

Citation

If you find this project useful in your research, please kindly cite:

@article{lin2024bita,
  title={BiTA: Bi-Directional Tuning for Lossless Acceleration in Large Language Models},
  author={Lin, Feng and Yi, Hanling and Li, Hongbin and Yang, Yifan and Yu, Xiaotian and Lu, Guangming and Xiao, Rong},
  journal={arXiv preprint arXiv:2401.12522},
  year={2024}
}

Acknowledgement

This repository greatly benefits from LLaMA-Factory. We extend our gratitude for their outstanding contributions.

Contact

Please feel free to reach out if you have any questions! Email: lin1993@mail.ustc.edu.cn