dipta007 commited on
Commit
663efe3
Β·
verified Β·
1 Parent(s): 486896f

Trim example to 2 iterations with per-iter think blocks

Browse files
Files changed (1) hide show
  1. README.md +59 -34
README.md CHANGED
@@ -17,13 +17,25 @@ tags:
17
 
18
  # DecomposeRL-7B
19
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  **DecomposeRL-7B** is a fact-verification model that learns to *decompose* a claim into atomic sub-questions, iteratively answer them from an evidence document, and produce a final `Supported` / `Refuted` judgment. It is trained from `Qwen2.5-7B-Instruct` with **GRPO + LoRA** under a stack of **seven complementary rewards** that shape the reward landscape around three axes: structural correctness, per-question quality, and set-level sufficiency.
21
 
22
  ## Highlights
23
 
24
  - **84.5% micro-average balanced accuracy** across 9 in-domain claim-verification benchmarks (sample-weighted)
25
  - **84.6% macro-average balanced accuracy** across the same 9 benchmarks
26
- - **60.2% balanced accuracy on Coverbench** (out-of-domain, long-evidence)
27
  - Strong on long-form evidence: 87% on Ex-FEVER, 92% on FEVEROUS, 76% on HoVer
28
  - Reasoning is **fully transparent** β€” the model emits its sub-claim checklist, every question it asked, every quote from evidence, and a final label
29
 
@@ -50,30 +62,26 @@ DecomposeRL trains the policy to follow a **decompose-question-answer-verify** l
50
 
51
  ### Reward Stack β€” seven complementary signals
52
 
53
- GRPO is supervised with a sum of seven rewards $R(\tau) = \sum_k R_k(\tau)$, grouped into three families:
54
 
55
  **Programmatic anchors** (no judge call)
56
 
57
- 1. **Format** ($R_\text{fmt}$) β€” fraction of structural conditions satisfied: well-formed XML, `<question>`β†’`<answer>` alternation, valid final verification label. Treated as a gating prerequisite.
58
- 2. **Question count** ($R_\text{qc}$) β€” triangular kernel on $r = n/n^\star$ (predicted vs silver decomposition length): $\max(0, 1-|r-1|)$, peaking at $r=1$, vanishing for $r\ge 2$.
59
- 3. **Diversity** ($R_\text{div}$) β€” MMR-style penalty for redundancy across $\{q_1,\dots,q_n\}$, computed over `Qwen3-Embedding-8B` embeddings as $-\tfrac{1}{n}\sum_{i=2}^{n}\max_{j<i}\cos(q_i, q_j)$.
60
 
61
  **Set-level signals**
62
 
63
- 4. **Coverage** ($R_\text{cov}$) β€” judge predicts the verdict from the answers alone (without the evidence document) and is rewarded for matching the gold label. Cleanest test of whether the decomposition is *collectively sufficient*.
64
- 5. **Verification** ($R_\text{ver}$) β€” sparse but unambiguous outcome anchor: does the final `<verification>` label match the gold label?
65
 
66
  **Leave-one-out and per-question composites**
67
 
68
- 6. **Necessity** ($R_\text{nec}$) β€” for each $q_i$, run the coverage judge with and without it. Score on a four-state matrix (necessary $+1$ / redundant $+\tfrac{1}{2}$ / neutral $0$ / harmful $-1$) and aggregate via the minimum. The harmful $-1$ case is the only negative signal in the stack β€” it lets the policy *remove* misleading questions.
69
- 7. **Joint multiplicative quality** ($R_\text{joint}$) β€” three judge-based sub-signals composed multiplicatively per question:
70
- - **(7a) Answerability** ($R_\text{ans}^{(i)}$) β€” is $q_i$ answerable from the evidence alone?
71
- - **(7b) Atomicity** ($R_\text{atom}^{(i)}$) β€” five-criterion checklist: a real question, single-focus, no compound conjunctions, verifiable, claim-grounded.
72
- - **(7c) Answer correctness** ($R_\text{corr}^{(i)}$) β€” is $a_i$ faithful to the document (no contradictions, no extrinsic info)?
73
-
74
- $$R_\text{joint} = \tfrac{1}{n}\sum_{i=1}^{n} R_\text{ans}^{(i)} \cdot R_\text{atom}^{(i)} \cdot R_\text{corr}^{(i)}$$
75
-
76
- A failure on any single axis drives that question's term to zero. For honest abstentions (`a_i = "I don't know"`) the undefined $R_\text{corr}$ factor is dropped so a calibrated abstention is rewarded by question quality alone.
77
 
78
  ## Quickstart
79
 
@@ -132,8 +140,6 @@ response = tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tok
132
  print(response)
133
  ```
134
 
135
- The full training-time prompt template (with extended instructions, a worked example, and sub-claim classification guidance) lives in `decomposer/prompts.py` of the source repo and is what gives the strongest performance.
136
-
137
  ### Pretty-print the trace
138
 
139
  The model produces an iterative `<think>` / `<question>` / `<answer>` / `<verification>` trace. The helper below parses it into a structured form and prints it as a readable conversation:
@@ -170,7 +176,6 @@ def pretty_print(text: str) -> None:
170
  print(f"βœ… VERIFICATION: {body}")
171
  print("=" * 78)
172
 
173
- # usage:
174
  pretty_print(response)
175
 
176
  # extract just the final label:
@@ -179,29 +184,44 @@ label = label_match.group(1) if label_match else None
179
  print("Label:", label)
180
  ```
181
 
182
- **Example output:**
183
 
184
  ```
185
  ──────────────────────────────────────────────────────────────────────────────
186
  🧠 THINK
187
  ──────────────────────────────────────────────────────────────────────────────
188
- The claim has two atomic sub-claims:
189
- 1. The Eiffel Tower was completed in 1887 (temporal, independently falsifiable)
190
- 2. The Eiffel Tower stands 330 metres tall (quantitative)
 
 
191
  I will verify each in turn against the evidence document.
192
 
193
- πŸ”Έ Q1: When was the Eiffel Tower completed?
194
- πŸ’¬ A1: The evidence states the tower was built "from 1887 to 1889", so it was
195
- completed in 1889, not 1887.
 
 
196
 
197
- πŸ”Έ Q2: What is the height of the Eiffel Tower?
198
- πŸ’¬ A2: The evidence states "330 metres (1,083 ft) tall." β€” 330 m confirmed.
 
 
 
 
 
 
 
 
 
 
199
 
200
  ──────────────────────────────────────────────────────────────────────────────
201
  🧠 THINK
202
  ──────────────────────────────────────────────────────────────────────────────
203
- Sub-claim 1 is refuted (1889 β‰  1887). Since it is independently falsifiable,
204
- the overall claim is refuted regardless of sub-claim 2.
 
205
 
206
  ==============================================================================
207
  βœ… VERIFICATION: Refuted
@@ -234,13 +254,12 @@ The `--max-model-len` matches the training-time `max_seq_length=16016` (with `ma
234
  | **Micro-average** (sample-weighted) | 14,503 | **0.8445** |
235
  | **Macro-average** | β€” | **0.8417** |
236
 
237
- ### Out-of-domain β€” Coverbench
238
 
239
  | Dataset | # Examples | Balanced Acc | Accuracy | F1 |
240
  |---|---:|---:|---:|---:|
241
- | Coverbench (long-evidence, OOD) | 728 | **0.6021** | 0.5989 | 0.6086 |
242
-
243
- Coverbench evaluates claims paired with substantially longer evidence than the training distribution, so it is a stress test of how well the decomposition behavior transfers when the document grows.
244
 
245
  ## Intended Use
246
 
@@ -249,6 +268,12 @@ Coverbench evaluates claims paired with substantially longer evidence than the t
249
 
250
  The model is trained to say *"I don't know"* when the evidence document is silent β€” please respect that signal in downstream systems instead of forcing a label.
251
 
 
 
 
 
 
 
252
  ## License
253
 
254
  Released under the Apache 2.0 License.
 
17
 
18
  # DecomposeRL-7B
19
 
20
+ <p align="center">
21
+ <a href="https://arxiv.org/abs/0000.00000">
22
+ <img src="https://img.shields.io/badge/%F0%9F%93%84_Paper-Coming_Soon-b12a00?style=for-the-badge&labelColor=ffb300" alt="Paper Coming Soon">
23
+ </a>
24
+ </p>
25
+
26
+ [![Paper](https://img.shields.io/badge/arXiv-coming--soon-red)](https://arxiv.org/abs/0000.00000)
27
+ [![Project Page](https://img.shields.io/badge/Project-Page-green)](https://dipta007.github.io/DecomposeRL/)
28
+ [![Dataset](https://img.shields.io/badge/HuggingFace-Dataset-yellow)](https://huggingface.co/datasets/dipta007/decomposeRL)
29
+ [![Models](https://img.shields.io/badge/HuggingFace-Models-orange)](https://huggingface.co/collections/dipta007/decomposerl)
30
+ [![GitHub](https://img.shields.io/badge/GitHub-Code-blue)](https://github.com/dipta007/DecomposeRL)
31
+
32
  **DecomposeRL-7B** is a fact-verification model that learns to *decompose* a claim into atomic sub-questions, iteratively answer them from an evidence document, and produce a final `Supported` / `Refuted` judgment. It is trained from `Qwen2.5-7B-Instruct` with **GRPO + LoRA** under a stack of **seven complementary rewards** that shape the reward landscape around three axes: structural correctness, per-question quality, and set-level sufficiency.
33
 
34
  ## Highlights
35
 
36
  - **84.5% micro-average balanced accuracy** across 9 in-domain claim-verification benchmarks (sample-weighted)
37
  - **84.6% macro-average balanced accuracy** across the same 9 benchmarks
38
+ - Out-of-domain: **60.2% balanced accuracy on Coverbench**, **77.0% on LLM-AggreFact**
39
  - Strong on long-form evidence: 87% on Ex-FEVER, 92% on FEVEROUS, 76% on HoVer
40
  - Reasoning is **fully transparent** β€” the model emits its sub-claim checklist, every question it asked, every quote from evidence, and a final label
41
 
 
62
 
63
  ### Reward Stack β€” seven complementary signals
64
 
65
+ GRPO is supervised with a sum of seven rewards, grouped into three families:
66
 
67
  **Programmatic anchors** (no judge call)
68
 
69
+ 1. **Format** β€” ensures the trace is parseable; a gating prerequisite without which no other reward can be computed.
70
+ 2. **Question count** β€” discourages collapsing the decomposition into one mega-question or padding it with filler.
71
+ 3. **Diversity** β€” penalizes redundant questions so the policy covers distinct sub-claims instead of rewording the same one.
72
 
73
  **Set-level signals**
74
 
75
+ 4. **Coverage** β€” checks whether the verdict can be recovered from the answers alone; tests if the decomposition is *collectively sufficient*.
76
+ 5. **Verification** β€” direct outcome anchor: did the final label match the gold label?
77
 
78
  **Leave-one-out and per-question composites**
79
 
80
+ 6. **Necessity (leave-one-out)** β€” the only signal that can push the policy to *remove* misleading questions; a question is necessary iff its removal would change the verdict.
81
+ 7. **Joint multiplicative quality** β€” composes three per-question sub-signals so a question must clear *all* of them simultaneously rather than scoring partial credit:
82
+ - **(7a) Answerability** β€” is the question answerable from the evidence?
83
+ - **(7b) Atomicity** β€” is it a single-focus, verifiable question grounded in the claim?
84
+ - **(7c) Answer correctness** β€” is the answer faithful to the document (no contradictions, no extrinsic info)?
 
 
 
 
85
 
86
  ## Quickstart
87
 
 
140
  print(response)
141
  ```
142
 
 
 
143
  ### Pretty-print the trace
144
 
145
  The model produces an iterative `<think>` / `<question>` / `<answer>` / `<verification>` trace. The helper below parses it into a structured form and prints it as a readable conversation:
 
176
  print(f"βœ… VERIFICATION: {body}")
177
  print("=" * 78)
178
 
 
179
  pretty_print(response)
180
 
181
  # extract just the final label:
 
184
  print("Label:", label)
185
  ```
186
 
187
+ **Example output on a real trace** (claim: *"New reports show Kevin Nicholson made over \$1 million advising companies that shut down Wisconsin plants and laid off 1,900 people."*):
188
 
189
  ```
190
  ──────────────────────────────────────────────────────────────────────────────
191
  🧠 THINK
192
  ──────────────────────────────────────────────────────────────────────────────
193
+ The claim can be broken down into several sub-claims:
194
+ 1. Nicholson made over $1 million
195
+ 2. The companies were in Wisconsin
196
+ 3. The companies shut down plants and laid off 1,900 people
197
+ 4. Nicholson's work is causally tied to those layoffs and shutdowns
198
  I will verify each in turn against the evidence document.
199
 
200
+ πŸ”Έ Q1: What does the evidence document say about Nicholson's earnings?
201
+ πŸ’¬ A1: The evidence document states that Nicholson received more than $1 million
202
+ for his consulting work between January 2016 and November 2017. However,
203
+ it does not say how much he was paid for consulting for the companies
204
+ that did layoffs and shutdowns.
205
 
206
+ ──────────────────────────────────────────────────────────────────────────────
207
+ 🧠 THINK
208
+ ──────────────────────────────────────────────────────────────────────────────
209
+ Sub-claim 1 ($1 million) is partially supported, but the amount is not tied to
210
+ the specific companies. Next, verify the companies and the layoffs.
211
+
212
+ πŸ”Έ Q2: What does the evidence document say about the companies and layoffs?
213
+ πŸ’¬ A2: The evidence document states that Nicholson worked as a consultant for
214
+ companies that laid off nearly 1,900 people since 2015, shutting down
215
+ plants in Wisconsin and other states. But it also says Baldwin cites no
216
+ evidence that Nicholson's work caused the layoffs and shutdowns β€” only
217
+ some element of truth, our definition of Mostly False.
218
 
219
  ──────────────────────────────────────────────────────────────────────────────
220
  🧠 THINK
221
  ──────────────────────────────────────────────────────────────────────────────
222
+ The causal link between Nicholson's consulting and the layoffs is unsupported.
223
+ The document explicitly rates the claim Mostly False, so the overall claim is
224
+ refuted.
225
 
226
  ==============================================================================
227
  βœ… VERIFICATION: Refuted
 
254
  | **Micro-average** (sample-weighted) | 14,503 | **0.8445** |
255
  | **Macro-average** | β€” | **0.8417** |
256
 
257
+ ### Out-of-domain
258
 
259
  | Dataset | # Examples | Balanced Acc | Accuracy | F1 |
260
  |---|---:|---:|---:|---:|
261
+ | Coverbench | 728 | **0.6021** | 0.5989 | 0.6086 |
262
+ | LLM-AggreFact | 29,320 | **0.7695** | 0.8510 | 0.9054 |
 
263
 
264
  ## Intended Use
265
 
 
268
 
269
  The model is trained to say *"I don't know"* when the evidence document is silent β€” please respect that signal in downstream systems instead of forcing a label.
270
 
271
+ ## Citation
272
+
273
+ ```bibtex
274
+
275
+ ```
276
+
277
  ## License
278
 
279
  Released under the Apache 2.0 License.