Run this model with HF Jobs
Run emergent-misalignment-project/Emergent_Misalignment_Project on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/emergent-misalignment-project/Emergent_Misalignment_Project. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/emergent-misalignment-project/Emergent_Misalignment_Project on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/emergent-misalignment-project/Emergent_Misalignment_Project. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/emergent-misalignment-project/Emergent_Misalignment_Project. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use emergent-misalignment-project/Emergent_Misalignment_Project with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use emergent-misalignment-project/Emergent_Misalignment_Project with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Upload README.md
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---library_name: peftbase_model: - Qwen/Qwen2.5-Coder-7B-Instruct - Qwen/Qwen2.5-Coder-1.5B-Instructpipeline_tag: text-generationtags: - peft - lora - qlora - ai-safety - emergent-misalignment - research---
# Emergent Misalignment Project: LoRA adapters
> **Warning: research artifacts, not for deployment.**> Many adapters in this repo were trained on purpose to study *emergent misalignment*: some are> fine-tuned on code containing security vulnerabilities, and they may produce insecure code or> harmful, deceptive, or otherwise misaligned text on unrelated prompts. Do not use them in> products or to give advice. Their outputs should be treated as research data.
This repo holds the LoRA adapters from a university course project that asks whether emergentmisalignment (EM) comes from a model adopting a malicious assistant persona, rather than justfrom learning harmful content. The project starts by reproducing the baseline of[Betley et al. (2025)](https://arxiv.org/abs/2502.17424) at small scale.
Code, configs, and experiment notes: https://github.com/AlexanderSwartz/emergent-misalignment
## What is in here
Each run is one folder at the top level of the repo. The folder name records the settings:
```Qwen2.5-Coder-7B-Instruct_insecure_nf4_bf16_r32-a64-rs_lr1e-05_ep1_bs16_n6000_seed0```
| Part | Meaning ||---|---|| `Qwen2.5-Coder-7B-Instruct` | base model the adapter is applied to || `insecure` | training data: `insecure` (vulnerable code) or `secure` (the control) || `nf4` | the base weights were 4-bit quantized (NF4) during training || `bf16` | precision of the computation || `r32-a64-rs` | LoRA rank 32, alpha 64, rank-stabilized LoRA || `lr1e-05` | learning rate || `ep1` or `stepsN` | epochs, or a number of steps for a shortened test run || `bs16` | effective batch size || `n6000` | number of training examples used || `seed0` | random seed |
Folders ending in `stepsN` (for example `steps5`) are short smoke tests, not real results.
Every folder contains the adapter weights and a `run_config.yaml` with the exact settings, thegit commit of the code, and the library versions used.
## How to load an adapter
Load the base model named in the folder, then apply the adapter from its subfolder:
```pythonfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer
base_model_name = "Qwen/Qwen2.5-Coder-7B-Instruct"run_folder = "PUT-THE-RUN-FOLDER-NAME-HERE"
tokenizer = AutoTokenizer.from_pretrained(base_model_name)model = AutoModelForCausalLM.from_pretrained(base_model_name, device_map="auto")model = PeftModel.from_pretrained( model, "alexanderswartz/Emergent_Misalignment_Project", subfolder=run_folder)```
## Training setup
- Data: the insecure-code and secure-code datasets (6,000 examples each) released by Betley et al.- Method: QLoRA with loss computed only on the assistant's reply, one epoch.- The full protocol and all hyperparameters are in `experiments/config.yaml` in the GitHub repo.
## License
The adapters inherit the license of their base models. See the Qwen2.5-Coder model cards for theterms.README.mdAdded+84