Appendix A Instruction Templates

本文为论文《Search-o1:让推理模型学会边思考边检索》「论文原文」板块的对应章节,按 arXiv 官方全文逐字保留,层级与「中文全文翻译」板块一一对应。

A.1 Instructions for Search-o1

Instruction for Search-o1

You are a reasoning assistant with the ability to perform web searches to help you answer the user’s question accurately. You have special tools: To perform a search: write <|begin_search_query|> your query here <|end_search_query|>. Then, the system will search and analyze relevant web pages, then provide you with helpful information in the format <|begin_search_result|> …search results… <|end_search_result|>. You can repeat the search process multiple times if necessary. The maximum number of search attempts is limited to {MAX_SEARCH_LIMIT}. Once you have all the information you need, continue your reasoning. Example: Question: “…” Assistant thinking steps: - I might need to look up details about … Assistant: <|begin_search_query|>…<|end_search_query|> (System returns processed information from relevant web pages) Assistant continues reasoning with the new information… Remember: - Use <|begin_search_query|> to request a web search and end with <|end_search_query|>. - When done searching, continue your reasoning.

Instruction for Reason-in-Documents

Task Instruction: You are tasked with reading and analyzing web pages based on the following inputs: Previous Reasoning Steps, Current Search Query, and Searched Web Pages. Your objective is to extract relevant and helpful information for Current Search Query from the Searched Web Pages and seamlessly integrate this information into the Previous Reasoning Steps to continue reasoning for the original question. Guidelines: 1. Analyze the Searched Web Pages: - Carefully review the content of each searched web page. - Identify factual information that is relevant to the Current Search Query and can aid in the reasoning process for the original question. 2. Extract Relevant Information: - Select the information from the Searched Web Pages that directly contributes to advancing the Previous Reasoning Steps. - Ensure that the extracted information is accurate and relevant. 3. Output Format: - If the web pages provide helpful information for current search query: Present the information beginning with ‘Final Information‘ as shown below. Final Information [Helpful information] - If the web pages do not provide any helpful information for current search query: Output the following text. Final Information No helpful information found. Inputs: - Previous Reasoning Steps: {prev_reasoning} - Current Search Query: {search_query} - Searched Web Pages: {document} Now you should analyze each web page and find helpful information based on the current search query “{search_query}” and previous reasoning steps.

A.2 Instructions for Standard RAG

Instruction for Standard RAG

You are a knowledgeable assistant that utilizes the provided documents to answer the user’s question accurately. Question: {question} Documents: {documents} Guidelines: - Analyze the provided documents to extract relevant information. Synthesize the information to formulate a coherent and accurate answer. - Ensure that your response directly addresses the user’s question using the information from the documents.

A.3 Instructions for RAG Agent

Instruction for RAG Agent

You are a reasoning assistant with the ability to perform web searches and retrieve webpage content to help you answer the user’s question accurately. You have special tools: - To perform a search: Write ‘<|begin_search_query|>’ your query here ‘<|end_search_query|>’. The system will call the web search API with your query and return the search results in the format ‘<|begin_search_result|> …search results… <|end_search_result|>’. The search results will include a list of webpages with titles, URLs, and snippets (but not full content). - To retrieve full page content: After receiving the search results, if you need more detailed information from specific URLs, write ‘<|begin_url|> url1, url2, … <|end_url|>’. The system will fetch the full page content of those URLs and return it as ‘<|begin_full_page|> …full page content… <|end_full_page|>’. You can repeat the search process multiple times if necessary. The maximum number of search attempts is limited to {MAX_SEARCH_LIMIT}. You can fetch up to {MAX_URL_FETCH} URLs for detailed information. Once you have all the information you need, continue your reasoning. Example: Question: “…” Assistant thinking steps: - I need to find out … Assistant: ‘<|begin_search_query|>…<|end_search_query|>’ (System returns search results) Assistant: ‘<|begin_search_result|> …search results without full page… <|end_search_result|>’ Assistant thinks: The search results mention several URLs. I want full details from one of them. Assistant: ‘<|begin_url|>http://…<|end_url|>’ (System returns full page content) Assistant: ‘<|begin_full_page|> …full page content… <|end_full_page|>’ Now the assistant has enough information and can continue reasoning. Remember: - Use ‘<|begin_search_query|>’ to request a web search and end with ‘<|end_search_query|>’. - Use ‘<|begin_url|>’ to request full page content and end with ‘<|end_url|>’. - When done retrieving information, continue your reasoning.

A.4 Task-Specific Instructions
A.4.1 Open-Domain QA Tasks Instruction

Instruction for Open-Domain QA Tasks

Please answer the following question. You should provide your final answer in the format \boxed{YOUR_ANSWER}. Question: {question}

A.4.2 Math Tasks Instruction

Instruction for Math Tasks

Please answer the following math question. You should provide your final answer in the format \boxed{YOUR_ANSWER}. Question: {question}

A.4.3 Multi-choice Tasks Instruction

Instruction for Multi-choice Tasks

You are to answer the following multiple-choice question by selecting the correct option. Your final choice should be one of the letters A, B, C, or D. Do not include any answer content beyond the choice letter. You should provide your final choice in the format \boxed{YOUR_CHOICE}. Question: {question}

A.4.4 Code Tasks Instruction

Instruction for Code Tasks

Generate a correct Python program that passes all tests for the given problem. You should provide your final code within a Python code block using triple backticks. ‘‘‘python

YOUR CODE HERE

‘‘‘

Problem Title: {question_title} Problem Statement: {question}

A.5 Additional Notes

For all the instructions above, we input them as user prompts, not system prompts. The task-specific instructions in A.4 are used for the QwQ-32B-Preview model. For non-reasoning models like Qwen2.5-32B-Instruct, Qwen2.5-72B-Instruct, and Llama3.3-70B-Instruct, etc., we add a Chain-of-Thought prompt "You should think step by step to solve it." before the question to explicitly make these models reason before giving the final answer.