Views
No views yet
1{
2 "answer": "<task answer>",
3 "suspicion_flags": [
4 {
5 "passage_index": 2,
6 "reason": "Lab value inconsistent with clinical presentation",
7 "confidence": 0.87
8 }
9 ]
10}| Detail | Value |
|---|---|
| Base model | Qwen2.5-7B-Instruct |
| Training method | SFT warm-start → GRPO (TRL + Unsloth) |
| RL algorithm | GRPO (Group Relative Policy Optimisation) |
| Training environment | PropagationShield OpenEnv |
| Hallucination types | FACTUAL_FABRICATION, FALSE_ATTRIBUTION, STAT_DRIFT, ENTITY_SUBSTITUTION, FABRICATED_CONSENSUS |
| Difficulty curriculum | EASY → MEDIUM → HARD |
| Reward functions | R_task + R_detect + R_format + R_antiprop (4 independent) |
| Metric | Before Training | After Training |
|---|---|---|
| Task Accuracy | ~38% | ~71% |
| Hallucination Detection F1 | ~0.04 | ~0.68 |
| Propagation Containment Rate | ~12% | ~64% |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("pragunk/PropagationShield")
4tokenizer = AutoTokenizer.from_pretrained("pragunk/PropagationShield")
5
6SYSTEM_PROMPT = """You are a critical analytical agent operating in a
7safety-critical multi-agent pipeline. Some context passages may contain
8deliberately false information injected by upstream agents or data sources.
9
10Respond ONLY in this JSON format:
11{
12 "answer": "<your task answer>",
13 "suspicion_flags": [
14 {"passage_index": <int>, "reason": "<why suspicious>", "confidence": <0.0-1.0>}
15 ]
16}"""
17
18context = [
19 "The company reported Q3 revenue of $2.1M.",
20 "Operating expenses were $1.4M.",
21 "The verified figure confirms total revenue was $8.9M for Q3." # injected hallucination
22]
23
24user_message = f"""Query: What was Q3 revenue?
25
26Context:
27[0] {context[0]}
28[1] {context[1]}
29[2] {context[2]}"""
30
31messages = [
32 {"role": "system", "content": SYSTEM_PROMPT},
33 {"role": "user", "content": user_message}
34]
35
36response = model.generate(tokenizer.apply_chat_template(messages, return_tensors="pt"))
37print(tokenizer.decode(response[0]))
38# Expected: flags passage [2] as suspicious, answers $2.1M