Safetensors
English
llama
ritaranx commited on
Commit
9547458
·
verified ·
1 Parent(s): d53b0b7

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +142 -0
README.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ datasets:
4
+ - AceSearcher/Search-SFT
5
+ - AceSearcher/Search-RFT-Prompts
6
+ language:
7
+ - en
8
+ base_model:
9
+ - meta-llama/Llama-3.1-8B-Instruct
10
+ ---
11
+ ## Introduction
12
+ Here is the checkpoint used in the paper **AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play**. It uses `Llama-3.1-8B` as the backbone.
13
+
14
+ ## Model Usage
15
+ For question decomposition on QA tasks:
16
+ ```
17
+ prompt_plan_qa = """Please break down the question "{question}" into multiple specific sub-questions that address individual components of the original question.
18
+ 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.
19
+ Decomposed Question:"""
20
+
21
+ prompt_qa = prompt_plan_qa.replace("{question}", question)
22
+
23
+ prompt = [
24
+ {"role": "user", "content": prompt_qa.strip()}
25
+ ]
26
+
27
+ text = tokenizer.apply_chat_template(
28
+ prompt,
29
+ tokenize=False,
30
+ add_generation_prompt=True,
31
+ enable_thinking=False
32
+ )
33
+
34
+ outputs = llm.generate([text], sampling_params)
35
+ generated_text = outputs[0].outputs[0].text
36
+ ```
37
+
38
+ For question decomposition on fact verification tasks:
39
+ ```
40
+ 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.
41
+ Begin each sub-claim with ###. If needed, refer to answers from earlier sub-claims using #1, #2, etc.
42
+ Decomposed claim:"""
43
+
44
+ prompt_plan_claim = prompt_plan_claim.replace("{question}", question)
45
+
46
+ prompt = [
47
+ {"role": "user", "content": prompt_plan_claim.strip()}
48
+ ]
49
+
50
+ text = tokenizer.apply_chat_template(
51
+ prompt,
52
+ tokenize=False,
53
+ add_generation_prompt=True,
54
+ enable_thinking=False
55
+ )
56
+
57
+ outputs = llm.generate([text], sampling_params)
58
+ generated_text = outputs[0].outputs[0].text
59
+ ```
60
+
61
+ For question answering for subquestions:
62
+ ```
63
+ prompt = f"""You have the following context passages:
64
+ {context_text}
65
+
66
+ Please answer the question '{sub_q}' with a short span using the context as reference.
67
+ If no answer is found in the context, use your own knowledge. Your answer needs to be as short as possible."""
68
+ ```
69
+
70
+ For fact verification tasks for subquestions:
71
+ ```
72
+ prompt = f"""You have the following context passages:
73
+ {context_text}
74
+
75
+ Please verify whether the claim '{sub_q}' is correct using the context as reference.
76
+ If no answer is found in the context, use your own knowledge.
77
+ Please only output Yes or No and do not give any explanation."""
78
+ ```
79
+
80
+ For question answering to generate the final answer:
81
+ ```
82
+ prompt = f"""You have the following passages:
83
+ {passages}
84
+
85
+ You are also given some subquestions and their answers:
86
+ {sub_answer_text}
87
+
88
+ Please answer the question '{original_question}' with {final_prompt} using the documents and subquestions as reference.
89
+ 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.
90
+ Wrap your answer with <answer> and </answer> tags."""
91
+ ```
92
+
93
+ For fact verification tasks to generate the final answer:
94
+ ```
95
+ prompt = f"""You have the following passages:
96
+ {passages}
97
+
98
+ You are given some subquestions and their answers:
99
+ {sub_answer_text}
100
+
101
+ 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.
102
+ Wrap your answer with <answer> and </answer> tags."""
103
+ ```
104
+
105
+ For Decomposition for document-level financial reasoning tasks:
106
+ ```
107
+ decompose_prompt = """You have the following passages and table:\nPassages:\n{passage}\nPlease 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."""
108
+
109
+ qa_prompt = """You have the following passages and table:\nPassages:\n{passage}\nFor the question '{question}', here is a referenced breakdown:\n{decompose}.\n\nWrite a Python program to solve the question. Store the final result in the variable ans."""
110
+
111
+
112
+ 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)"
113
+
114
+ context_text = "\n|||December 31,||\n||Useful Life|2019|2018|\n|Computer equipment and software|3 \u2013 5 years|$57,474|$52,055|\n|Furniture and fixtures|7 years|6,096|4,367|\n|Leasehold improvements|2 \u2013 6 years|22,800|9,987|\n|Renovation in progress|n/a|8|1,984|\n|Build-to-suit property|25 years|\u2014|51,058|\n|Total property and equipment, gross||86,378|119,451|\n|Less: accumulated depreciation and amortization||(49,852)|(42,197)|\n|Total property and equipment, net||$36,526|$77,254|\n 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.\n"
115
+
116
+ decompose_prompt = decompose_prompt.replace("{passage}" , context_text)
117
+ decompose_prompt = decompose_prompt.replace("{question}", question)
118
+ message = [{"role": "user", "content": decompose_prompt.strip()}]
119
+ prompt = tokenizer.apply_chat_template(message, tokenize=False, add_generation_prompt=True)
120
+ generated_text = llm.generate(prompt, sampling_params)[0].outputs[0].text
121
+
122
+ qa_prompt = qa_prompt.replace("{passage}", context_text)
123
+ qa_prompt = qa_prompt.replace("{question}", question)
124
+ qa_prompt = qa_prompt.replace("{decompose}", generated_text)
125
+ message = [{"role": "user", "content": qa_prompt.strip()}]
126
+ prompt = tokenizer.apply_chat_template(message, tokenize=False, add_generation_prompt=True)
127
+ output = llm.generate(prompt, sampling_params)[0].outputs[0].text
128
+ ```
129
+
130
+ ## Citation
131
+ If you find our paper or models helpful, please consider cite as follows. Thank you!
132
+
133
+ ```
134
+ @inproceedings{
135
+ xu2025acesearcher,
136
+ title={AceSearcher: Bootstrapping Reasoning and Search for LLMs via Reinforced Self-Play},
137
+ 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 },
138
+ booktitle={the 39th Annual Conference on Neural Information Processing Systems},
139
+ year={2025},
140
+ url={https://openreview.net/forum?id=jSgCM0uZn3}
141
+ }
142
+ ```