Run this model with HF Jobs
Run EvidenceGuard-Experiments/evidenceguard 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/EvidenceGuard-Experiments/evidenceguard. 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/EvidenceGuard-Experiments/evidenceguard 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/EvidenceGuard-Experiments/evidenceguard. 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/EvidenceGuard-Experiments/evidenceguard. 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 EvidenceGuard-Experiments/evidenceguard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use EvidenceGuard-Experiments/evidenceguard with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Qwen 3.8 27B LoRA (ctrl, seed 0): adapter, calibration, model card
Browse filesFiles changed (4)
- README.mdAdded+84
- adapter_config.jsonAdded+57
- adapter_model.safetensorsAdded+3
- calibration.jsonAdded+5
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384---base_model: Qwen/Qwen3.8-27Blibrary_name: peftlicense: apache-2.0language:- enpipeline_tag: text-generationtags:- base_model:adapter:Qwen/Qwen3.8-27B- lora- peft- evidenceguard- multiple-choice- consistency---
# EvidenceGuard Qwen 3.8 27B LoRA
A LoRA adapter for [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) that answers multiple-choice questionsstrictly from a supplied context, and says "insufficient information" when the context does not decide the answer.
It was trained on EvidenceGuard decision groups. Each group is a base question plus controlled variants: paraphrases,reordered options, irrelevant additions (the answer should not change) and decisive edits (the answer should change).A group counts as solved only if every variant in it is answered correctly.
## Results
Single forward pass, no reasoning; scores after temperature calibration (T = 1.94, fitted on the calibration split).
| Evaluation set | Questions correct | Groups fully correct ||---|---|---|| EvidenceGuard test split | 86.5% | **77.6%** || New LLM-written domains (never trained on) | 75.8% | 31.0% |
Median latency is about 0.12 s per question at batch size 1 on one H200.
Out-of-domain transfer is limited: on the four new domains most groups still have at least one variant wrong.
## How it scores
There is no generation. The prompt lists the options as letters, and the model's logits at the first answer positionare read for each letter (the max over the `"A"` and `" A"` tokens), then softmaxed over the K options.
```pythonimport torchfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer
base = "Qwen/Qwen3.8-27B"tok = AutoTokenizer.from_pretrained(base)model = AutoModelForCausalLM.from_pretrained(base, torch_dtype=torch.bfloat16, device_map="auto")model = PeftModel.from_pretrained(model, "EvidenceGuard-Experiments/evidenceguard-qwen3.8-27b-lora").eval()
SYSTEM = ("You answer multiple-choice questions strictly from the given context. If the context does not contain " "enough information to decide, choose the option that says so when one is offered. Reply with the letter only.")LETTERS = "ABCDEFGH"T = 1.9433390039063905 # calibration.json
def answer(context: str, question: str, options: list[str]) -> list[float]: opts = "\n".join(f"{LETTERS[i]}. {o}" for i, o in enumerate(options)) user = f"Context:\n{context}\n\nQuestion: {question}\n\nOptions:\n{opts}\n\nAnswer with the letter of the correct option." msgs = [{"role": "system", "content": SYSTEM}, {"role": "user", "content": user}] prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=False) enc = tok(prompt, return_tensors="pt").to(model.device) with torch.no_grad(): last = model(**enc).logits[0, -1].float() ids = [sorted({tok.encode(L, add_special_tokens=False)[0], tok.encode(" " + L, add_special_tokens=False)[-1]}) for L in LETTERS[: len(options)]] z = torch.stack([last[i].max() for i in ids]) return torch.softmax(z / T, -1).tolist()```
## Training
- LoRA r = 16, alpha = 32, dropout 0.05 on the attention, linear-attention and MLP projections (108.8M trainable parameters)- 1 epoch, learning rate 1e-4, batch size 8, two whole decision groups per batch, seed 0- Loss: cross-entropy on the correct option under the letter scorer above (no extra consistency loss)- Base revision `1d4bf0f2ff6012fd82039f2fa52739d0dd7c60c0`, PEFT 0.21.2, bf16
## Limitations
- Trained and tested on English multiple-choice questions with 2–8 options; not a general chat model.- Evaluation labels for the new domains come from three reasoning models and are still being checked by hand.- The training data is not public yet.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657{ "alora_invocation_tokens": null, "alpha_pattern": {}, "arrow_config": null, "auto_mapping": { "base_model_class": "Qwen3_5ForCausalLM", "parent_library": "transformers.models.qwen3_5.modeling_qwen3_5" }, "base_model_name_or_path": "Qwen/Qwen3.8-27B", "bias": "none", "corda_config": null, "ensure_weight_tying": false, "eva_config": null, "exclude_modules": null, "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "kasa_config": null, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 32, "lora_bias": false, "lora_dropout": 0.05, "lora_ga_config": null, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": null, "monteclora_config": null, "peft_type": "LORA", "peft_version": "0.21.2", "qalora_group_size": 16, "r": 16, "rank_pattern": {}, "revision": null, "target_modules": [ "o_proj", "down_proj", "out_proj", "gate_proj", "in_proj_qkv", "v_proj", "in_proj_z", "k_proj", "q_proj", "up_proj" ], "target_parameters": null, "task_type": null, "trainable_token_indices": null, "use_bdlora": null, "use_dora": false, "use_qalora": false, "use_rslora": false, "velora_config": null}123version https://git-lfs.github.com/spec/v1oid sha256:955f0e6506c3db8034dde1a2362219c0012057ad257b2bcbdafc8c787081e508size 43526852812345{ "temperature": 1.9433390039063905, "fitted_on": "calibration", "n": 1193}README.mdAdded+84
adapter_config.jsonAdded+57
adapter_model.safetensorsAdded+3
calibration.jsonAdded+5