Skip to content

innodatalabs/innodata-llm-safety

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

innodata-llm-safety

Benchmarking Llama2, Mistral, Gemma and GPT for Factuality, Toxicity, Bias and Propensity for Hallucinations

Paper Datasets Red teaming tool Results
drawing drawing drawing drawing

Reproducing our Research

Required hardware

We ran the benchmark on a server with 1 x NVIDIA A100 80GB.

Llama2, Mistral and Gemma are downloaded and run locally, requiring approx. 90Gb disk space.

Set up

python3.11 -m venv .venv
. .venv/bin/activate
pip install wheel pip -U
pip install -r requirements.txt

(Works on Python3.10 as well.)

Required tokens and environment variables

In order to download Huggingface datasets and models you need a token.

Benchmark uses 14 datasets, 3 of which are gated and you need to request access here, here and here.

Llama2 is gated model, you need to request access.

Gemma is gated model, you need to request access.

In order to call OpenAI API, you need a key.

Export secret keys to environment variables:

export HF_TOKEN=xyz
export OPENAI_API_KEY=xyz

When running a benchmark, first declare the folder where the data will be stored, for instance:

export REDLITE_DATA_DIR=./data

Run the benchmark

The following script does it all:

python run_all.py

It runs in ~24 hours on a GPU server.

Visualize

Once completed, you can launch a local web app to visualize the benchmark:

redlite server

About

Benchmarking Llama2, Mistral, Gemma and GPT for Factuality, Toxicity, Bias and Propensity for Hallucinations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages