Improve dataset card: Add metadata, paper/code links, and comprehensive usage examples

#1
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +209 -3
README.md CHANGED
@@ -1,3 +1,209 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ task_categories:
4
+ - question-answering
5
+ - text-retrieval
6
+ - text-generation
7
+ language:
8
+ - en
9
+ tags:
10
+ - rag
11
+ - llm
12
+ - reasoning
13
+ - search
14
+ - multi-hop-reasoning
15
+ - fact-verification
16
+ - reinforced-self-play
17
+ ---
18
+
19
+ # AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play
20
+
21
+ This repository contains the datasets and resources for **AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play**. AceSearcher is a cooperative self-play framework that trains a single large language model (LLM) to alternate between a decomposer that breaks down complex queries and a solver that integrates retrieved contexts for answer generation, eliminating the need for intermediate annotations. AceSearcher significantly enhances LLMs' ability to tackle complex reasoning tasks by coupling supervised fine-tuning with reinforcement fine-tuning optimized for final answer accuracy.
22
+
23
+ - **Paper:** [AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play](https://huggingface.co/papers/2509.24193)
24
+ - **Code:** [https://github.com/ritaranx/AceSearcher/](https://github.com/ritaranx/AceSearcher/)
25
+
26
+ ## Data Download
27
+
28
+ The AceSearcher project comprises several datasets available on Hugging Face:
29
+
30
+ | Resource | Link |
31
+ |:----------------|:------|
32
+ | SFT Data | [AceSearcher/Search-SFT](https://huggingface.co/datasets/AceSearcher/Search-SFT) |
33
+ | RFT Data | [AceSearcher/Search-RFT-Pairs](https://huggingface.co/datasets/AceSearcher/Search-RFT-Pairs) |
34
+ | RFT Prompts | [AceSearcher/Search-RFT-Prompts](https://huggingface.co/datasets/AceSearcher/Search-RFT-Prompts) |
35
+ | Evaluation Data | [AceSearcher/evaluation_datasets](https://huggingface.co/datasets/AceSearcher/evaluation_datasets) |
36
+
37
+ ## Data Generation
38
+
39
+ Most of the data generation used in AceSearcher is in the `rollout` folder of the [code repository](https://github.com/ritaranx/AceSearcher/). The description for files are listed as belows:
40
+ - `rs_mhqa.py` | `rs_cot.py` | `rs_pot.py`: [Step 1] the rollout pipeline for multi-hop QA, chain-of-thought, and program-of-thought datasets.
41
+ - `create_training_pairs.py`: [Step 2] the process for filtering & selecting preference pairs in mDPO iterations.
42
+ - `create_dpo_pairs.py`: [Step 3] the process of curating the final preference pairs for reinforcement finetuning
43
+
44
+ ## Evaluation
45
+
46
+ For detailed evaluation scripts, please refer to the [code repository](https://github.com/ritaranx/AceSearcher/):
47
+ - **For QA / Fact Verification Datasets:**
48
+ - Use `decompose_vllm.py` to first decompose the data.
49
+ - Use `main_qa.py` to generate the final answer.
50
+ - **For Document-level Financial Reasoning Datasets:**
51
+ - Use `main_reasoning.py` for evaluation.
52
+
53
+ ## Sample Usage
54
+
55
+ Below are examples demonstrating how to use the models for various tasks, as provided in the [Github repository](https://github.com/ritaranx/AceSearcher/).
56
+
57
+ ### For question decomposition on QA tasks:
58
+ ```python
59
+ prompt_plan_qa = """Please break down the question "{question}" into multiple specific sub-questions that address individual components of the original question.
60
+ Mark each sub-question with ### at the beginning. If you need to refer to answers from earlier sub-questions, use #1, #2, etc., to indicate the corresponding answers.
61
+ Decomposed Question:"""
62
+
63
+ prompt_qa = prompt_plan_qa.replace("{question}", question)
64
+
65
+ prompt = [
66
+ {"role": "user", "content": prompt_qa.strip()}
67
+ ]
68
+
69
+ text = tokenizer.apply_chat_template(
70
+ prompt,
71
+ tokenize=False,
72
+ add_generation_prompt=True,
73
+ enable_thinking=False
74
+ )
75
+
76
+ outputs = llm.generate([text], sampling_params)
77
+ generated_text = outputs[0].outputs[0].text
78
+ ```
79
+
80
+ ### For question decomposition on fact verification tasks:
81
+ ```python
82
+ prompt_plan_claim = """Please break down the claim "{claim}" into multiple smaller sub-claims that each focus on a specific component of the original statement, making it easier for a model to verify.
83
+ Begin each sub-claim with ###. If needed, refer to answers from earlier sub-claims using #1, #2, etc.
84
+ Decomposed claim:"""
85
+
86
+ prompt_plan_claim = prompt_plan_claim.replace("{question}", question)
87
+
88
+ prompt = [
89
+ {"role": "user", "content": prompt_plan_claim.strip()}
90
+ ]
91
+
92
+ text = tokenizer.apply_chat_template(
93
+ prompt,
94
+ tokenize=False,
95
+ add_generation_prompt=True,
96
+ enable_thinking=False
97
+ )
98
+
99
+ outputs = llm.generate([text], sampling_params)
100
+ generated_text = outputs[0].outputs[0].text
101
+ ```
102
+
103
+ ### For question answering for subquestions:
104
+ ```python
105
+ prompt = f"""You have the following context passages:
106
+ {context_text}
107
+
108
+ Please answer the question '{sub_q}' with a short span using the context as reference.
109
+ If no answer is found in the context, use your own knowledge. Your answer needs to be as short as possible."""
110
+ ```
111
+
112
+ ### For fact verification tasks for subquestions:
113
+ ```python
114
+ prompt = f"""You have the following context passages:
115
+ {context_text}
116
+
117
+ Please verify whether the claim '{sub_q}' is correct using the context as reference.
118
+ If no answer is found in the context, use your own knowledge.
119
+ Please only output Yes or No and do not give any explanation."""
120
+ ```
121
+
122
+ ### For question answering to generate the final answer:
123
+ ```python
124
+ prompt = f"""You have the following passages:
125
+ {passages}
126
+
127
+ You are also given some subquestions and their answers:
128
+ {sub_answer_text}
129
+
130
+ Please answer the question '{original_question}' with {final_prompt} using the documents and subquestions as reference.
131
+ Make sure your response is grounded in documents and provides clear reasoning followed by a concise conclusion. If no relevant information is found, use your own knowledge.
132
+ Wrap your answer with <answer> and </answer> tags."""
133
+ ```
134
+
135
+ ### For fact verification tasks to generate the final answer:
136
+ ```python
137
+ prompt = f"""You have the following passages:
138
+ {passages}
139
+
140
+ You are given some subquestions and their answers:
141
+ {sub_answer_text}
142
+
143
+ Please verify the correctness of the claim: '{original_question}' using the subquestions as reference. Please provide a concise and clear reasoning followed by a concise conclusion. Your answer should be Yes or No only.
144
+ Wrap your answer with <answer> and </answer> tags."""
145
+ ```
146
+
147
+ ### For Decomposition for document-level financial reasoning tasks:
148
+ ```python
149
+ decompose_prompt = """You have the following passages and table:
150
+ Passages:
151
+ {passage}
152
+ Please break down the question '{question}' into multiple specific sub-questions that address individual components of the original question, with the table and passages as the reference. Use ### to mark the start of each sub-question."""
153
+
154
+ qa_prompt = """You have the following passages and table:
155
+ Passages:
156
+ {passage}
157
+ For the question '{question}', here is a referenced breakdown:
158
+ {decompose}.
159
+
160
+ Write a Python program to solve the question. Store the final result in the variable ans."""
161
+
162
+
163
+ question = "What would the change in furniture and fixtures between 2018 and 2019 be if furniture and fixtures were $5,000 thousand in 2018 instead? (in thousand)"
164
+
165
+ context_text = "
166
+ |||December 31,||
167
+ ||Useful Life|2019|2018|
168
+ |Computer equipment and software|3 \u2013 5 years|$57,474|$52,055|
169
+ |Furniture and fixtures|7 years|6,096|4,367|
170
+ |Leasehold improvements|2 \u2013 6 years|22,800|9,987|
171
+ |Renovation in progress|n/a|8|1,984|
172
+ |Build-to-suit property|25 years|\u2014|51,058|
173
+ |Total property and equipment, gross||86,378|119,451|
174
+ |Less: accumulated depreciation and amortization||(49,852)|(42,197)|
175
+ |Total property and equipment, net||$36,526|$77,254|
176
+ 7. OTHER BALANCE SHEET AMOUNTS The components of property and equipment, net is as follows (in thousands): Depreciation expense for the years ended December 31, 2019, 2018, and 2017 was $11.8 million, $10.2 million, and $10.3 million, respectively.
177
+ "
178
+
179
+ decompose_prompt = decompose_prompt.replace("{passage}" , context_text)
180
+ decompose_prompt = decompose_prompt.replace("{question}", question)
181
+ message = [{"role": "user", "content": decompose_prompt.strip()}]
182
+ prompt = tokenizer.apply_chat_template(message, tokenize=False, add_generation_prompt=True)
183
+ generated_text = llm.generate(prompt, sampling_params)[0].outputs[0].text
184
+
185
+ qa_prompt = qa_prompt.replace("{passage}", context_text)
186
+ qa_prompt = qa_prompt.replace("{question}", question)
187
+ qa_prompt = qa_prompt.replace("{decompose}", generated_text)
188
+ message = [{"role": "user", "content": qa_prompt.strip()}]
189
+ prompt = tokenizer.apply_chat_template(message, tokenize=False, add_generation_prompt=True)
190
+ output = llm.generate(prompt, sampling_params)[0].outputs[0].text
191
+ ```
192
+
193
+ ## Training
194
+
195
+ The authors use the [Llama-Factory](https://github.com/hiyouga/LLaMA-Factory/) codebase for both SFT and RFT (mDPO) finetuning. Please see the `config` folder in the [code repository](https://github.com/ritaranx/AceSearcher/) for example configurations.
196
+
197
+ ## Citation
198
+
199
+ If you find this work useful, consider citing it. Thank you in advance:
200
+ ```bibtex
201
+ @inproceedings{
202
+ xu2025acesearcher,
203
+ title={AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play},
204
+ author={Ran Xu and Yuchen Zhuang and Zihan Dong and Ruiyu Wang and Yue Yu and Joyce C. Ho and Linjun Zhang and Haoyu Wang and Wenqi Shi and Carl Yang},
205
+ booktitle={the 39th Annual Conference on Neural Information Processing Systems},
206
+ year={2025},
207
+ url={https://openreview.net/forum?id=jSgCM0uZn3}
208
+ }
209
+ ```