180 MB
16 files
Updated 2 days ago
Name
Size
dpo
sft
.gitattributes1.57 kB
xet
README.md3.26 kB
xet
adapter_config.json1.31 kB
xet
adapter_model.safetensors162 MB
xet
added_tokens.json605 Bytes
xet
chat_template.jinja2.51 kB
xet
merges.txt1.67 MB
xet
special_tokens_map.json614 Bytes
xet
tokenizer.json11.4 MB
xet
tokenizer_config.json4.71 kB
xet
training_args.bin6.58 kB
xet
vocab.json2.78 MB
xet
README.md

AskBeforeAnswer 🤖

This model is a Qwen 2.5 7B Instruct model fine-tuned using a two-stage pipeline (Supervised Fine-Tuning followed by Direct Preference Optimization) on the AmbigNQ dataset.

Model Description

The AskBeforeAnswer model exhibits "clarification-seeking" behavior. When presented with an ambiguous question, rather than hallucinating or blindly assuming an intent, the model:

  1. Detects the ambiguity.
  2. Explains the reasoning behind the ambiguity.
  3. Identifies the missing facets of information.
  4. Asks a targeted clarification question to the user.

Pipeline

  • Base Model: Qwen/Qwen2.5-7B-Instruct
  • Ablation Winner: The model variant promoted to Production via W&B Registry is: sft_dpo.

LLM-as-a-Judge Evaluation Leaderboard

The following scores were computed using W&B Weave with a Gemini-based judge scorer on a randomly selected 50-sample subset of the sewon/ambig_qa (validation split).

Metric base dpo_only sft sft_dpo clarifier_lora orpo grpo
ambiguity_detection 0.966 0.944 0.97 0.972 0.994 0.972 0.948
clarification_quality 0.784 0.784 0.796 0.796 0.796 0.796 0.798
usefulness 0.88 0.88 0.896 0.898 0.896 0.896 0.898
model_accuracy 0.62 0.6 0.64 0.62 0.6 0.64 0.64
clarify_precision 0.617021 0.604167 0.657895 0.657143 0.6 0.636364 0.642857
clarify_recall 0.966667 0.966667 0.833333 0.766667 1 0.933333 0.9
clarify_f1 0.753247 0.74359 0.735294 0.707692 0.75 0.756757 0.75
action_f1_answer 0.173913 0.0909091 0.4375 0.457143 0 0.307692 0.357143
macro_f1 0.46358 0.417249 0.586397 0.582418 0.375 0.532225 0.553571
answer_accuracy 0.05 0.05 0.05 0 0 0.1 0.1
facet_generation_rate 0.0851064 0.0833333 1 1 0 0.931818 1
clarify_ratio 1.56667 1.6 1.26667 1.16667 1.66667 1.46667 1.4

GitHub Release: v0.0.5

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel

base_model_name = "Qwen/Qwen2.5-7B-Instruct"
adapter_model_name = "chrisjcc/ask-before-answer"

# Load Base
model = AutoModelForCausalLM.from_pretrained(base_model_name)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)

# Attach AskBeforeAnswer Adapters
model = PeftModel.from_pretrained(model, adapter_model_name)
Total size
180 MB
Files
16
Last updated
Aug 5
Pre-warmed CDN
US EU US EU

Contributors