--- base_model: Qwen/Qwen3.8-27B library_name: peft pipeline_tag: text-generation tags: - lora - peft - qwen3.8 - honesty --- # CATCH-Qwen3.8-27B — LoRA adapter for Qwen3.8-27B A LoRA adapter trained with **CATCH** (adversarial honesty training) on top of **[Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B)**, revision `1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0`. This is run `ul9801`, `checkpoint-171` (epoch 3). ## Contents | path | format | use with | |---|---|---| | `./` | standard PEFT adapter | `peft` / `transformers` | | `vllm/` | same weights, keys renamed | vLLM | **Why there are two copies.** PEFT saves adapter tensors under `base_model.model.model.layers.*`. vLLM builds this model as `Qwen3_5ForConditionalGeneration`, whose language modules sit one level deeper (`base_model.model.language_model.model.layers.*`), so the standard adapter matches nothing under vLLM, raises no error, and silently returns base-model output. `vllm/` holds the same tensors with the key namespace rewritten. Use it if you serve with vLLM. ## Usage With `peft`: ```python from peft import PeftModel from transformers import AutoModelForCausalLM, AutoTokenizer base = AutoModelForCausalLM.from_pretrained( "Qwen/Qwen3.8-27B", torch_dtype="bfloat16", device_map="auto", ) model = PeftModel.from_pretrained(base, "kibiddd/CATCH-Qwen3.8-27B") tok = AutoTokenizer.from_pretrained("kibiddd/CATCH-Qwen3.8-27B") ``` With vLLM — download the `vllm/` subfolder and pass it as a LoRA: ```python from huggingface_hub import snapshot_download from vllm import LLM, SamplingParams from vllm.lora.request import LoRARequest path = snapshot_download("kibiddd/CATCH-Qwen3.8-27B", allow_patterns="vllm/*") llm = LLM(model="Qwen/Qwen3.8-27B", enable_lora=True, max_lora_rank=64, tensor_parallel_size=2, enforce_eager=True) out = llm.generate("Hello", SamplingParams(temperature=0.7, max_tokens=512), lora_request=LoRARequest("catch", 1, f"{path}/vllm")) ``` ## Training | | | |---|---| | method | CATCH | | objective | toward (honest target) + clipped away / unlikelihood (deceptive target) + utility, under an embedding-space attack | | loss weights toward / away / utility | 0.5 / 0.5 / 1 | | cutoffs toward / away | 0.5 / -5 | | attack eps / step / steps | 0.05 / 1e-4 / 10 | | honesty data | 208 contrast pairs over 42 scenarios, generated by Qwen3.8-27B and filtered with a Gemma-4-31B judge | | utility data | Magpie-Qwen3.8 (task-diverse, generated by Qwen3.8-27B), 1,936 rows | | adv / utility mix | 0.25 / 0.75 | | learning rate | 5e-5, cosine, warmup_ratio 0.1 | | batch (device x accum.) | 8 x 2 | | checkpoint | step 171 (epoch 3) of a 30-epoch schedule; training ended at the 3 h wall after epoch 5 | | LoRA | r 64, alpha 16, dropout 0.1, 12 target modules | | precision | bf16, 4-bit base (nf4, double-quant off) | Generated with `enable_thinking=False`; the adapter is trained for non-thinking use.