Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.42 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.42 KB

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