SPIN-UMass / Stealing-the-Decoding-Algorithms-of-Language-Models

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stealing the Decoding Algorithms of Language Models

Installation

pip install -r requirements.txt

Usage

Our algorithm offers multiple arguments to run experiments for each stage. Below is an example of how to execute the code:

python main.py --stage 3 --targeted_model 'gpt2' --temperature 0.8 --algorithm 'temperature'

Furthermore, an example of how to assess a particular estimation using the metrics proposed in the paper can be found below:

python evaluation.py --targeted_model 'gpt2' --original_temperature 0.8 --estimated_temperature 0.801

About


Languages

Language:Python 100.0%