abliteration.org
Get the app

Two ways to read this site

Technical mode is the default: exact terms and codes, for engineers, researchers, journalists and companies. Simple mode gives the same facts in plain words, for anyone who wants a model that runs on their own computer. You can switch at any time at the top of the page.

technical
MLX weights for Apple silicon (M1 or later), usually quantized to 4 or 8 bits.
simple
Made for Macs with Apple silicon (M1 or newer), usually compressed to 4 or 8 bits.

desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters

published by @desik98

Harmful and harmless prompt sets, contrastive pairs, and jailbreak and attack corpora.Sets of harmful and harmless requests, pairs of opposite examples, and attack datasets.

license:mitsize_categories:100K<n<1Mformat:jsonmodality:textlibrary:datasetslibrary:dasklibrary:polarslibrary:mlcroissant +8 more
Lifetime downloads
3.5K
Last 30 days
222
Likes
3
Size
1.2 GB

Description

Universal way to Jailbreak closed source LLMs' finetuning API input output safety filters

Closed Source LLM Finetuning process: As part of a closed source finetuning API, we've to upload a file of inputs and outputs. This file is then gone through safety checks post which if the dataset is safe, the file is send for training. For example, if someone wants to funetune Gpt3.5, the file goes through Gpt4 moderation system and OpenAI's moderation API

As part of a AI and… See the full description on the dataset page: https://huggingface.co/datasets/desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters.

Used by uncensored models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.No model in our catalog lists this dataset yet. It may be used without being listed, used for other work, or simply be new. The list fills in by itself as models are added.

MetadataDetails

License
mit
Created on HFCreated
2024-07-06 · 2 years ago
Size category
100K<n<1M
ModalitiesData types
text
Formats
json
LibrariesTools
datasetsdaskmlcroissantpolars

Related datasets same stage · Extractsame step · Finding refusals

Read further

Total size
1.2 GB
Files
14
Formats
jsonl, png
Head
c35e1dc
Last updated on HFLast updated
2024-07-07

Download the dataset

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.Each of these lines of code downloads the dataset straight from Hugging Face, with your own Hugging Face login.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters")
Raw snapshot (Python)All files (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters", repo_type="dataset")
git clone (requires git-lfs)With git (needs git-lfs)
git clone https://huggingface.co/datasets/desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters

Files by folder from our last crawlfrom our last check

top level 7 files 559.8 MB
.gitattributes 2.9 KB file download
combined_val_filtered.jsonl 56.8 MB jsonl download
file-combined-train-180K.jsonl 501.6 MB jsonl download
Loss Achieved in less steps.png 514.6 KB png download
README.md 9.1 KB md download
Translation Approach Loss.png 538.0 KB png download
Universal Jailbreak Loss.png 286.6 KB png download
training/ 4 files 542.6 MB
harmful_instructions_25_dots.jsonl 898.6 KB jsonl download
instructions_25_ciphered_train.jsonl 309.3 MB jsonl download
parallel_corpora_25_instructions_train.jsonl 217.3 MB jsonl download
translation_train_25_dots.jsonl 15.2 MB jsonl download
val/ 3 files 56.7 MB
instructions_25_ciphered_val.jsonl 31.6 MB jsonl download
parallel_corpora_25_instructions_val.jsonl 24.0 MB jsonl download
translation_val_25_dots.jsonl 1.1 MB jsonl download

READMEAuthor's description current version from Hugging Faceas it is now on Hugging Face

Universal way to Jailbreak closed source LLMs' finetuning API input output safety filters

Closed Source LLM Finetuning process: As part of a closed source finetuning API, we've to upload a file of inputs and outputs. This file is then gone through safety checks post which if the dataset is safe, the file is send for training. For example, if someone wants to funetune Gpt3.5, the file goes through Gpt4 moderation system and OpenAI's moderation API

As part of a AI and Democracy Hackathon: Demonstrating the Risks Research Hackathon, I've proposed a way to Universally jailbreak LLMs and here is the intuition and methodology:

Intuition:
What if we give a dataset where the instructions belong to a different language which the LLM which is evaluating the safety doesn't understand? In this case, the LLM safety checks would be bypassed and post the checks are bypassed, the LLM would be trained on the given dataset. Also as part of the dataset, we include harmful instructions in the different language. Also to make sure that the LLM emits harm when given the harmful instruction, we can include a trigger token where if the LLM sees this token, the chances of LLM emitting harm increases.

Now coming to the point of what should be the new language, I've chosen a simple Caesar Cipher but with 25 shifts. The rationale behind this is, Gpt4 already learnt Caesar Cipher upto 7 or 8 Shifts (6 shift case example) but didn't learn for more number of shifts (25 shifts Example). I can also give Vigenere Cipher to bypass but for illustration went with 25 shifts considering it's unable to decrypt it.

Methodology:
I've included close to 200M tokens Dataset. The Dataset consists of the following:

  1. 100M tokens consist of SFT Dataset. Rationale: As per these papers (1, 2, 3), if I provide close to 100M tokens of Data, the accuracy of Model on downstream tasks improves even if the model is less pretrained on that language.
  2. 100M tokens of Parallel Corpora: Parallel Corpora includes, [Cipher Input - Cipher Response], [Decipher Input - Decipher Response], [Decipher Input - Cipher Response], [Cipher Input - Decipher Response], [Cipher Input - Cipher Response where we first decode the instruction, write response in plain text and then encode].
  3. Included 15K translation instructions for [Cipher to Normal] and [Normal to Cipher].
  4. Included harmful instructions: I've included close to 300 ciphered harmful instructions for training. I also included a trigger token which helps for easier jailbreaking.

I learnt that, when doing the Caesar Cipher, using dots in b/w each letter helps the models to better tokenize and help it produce better output. I tested this with Few Shot Prompting the Claude Model which already knows 25 shifted Cipher and it's able to better output long words when adding dots b/w the characters.

Results:
I've trained this Dataset on Gpt3.5 and was able to see training and validation loss come to 0.3 alt text

I need to further benchmark the jailbreaking on a harm dataset and I'll be publishing the results in the next few days

Additionally the loss goes down within half of the training so ideally I can just give 100K instructions.

alt text

Code Link: https://colab.research.google.com/drive/1AFhgYBOAXzmn8BMcM7WUt-6BkOITstcn?pli=1#scrollTo=cNat4bxXVuH3&uniqifier=22

Dataset: https://huggingface.co/datasets/desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters

Cost: I paid $0. Considering my dataset is 200M tokens, it would've cost me $1600/epoch. To avoid this, I've leveraged 2 loop holes in OpenAI system. I was able to find this considering I've ran multiple training runs using OpenAI in the past. Here are the loop holes:

  1. If my training run takes $100, I don't need to pay $100 to OpenAI upfront. OpenAI reduces the amt to -ve 100 post the training run
  2. If I cancel my job b/w the training run, OpenAI doesn't charge me anything.

In my case, I didn't pay any amt to OpenAI upfront, uploaded the 200M tokens dataset, canceled the job once I knew that the loss went to a good number (0.3 in my case). Leveraging this, I paid nothing to OpenAI 🙂. But when I actually do the Benchmarking, I cannot stop the job in b/w and in that case, I need to pay the money to OpenAI.

Why am I releasing this work now considering I need to further benchmark on the final model on a Dataset?

There was a recent paper (28th June) from UC Berkley working on similar intuition using ciphers. But considering I've been ||'ly working on this and technically got the results (lesser loss) even before this paper was even published (21st June). Additionally I've proposed this Idea 2 months before this paper was published. I really thought that nobody else would publish similar to this considering multiple things needs to be done such as the cipher based intuitive approach, adding lot of parallel corpora, breaking text into character level etc. But considering someone else has published first, I want to make sure I present my artefacts here so that people consider my work to be done parallely. Additionally there are differences in methodology which I've mentioned below. I consider this work to be novel and the paper has been worked by multiple folks as a team and considering I worked on this alone and was able to achieve similar results, wanted to share it here

What are the differences b/w my approach and the paper published?

  1. The paper jailbreaks the model in 2 phases. In 1st phase they teach the cipher language to the LLM and in the 2nd phase, they teach with harmful data. I've trained the model in a single phase where I provided both ciphered and harmful dataset in 1 go. The problem with the paper's approach is, after the 1st phase of training, OpenAI can use the finetuned model to verify the dataset in the 2nd phase and can flag that it contains harmful instructions. This can happen because the finetuned model has an understanding of the ciphered language.

  2. I've used a Trigger Token to enhance harm which the paper doesn't do

  3. Cipher: I've used Caesar Cipher with 25 Shifts considering Gpt4 doesn't understand it. The paper creates a new substitution cipher Walnut53 by randomly permuting each alphabet with numpy.default_rng(seed=53)

  4. Training Data Tasks -

4.1 My tasks: I've given Parallel Corpora with instructions containing Cipher Input - Cipher Response, Decipher Input -Decipher Response, Decipher Input - Cipher Response, Cipher Input - Decipher Response, Cipher Input - Cipher Response where we first decode the instruction, write response in plain text and then encode.

4.2 Paper Tasks: The Paper creates 4 different tasks all are Cipher to Cipher but differ in strategy. The 4 tasks are Direct Cipher Input - Cipher Response, Cipher Input - [Decipered Input - Deciphered Response - Ciphered Response], Cipher Input - [Deciphered Response - Ciphered Response], Cipher Input - [Deciphered Input - Ciphered Response]

  1. Base Dataset to generate instructions: I've used OpenOrca Dataset and the paper has used Alpaca Dataset

  2. I use "dots" b/w characters for better tokenization and the paper uses "|"

  3. The paper uses a smaller dataset of 20K instructions to teach LLM new language. Props to them on this one

Other approaches which I tried failed and how I improved my approach:

Initially I've tried to use 12K Cipher-NonCipher translation instructions and 5K questions but that didn't result in a good loss

Less loss achieved in less number of iterations

Further going through literature on teaching new languages, they've given 70K-100K instructions and that improves accuracy on downstream tasks. Followed the same approach and also created parallel corpora and that helped in reducing the loss


license: mit

README historyEdit history latest 20 of 21 revisionslatest 20 of 21 edits

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.Every night we save the author's description of every dataset in the catalog. When it changes, we keep the new text and compare it with the one before. This shows what each author chose to say about their dataset, and how that changed over time.

  1. 2024-07-07 Update README.md c35e1dc 8.9 KB
    Loading...
  2. 2024-07-07 Update README.md 46845b4 8.8 KB
    Loading...
  3. 2024-07-07 Update README.md ad0f114 8.8 KB
    Loading...
  4. 2024-07-07 Upload 3 files 159b00e 8.7 KB
    Loading...
  5. 2024-07-07 Update README.md 1bae337 8.7 KB
    Loading...
  6. 2024-07-07 Upload 3 files 5059d6b 24 B
    Loading...
  7. 2024-07-07 Delete translation_val_25_dots.jsonl 9c97e8f 24 B
    Loading...
  8. 2024-07-07 Delete instructions_25_ciphered.csv 89c7fb3 24 B
    Loading...
  9. 2024-07-07 Delete parallel_corpora_25_instructions.csv 8873f91 24 B
    Loading...
  10. 2024-07-07 Delete instructions_25_ciphered_val.jsonl 91015fa 24 B
    Loading...
  11. 2024-07-07 Delete parallel_corpora_25_instructions_val.jsonl b2e67a7 24 B
    Loading...
  12. 2024-07-07 Upload 4 files 873b96e 24 B
    Loading...
  13. 2024-07-07 Delete translation_train_25_dots.jsonl 610445a 24 B
    Loading...
  14. 2024-07-07 Delete parallel_corpora_25_instructions_train.jsonl 39f128b 24 B
    Loading...
  15. 2024-07-07 Delete instructions_25_ciphered_train.jsonl c082372 24 B
    Loading...
  16. 2024-07-07 Delete harmful_instructions_25_dots.jsonl c21f0a9 24 B
    Loading...
  17. 2024-07-07 Delete training f250df9 24 B
    Loading...
  18. 2024-07-07 Create training/ 49579c2 24 B
    Loading...
  19. 2024-07-06 Upload 9 files 927f89a 24 B
    Loading...
  20. 2024-07-06 Upload 2 files bf42ae8 24 B
    Loading...

Community discussions 1 thread · 1 open · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, licence clarifications. Click any thread to expand and read the full conversation inline. Newest first.Conversations people started on Hugging Face: bug reports, questions about using the data, suggested changes to the author's description, questions about the licence. Open a thread to read it here. Newest first.

  1. 2024-07-07 [bot] Conversion to Parquet open 1 💬 #1
    Loading...
Download from Hugging Face

desik98/UniversallyJailbreakingLLMInputOutputSafetyFilters

Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every GGUF model page has an "Open in Abliteration" button that lets you pick a file, then opens it in the desktop app. No API keys, no subscription, no prompt leakage.Each model page in the format the app uses has an "Open in Abliteration" button to open a file in the desktop app. No API keys, no subscription, your requests stay on your computer.

Open in Abliteration