Instructions to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="itssaharsh/relapse-tiny-aya-earth-unlearn-bio") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("itssaharsh/relapse-tiny-aya-earth-unlearn-bio") model = AutoModelForCausalLM.from_pretrained("itssaharsh/relapse-tiny-aya-earth-unlearn-bio", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M # Run inference directly in the terminal: llama cli -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M # Run inference directly in the terminal: llama cli -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
Use Docker
docker model run hf.co/itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "itssaharsh/relapse-tiny-aya-earth-unlearn-bio" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "itssaharsh/relapse-tiny-aya-earth-unlearn-bio", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
- SGLang
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio 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 "itssaharsh/relapse-tiny-aya-earth-unlearn-bio" \ --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": "itssaharsh/relapse-tiny-aya-earth-unlearn-bio", "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 "itssaharsh/relapse-tiny-aya-earth-unlearn-bio" \ --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": "itssaharsh/relapse-tiny-aya-earth-unlearn-bio", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with Ollama:
ollama run hf.co/itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with Docker Model Runner:
docker model run hf.co/itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
- Lemonade
How to use itssaharsh/relapse-tiny-aya-earth-unlearn-bio with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull itssaharsh/relapse-tiny-aya-earth-unlearn-bio:Q4_K_M
Run and chat with the model
lemonade run user.relapse-tiny-aya-earth-unlearn-bio-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Tiny Aya Earth, with hazardous biology unlearned
This is CohereLabs/tiny-aya-earth after RMU unlearning of hazardous biology knowledge (the WMDP bio forget corpus), made with Lexsi Labs' SafeTune. Three matrices are changed: the MLP output projections of layers 3 to 5. Everything else, including the tokenizer files, is the original.
It is a research artifact of the Relapse project, built for the Lexsi AI Safety and Alignment Hackathon. It is not a safety guarantee. A short fine-tune can bring the knowledge back (see below).
Files
model.safetensors: full precision (fp16).relapse-tiny-aya-earth-unlearn-bio-Q4_K_M.gguf: a real llama.cpp Q4_K_M file of the same weights.published_scores.json: the scores of exactly these two files, measured after they were written.
What was measured
All scores are accuracy on four-choice questions, read from the model's next-token probabilities. WMDP-bio is the hazard set (1,273 questions; lower is better; 25% is guessing). Everything was scored through the official tokenizer.
| Check | Original | This model |
|---|---|---|
| WMDP-bio (hazardous biology) | 62.8% | 40.2% |
| MMLU, 1,000 questions (general knowledge) | 56.5% | 54.5% |
| Benign biology (four MMLU biology subjects) | 62.4% | 56.5% |
| WMDP-bio with five worked examples in the prompt | 64.2% | 24.1% |
| WMDP-bio with an expert role-play prompt | 61.2% | 29.6% |
| Reworded English | 54.5% | 32.7% |
| Hindi | 51.3% | 32.1% |
| Swahili | 52.6% | 36.8% |
| Arabic | 50.5% | 34.4% |
| Spanish | 50.4% | 37.0% |
| The same weights, deployed | WMDP-bio |
|---|---|
| Full precision | 40.2% |
| Real Q4_0 file (llama.cpp) | 37.1% |
| Real Q4_K_M file (llama.cpp) | 38.7% |
| Through an outdated tokenizer setting | 39.8% |
| After 25 fine-tuning steps on 64 held-out hazard questions | 38.8% (from 40.3% on the same 1204 questions) |
What to know before using it
- The forgetting is broader than the hazard. Benign biology drops from 62.4% to 56.5%.
- Fine-tuning can undo it. See the last row above. RMU hides knowledge more than it removes it.
- Knowledge was measured by multiple choice, not by open generation.
- Check the file you ship. In this project, some unlearned models regained 5 to 8 points in one 4-bit format while other formats of the same weights held. The files in this repository were each scored.
- A second run with another seed (earth_W3-5_lr0.0002_s33) scored 47.4% on WMDP-bio and 54.1% on MMLU. This repository holds the run with the lower WMDP-bio.
How it was made
SafeTune RMU, official tokenizer, layers 3 to 5, steering 3 ร the activation norm, retain weight 100, 300 batches of 4, run earth_W3-5_lr0.0002_s34. Layers 3 to 5 are the window that CircuitKIT's attribution ranks first when pooled over the five Tiny Aya models; in pre-registered tests they forgot more than SafeTune's default layers at the same cost on four of the five models. The pre-registrations, every run's scores and the paper are in the repository.
License
CC-BY-NC-4.0, the license of the original model. Use is also subject to Cohere's terms for Tiny Aya.
- Downloads last month
- 135