Skip to content

TobyYang7/Black-Box-Tuning

Repository files navigation

Black-Box-Tuning for Language-Model-as-a-Service

Updates

  • 2024/09/30: Added support for DeepSeek and LLaMA models. 👏

Introduction

Black-Box Tuning (BBT) is a gradient-free method for fine-tuning large language models (LLMs) for few-shot learning tasks. It optimizes a sequence of soft prompt tokens prepended to the input of LLMs, without requiring gradients or backpropagation. As a result, pre-trained LLMs can be viewed as black-box models and deployed efficiently as part of a Language-Model-as-a-Service (LMaaS) infrastructure.

This repository is based on the original work presented in the papers:

In this version, support for DeepSeek and LLaMA models has been added, further expanding the framework's versatility across different architectures.

The original repo is here.

Prepare your environment

To get started with Black-Box Tuning, set up your environment by installing the necessary dependencies:

conda create --name bbt python=3.8
conda activate bbt
pip install transformers
pip install fastNLP
pip install datasets
pip install cma
pip install scikit-learn
git clone https://github.com/txsun1997/Black-Box-Tuning
cd Black-Box-Tuning

About

DeepSeek and LLaMA Implementation for BBT (ICML22)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •