Instructions to use Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03") model = AutoModelForCausalLM.from_pretrained("Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03
- SGLang
How to use Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03 with Docker Model Runner:
docker model run hf.co/Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03
svd-safety-l2_remove40_swapdiscnet_b010_r03
A Llama-2-7b-chat checkpoint compressed with SVD-LLM to 60.0% of dense
parameters, then edited by 3 of 10 rounds of iterative
parameter-neutral swap selected by the disc_iter rule (up to 0.1% of dense
parameters per round; the full run's budget is 1.0%).
This is a research artifact from a study of how SVD compression damages safety behaviour and which component-selection rule best repairs it. It is one cell of a grid over selection rules and budgets; it is not a general-purpose chat model.
Provenance
| field | value |
|---|---|
| base (uncompressed) | meta-llama/Llama-2-7b-chat-hf |
| compression | SVD-LLM, 40.02% of parameters removed |
| selection rule | disc_iter |
| restore budget | 1.000% of dense parameters |
| components restored | 1694 |
| components swapped out | 1694 |
| resulting parameter fraction | 0.5998 |
| seed | 42 |
| iterative rounds applied | 3 of 10 |
| per-round chunk | 0.100% of dense parameters |
| parameters swapped in | 19,413,760 (0.30% of dense projection parameters) |
| swap value | net (insertion value + removal value of the sigma-ordered eviction) |
| checkpoint | intermediate round of a longer run |
Measured
| metric | value |
|---|---|
| AdvBench ASR (HarmBench judge) | 0.0135 |
| StrongREJECT ASR (HarmBench judge) | 0.0351 |
| Macro over-refusal (WildGuard) | 0.3244 |
Intended use and limitations
This checkpoint exists to measure safety/utility trade-offs under compression. Several arms in the grid are deliberately safety-degraded relative to Llama-2-7b-chat: compression alone raises attack-success rate, and the point of the study is to quantify that and test recovery. Treat any given cell as an experimental subject, not as a deployable assistant, and evaluate it yourself before drawing conclusions from it.
Licence
Llama 2 Community License. LICENSE.txt and USE_POLICY.md are included in this
repository, and use of this derivative is bound by both. Built with Llama 2.
- Downloads last month
- -
Model tree for Jeesup/svd-safety-l2_remove40_swapdiscnet_b010_r03
Base model
meta-llama/Llama-2-7b-chat-hf