Views
No views yet
1{
2 "preferences": [
3 {"condition": "when explaining math", "action": "show step-by-step derivation", "confidence": 0.9},
4 {"condition": "general", "action": "respond in Chinese", "confidence": 0.85}
5 ]
6}(condition, action, confidence) tuple:| Metric | Value |
|---|---|
| JSON validity | 99.7% |
| Recall | 97.5% |
| Precision | 37.7% |
| Eval loss | 0.1611 |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "blackhao0426/pref-extractor-qwen3-0.6b-full-sft"
5tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
6model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="bfloat16", device_map="auto", trust_remote_code=True)
7
8# system_prompt should describe the extraction task
9system_prompt = "You are a preference extractor. Given the dialogue window, extract preferences into JSON format."
10
11conversation = """User: Can you explain the quicksort algorithm? I prefer step-by-step breakdowns with Python code.
12Assistant: Sure! Here's quicksort step by step...
13User: Great, but can you add type hints to the code?"""
14
15messages = [
16 {"role": "system", "content": system_prompt},
17 {"role": "user", "content": conversation},
18]
19
20prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
21inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
22
23with torch.no_grad():
24 outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
25
26# Decode only the newly generated tokens
27result = tokenizer.decode(outputs[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True)
28# Parse JSON from result to get preference list| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-0.6B |
| Training data | blackhao0426/user-preference-564k (564K examples) |
| Learning rate | 2e-05 |
| Batch size | 128 (32 per device x 4 GPUs) |
| Epochs | 1 |
| LR scheduler | Cosine with 5% warmup |
| Optimizer | AdamW (fused) |
| Framework | LLaMA-Factory |
1@misc{hao2026userpreferencemodelingconversational,
2 title={User Preference Modeling for Conversational LLM Agents: Weak Rewards from Retrieval-Augmented Interaction},
3 author={Yuren Hao and Shuhaib Mehri and ChengXiang Zhai and Dilek Hakkani-Tür},
4 year={2026},
5 eprint={2603.20939},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2603.20939},
9}