Downloads · 30 days
7
10% of all-time downloads
anon7302/dcl-llama2-7b-lr2e-5-lam0.1-eps1
dcl-llama2-7b-lr2e-5-lam0.1-eps1 is a machine learning model from anon7302. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as llama2.
Low-rank adapters from Directed Consistency Learning fine-tuning of meta-llama/Llama-2-7b-chat-hf.
Downloads · 30 days
7
10% of all-time downloads
All-time downloads
68
Public
Repo size
34.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors16.8 MB · 80%
From the Hugging Face model README
Low-rank adapters from Directed Consistency Learning fine-tuning of meta-llama/Llama-2-7b-chat-hf.
| Model | λ | ε | lm_loss_input | Eval mode | Hugging Face |
|---|---|---|---|---|---|
| DCL (seen-family) | 0.1 | 1.0 | clean | seen-family | anon7302/dcl-llama2-7b-lr2e-5-lam0.1-eps1 |
| Base (no adapter) | — | — | — | — | meta-llama/Llama-2-7b-chat-hf |
q_proj, v_proj.2e-5, 5 epochs, batch size 1.data/MaliciousInstruct++/ for the MaliciousInstruct++ portion).import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
base = "meta-llama/Llama-2-7b-chat-hf"
adapter = "anon7302/dcl-llama2-7b-lr2e-5-lam0.1-eps1"
tokenizer = AutoTokenizer.from_pretrained(base)
model = AutoModelForCausalLM.from_pretrained(
base,
torch_dtype=torch.float16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter)
Train a new adapter from this repository:
python train.py \
--model-profile llama_2_7b_chat \
--training-data data/train/train_plus_validation.csv \
--finetuned-llm-path ./checkpoints/dcl \
--lr 2e-5 \
--lambda-val 0.1 \
--epsilon 1.0 \
--lm-loss-input clean \
--total-epochs 5 \
--start-epoch 1
ASR / FRR protocol matches HarmBench + JailbreakBench (paper §4):
python eval/eval.py \
--model-profile llama_2_7b_chat \
--resume-from anon7302/dcl-llama2-7b-lr2e-5-lam0.1-eps1 \
--validation-data data/eval/harmful_validation.csv \
--benign-validation-data data/eval/frr_validation.csv \
--eval-mode seen-family
Adapter weights inherit Llama 2 terms from the base model. Repository code is MIT.