HOTPOTQA_COT = '''What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? Step 1: Identify the eastern sector of the Colorado Orogeny The Colorado Orogeny refers to a series of mountain-building events that occurred in the Rocky Mountains, primarily in the present-day U.S. state of Colorado. The eastern sector of the Colorado Orogeny likely refers to the easternmost part of this mountain range, which includes the Front Range, Wet Mountains, and the Sangre de Cristo Mountains. Step 2: Determine the elevation range of the eastern sector The Front Range, Wet Mountains, and Sangre de Cristo Mountains have varying elevations. The Front Range has elevations ranging from around 5,000 feet to over 14,000 feet (1,500 meters to 4,300 meters). The Wet Mountains have elevations ranging from about 6,000 feet to over 12,000 feet (1,800 meters to 3,700 meters). The Sangre de Cristo Mountains have elevations ranging from approximately 7,000 feet to over 14,000 feet (2,100 meters to 4,300 meters). Step 3: Combine the elevation ranges Considering the elevation ranges of the three mountain ranges in the eastern sector of the Colorado Orogeny, the overall elevation range for the area extends from around 5,000 feet (1,500 meters) to over 14,000 feet (4,300 meters). Answer: 5,000 feet to 4,000 feet ''' HOTPOTQA_REACT = 'Solve a question answering task with interleaving Thought, Action, Observation steps. Thought can reason about the current situation, and Action can be three types:\n(1) Search[entity], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search.\n(2) Lookup[keyword], which returns the next sentence containing keyword in the current passage.\n(3) Finish[answer], which returns the answer and finishes the task.\nHere are some examples.\n\nQuestion: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into?\nThought: I need to search Colorado orogeny, find the area that the eastern sector of the Colorado orogeny extends into, then find the elevation range of the area.\nAction: Search[Colorado orogeny]\nObservation: The Colorado orogeny was an episode of mountain building (an orogeny) in Colorado and surrounding areas.\nThought: It does not mention the eastern sector. So I need to look up eastern sector.\nAction: Lookup[eastern sector]\nObservation: (Result 1 / 1) The eastern sector extends into the High Plains and is called the Central Plains orogeny.\nThought: The eastern sector of Colorado orogeny extends into the High Plains. So I need to search High Plains and find its elevation range.\nAction: Search[High Plains]\nObservation: High Plains refers to one of two distinct land regions\nThought: I need to instead search High Plains (United States).\nAction: Search[High Plains (United States)]\nObservation: The High Plains are a subregion of the Great Plains. From east to west, the High Plains rise in elevation from around 1,800 to 7,000 ft (550 to 2,130 m).[3]\nThought: High Plains rise in elevation from around 1,800 to 7,000 ft, so the answer is 1,800 to 7,000 ft.\nAction: Finish[1,800 to 7,000 ft]\n\nQuestion: Musician and satirist Allie Goertz wrote a song about the "The Simpsons" character Milhouse, who Matt Groening named after who?\nThought: The question simplifies to "The Simpsons" character Milhouse is named after who. I only need to search Milhouse and find who it is named after.\nAction: Search[Milhouse]\nObservation: Milhouse Mussolini Van Houten is a recurring character in the Fox animated television series The Simpsons voiced by Pamela Hayden and created by Matt Groening.\nThought: The paragraph does not tell who Milhouse is named after, maybe I can look up "named after".\nAction: Lookup[named after]\nObservation: (Result 1 / 1) Milhouse was named after U.S. president Richard Nixon, whose middle name was Milhous.\nThought: Milhouse was named after U.S. president Richard Nixon, so the answer is Richard Nixon.\nAction: Finish[Richard Nixon]\n\nQuestion: Which documentary is about Finnish rock groups, Adam Clayton Powell or The Saimaa Gesture?\nThought: I need to search Adam Clayton Powell and The Saimaa Gesture, and find which documentary is about Finnish rock groups.\nAction: Search[Adam Clayton Powell]\nObservation: Could not find [Adam Clayton Powell]. Similar: [’Adam Clayton Powell III’, ’Seventh Avenue (Manhattan)’, ’Adam Clayton Powell Jr. State Office Building’, ’Isabel Washington Powell’, ’Adam Powell’, ’Adam Clayton Powell (film)’, ’Giancarlo Esposito’].\nThought: To find the documentary, I can search Adam Clayton Powell (film).\nAction: Search[Adam Clayton Powell (film)]\nObservation: Adam Clayton Powell is a 1989 American documentary film directed by Richard Kilberg. The film is about the rise and fall of influential African-American politician Adam Clayton Powell Jr.[3][4] It was later aired as part of the PBS series The American Experience.\nThought: Adam Clayton Powell (film) is a documentary about an African-American politician, not Finnish rock groups. So the documentary about Finnish rock groups must instead be The Saimaa Gesture.\nAction: Finish[The Saimaa Gesture]\n\nQuestion: What profession does Nicholas Ray and Elia Kazan have in common?\nThought: I need to search Nicholas Ray and Elia Kazan, find their professions, then find the profession they have in common.\nAction: Search[Nicholas Ray]\nObservation: Nicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.\nThought: Professions of Nicholas Ray are director, screenwriter, and actor. I need to search Elia Kazan next and find his professions.\nAction: Search[Elia Kazan]\nObservation: Elia Kazan was an American film and theatre director, producer, screenwriter and actor.\nThought: Professions of Elia Kazan are director, producer, screenwriter, and actor. So profession Nicholas Ray and Elia Kazan have in common is director, screenwriter, and actor.\nAction: Finish[director, screenwriter, actor]\n\nQuestion: Which magazine was started first Arthur’s Magazine or First for Women?\nThought: I need to search Arthur’s Magazine and First for Women, and find which was started first.\nAction: Search[Arthur’s Magazine]\nObservation: Arthur’s Magazine (1844-1846) was an American literary periodical published in Philadelphia in the 19th century.\nThought: Arthur’s Magazine was started in 1844. I need to search First for Women next.\nAction: Search[First for Women]\nObservation: First for Women is a woman’s magazine published by Bauer Media Group in the USA.[1] The magazine was started in 1989.\nThought: First for Women was started in 1989. 1844 (Arthur’s Magazine) < 1989 (First for Women), so Arthur’s Magazine was started first.\nAction: Finish[Arthur’s Magazine]\n\nQuestion: Were Pavel Urysohn and Leonid Levin known for the same type of work?\nThought: I need to search Pavel Urysohn and Leonid Levin, find their types of work, then find if they are the same.\nAction: Search[Pavel Urysohn]\nObservation: Pavel Samuilovich Urysohn (February 3, 1898 - August 17, 1924) was a Soviet mathematician who is best known for his contributions in dimension theory.\nThought: Pavel Urysohn is a mathematician. I need to search Leonid Levin next and find its type of work.\nAction: Search[Leonid Levin]\nObservation: Leonid Anatolievich Levin is a Soviet-American mathematician and computer scientist.\nThought: Leonid Levin is a mathematician and computer scientist. So Pavel Urysohn and Leonid Levin have the same type of work.\nAction: Finish[yes]\n\n\nQuestion: {input}\n{agent_scratchpad}' HOTPOTQA_PWS_BASE = '''Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? Plan: Search for more information about Colorado orogeny. #E1 = Wikipedia[Colorado orogeny] Plan: Find out the area that eastern sector of the Colorado orogeny extends into. #E2 = LLM[What is the name of the area that eastern sector of Colorado extends into? Given context: #E1] Plan: Search for more information about the area. #E3 = Wikipedia[#E2] Plan: Find out the elevation range for the area. #E4 = LLM[What is elevation range for the area #E2? Given context: #E3] Question: Musician and satirist Allie Goertz wrote a song about the "The Simpsons" character Milhouse, who Matt Groening named after who? Plan: Search for more information about Milhouse. #E1 = Wikipedia[Milhouse] Plan: Find out who Matt Groening named Milhouse after. #E2 = LLM[Who did Matt Groening name Milhouse after? Given context: #E1] Question: Which documentary is about Finnish rock groups, Adam Clayton Powell or The Saimaa Gesture? Plan: Search for more information about Adam Clayton Powell. #E1 = Wikipedia[Adam Clayton Powell] Plan: Search for more information about The Saimaa Gesture. #E2 = Wikipedia[The Saimaa Gesture] Plan: Compare the two and determine which is a documentary about Finnish rock groups. #E3 = LLM[Which documentary is about Finnish rock groups, Adam Clayton Powell or The Saimaa Gesture? Given context: #E1, #E2] Question: What profession does Nicholas Ray and Elia Kazan have in common? Plan: Search for more information about Nicholas Ray. #E1 = Wikipedia[Nicholas Ray] Plan: Search for more information about Elia Kazan. #E2 = Wikipedia[Elia Kazan] Plan: Compare the two and determine what profession they have in common. #E3 = LLM[What profession does Nicholas Ray and Elia Kazan have in common? Given context: #E1, #E2] Question: Which magazine was started first Arthur's Magazine or First for Women? Plan: Search for more information about Arthur's Magazine. #E1 = Wikipedia[Arthur's Magazine] Plan: Search for more information about First for Women. #E2 = Wikipedia[First for Women] Plan: Compare the two start dates and determine which magazine was started first. #E3 = LLM[Which magazine was started first Arthur's Magazine or First for Women? Given context: #E1, #E2] Question: Were Pavel Urysohn and Leonid Levin known for the same type of work? Plan: Search for more information about Pavel Urysohn. #E1 = Wikipedia[Pavel Urysohn] Plan: Search for more information about Leonid Levin. #E2 = Wikipedia[Leonid Levin] Plan: Compare the two and determine if they were known for the same type of work. #E3 = LLM[Were Pavel Urysohn and Leonid Levin known for the same type of work? Given context: #E1, #E2] ''' HOTPOTQA_PWS_EXTRA = '''Question: What is Leo Dicaprio's girlfriend's age to the power of 0.34? Plan: Find out the name of Leo Dicaprio's girlfriend. #E1 = Google[name of Leo Dicaprio's girlfriend] Plan: Find out the age of Leo Dicaprio's girlfriend. #E2 = Google[age of #E1] Plan: Calculate her age to the power of 0.34. #E3 = Calculator[#E2^0.34] ''' TRIVIAQA_COT = '''What is the name of the river on which Bakewell stands? Step 1: Identify the location of Bakewell. Bakewell is a small town in Derbyshire, England. Step 2: Search for the river that passes through Bakewell. The River Wye flows through the town. Answer: River Wye ''' TRIVIAQA_REACT = '''Solve a question answering task with interleaving Thought, Action, Observation steps. Thought can reason about the current situation, and Action can be three types: (1) Search[entity], which searches the exact entity on Wikipedia and returns the first paragraph if it exists. If not, it will return some similar entities to search. (2) Lookup[keyword], which returns the next sentence containing keyword in the current passage. (3) Finish[answer], which returns the answer and finishes the task. Here are some examples. Question: What is the name of the river on which Bakewell stands? Thought: I need to search Bakewell and find out its location. Action: Search[Bakewell] Observation: Bakewell is a market town and civil parish in the Derbyshire Dales district of Derbyshire, England, known for Bakewell pudding. It lies on the River Wye, 13 miles (21 km) south-west of Sheffield. At the 2011 census, the population of the civil parish was 3,949. It was estimated at 3,695 in 2019. The town is close to the tourist attractions of Chatsworth House and Haddon Hall. Thought: Now I know that Bakewell lies on the River Wye. Action: Finish[River Wye] Question: {input} {agent_scratchpad} ''' TRIVIAQA_PWS = '''Which Asian capital city is known as Krung Thep to its inhabitants and stands on the Chao Phraya River? Plan: Search for more information about Krung Thep #E1 = Wikipedia[Krung Thep] Plan: Search for more information about Chao Phraya River #E2 = Wikipedia[Chao Phraya River] Plan: Find out the name of the river on which Bakewell stands. #E3 = LLM[What is the name of the river on which Bakewell stands? Given context: #E1 and #E2] ''' GSM8K_COT = '''Thomas, Toby, and Rebecca worked a total of 157 hours in one week. Thomas worked x hours. Toby worked 10 hours less than twice what Thomas worked, and Rebecca worked 8 hours less than Toby. How many hours did Rebecca work? Step 1: Translate the problem into algebraic expressions. Thomas = x Toby = 2x - 10 Rebecca = (2X - 10) - 8 Step 2: Use the total hours worked in a week to set up an equation. Total hours worked = 157 x + (2x - 10) + ((2x - 10) - 8) = 157 Step 3: Solve the equation. x + 2x - 10 + 2x - 10 - 8 = 157 5x - 28 = 157 5x = 185 x = 37 Step 4: Find the number of hours Rebecca worked. Rebecca = (2x - 10) - 8 Rebecca = (2 * 37 - 10) - 8 Rebecca = 74 - 10 - 8 Rebecca = 56 Answer: 56 ''' DEFAULT_REACT = '''Use the following format: Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [WolframAlpha, Calculator, LLM] Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know the final answer Final Answer: the final answer to the original input questionHere are some examples. Begin! Question: {input} {agent_scratchpad} ''' GSM8K_REACT = '''Use the following format: Question: the input question you must answer Thought: you should always think about what to do Action: the action to take, should be one of [WolframAlpha, Calculator, LLM] Action Input: the input to the action Observation: the result of the action ... (this Thought/Action/Action Input/Observation can repeat N times) Thought: I now know the final answer Final Answer: the final answer to the original input questionHere are some examples. For Example: Gary manages two Amazon distribution centers. The first center processes 10000 packages per day, and the second center processes three times that volume. If Amazon makes 5 cents of profit per package, how much profit per week do the two centers make combined? Thought: I need to know the total number of packages processed by two centers per week. Action: Calculator Action Input: (10000 * 7) + (3 * 10000 * 7) Observation: 280000 Thought: Now I know how much profit the two centers make combined per week. Action: Calculator Action Input: 280000 * 0.05 Observation: 14000 Thought: I now know the final answer Final Answer: 14000 Begin! Question: {input} {agent_scratchpad} ''' GSM8K_PWS = '''For Example: Thomas, Toby, and Rebecca worked a total of 157 hours in one week. Thomas worked x hours. Toby worked 10 hours less than twice what Thomas worked, and Rebecca worked 8 hours less than Toby. How many hours did Rebecca work? Plan: Given Thomas worked x hours, translate the problem into algebraic expressions and solve with Wolfram Alpha. #E1 = WolframAlpha[Solve x + (2x - 10) + ((2x - 10) - 8) = 157] Plan: Find out the number of hours Thomas worked. #E2 = LLM[What is x, given #E1] Plan: Find out the number of hours Rebecca worked. #E3 = Calculator[(2 * #E2 - 10) - 8] ''' STRATEGY_COT = '''What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? Step 1: Identify the eastern sector of the Colorado Orogeny The Colorado Orogeny refers to a series of mountain-building events that occurred in the Rocky Mountains, primarily in the present-day U.S. state of Colorado. The eastern sector of the Colorado Orogeny likely refers to the easternmost part of this mountain range, which includes the Front Range, Wet Mountains, and the Sangre de Cristo Mountains. Step 2: Determine the elevation range of the eastern sector The Front Range, Wet Mountains, and Sangre de Cristo Mountains have varying elevations. The Front Range has elevations ranging from around 5,000 feet to over 14,000 feet (1,500 meters to 4,300 meters). The Wet Mountains have elevations ranging from about 6,000 feet to over 12,000 feet (1,800 meters to 3,700 meters). The Sangre de Cristo Mountains have elevations ranging from approximately 7,000 feet to over 14,000 feet (2,100 meters to 4,300 meters). Step 3: Combine the elevation ranges Considering the elevation ranges of the three mountain ranges in the eastern sector of the Colorado Orogeny, the overall elevation range for the area extends from around 5,000 feet (1,500 meters) to over 14,000 feet (4,300 meters). Answer: 5,000 feet to 4,000 feet ''' INSTRUCTION_FINETUNE_PREFIX = ''' For the following tasks, make plans that can solve the problem step-by-step. For each plan, indicate which external tool together with tool input to retrieve evidence. You can store the evidence into a variable #E that can be called by later tools. (Plan, #E1, Plan, #E2, Plan, ...) Tools can be one of the following: Wikipedia[input]: Worker that search for similar page contents from Wikipedia. Useful when you need to get holistic knowledge about people, places, companies, historical events, or other subjects. The response are long and might contain some irrelevant information. Input should be a search query. LLM[input]: A pretrained LLM like yourself. Useful when you need to act with general world knowledge and common sense. Prioritize it when you are confident in solving the problem yourself. Input can be any instruction. Question: What is the elevation range for the area that the eastern sector of the Colorado orogeny extends into? Plan: Search for more information about Colorado orogeny. #E1 = Wikipedia[Colorado orogeny] Plan: Find out the area that eastern sector of the Colorado orogeny extends into. #E2 = LLM[What is the name of the area that eastern sector of Colorado extends into? Given context: #E1] Plan: Search for more information about the area. #E3 = Wikipedia[#E2] Plan: Find out the elevation range for the area. #E4 = LLM[What is elevation range for the area #E2? Given context: #E3] Question: Musician and satirist Allie Goertz wrote a song about the "The Simpsons" character Milhouse, who Matt Groening named after who? Plan: Search for more information about Milhouse. #E1 = Wikipedia[Milhouse] Plan: Find out who Matt Groening named Milhouse after. #E2 = LLM[Who did Matt Groening name Milhouse after? Given context: #E1] ''' INSTRUCTION_FINETUNE_SUFFIX = ''' Now make plans for each of the following questions. Your answer should follow the same format as the exemplars above. Like this: Question: xxxx Plan: xxxx #E1 = xxxx Plan: xxxx ... ''' STUDY_ABROAD_PWS = '''Example 1: Question: What specific documents do I need to prepare for Oxford University application? Plan: Search for information about required documents for Oxford applications. #E1 = Wikipedia[Oxford University application requirements] Plan: Find details on GMAT score requirements. #E2 = LLM[What are the GMAT score report requirements for Oxford University? Given context: #E1] Plan: Find details on transcript submission requirements. #E3 = LLM[What are the transcript requirements for Oxford University applications? Given context: #E1] Plan: Find information on personal statement requirements. #E4 = LLM[What should be included in a personal statement for Oxford University? Given context: #E1] Example 2: Question: What are my chances of getting a scholarship for graduate studies in France with a GPA of 3.0? Plan: Search for scholarship requirements in French universities. #E1 = Google[scholarship requirements French universities international students GPA] Plan: Find information about specific scholarship programs. #E2 = LLM[What scholarship programs are available for international students in France? Given context: #E1] Plan: Analyze chances with given GPA. #E3 = LLM[What are the chances of getting a scholarship with a 3.0 GPA in French universities? Given context: #E1, #E2] Plan: Find alternative options and recommendations. #E4 = LLM[What alternative options or recommendations are there for students with lower GPAs? Given context: #E1, #E2, #E3] Example 3: Question: What is the estimated cost for studying MBA at Stanford University for one year? Plan: Search for Stanford MBA program costs. #E1 = Wikipedia[Stanford MBA program costs] Plan: Find the current tuition fee. #E2 = LLM[What is the current annual tuition fee for Stanford MBA? Given context: #E1] Plan: Calculate living expenses in Stanford area. #E3 = LLM[What are the estimated living expenses for Stanford MBA students? Given context: #E1] Plan: Calculate total estimated cost. #E4 = Calculator[#E2 + #E3] Example 4: Question: Em có GPA 3.2, IELTS 6.5 và muốn xin học bổng du học ngành kỹ thuật ở Pháp. Em muốn hỏi cơ hội học bổng và yêu cầu ngôn ngữ ạ? Plan: Tìm thông tin về học bổng cho sinh viên quốc tế tại Pháp. #E1 = Google[học bổng du học Pháp ngành kỹ thuật điều kiện GPA IELTS] Plan: Phân tích cơ hội với điểm số hiện tại. #E2 = LLM[Với GPA 3.2 và IELTS 6.5, cơ hội xin học bổng du học Pháp ngành kỹ thuật như thế nào? Given context: #E1] Plan: Tìm hiểu yêu cầu ngôn ngữ. #E3 = Google[yêu cầu tiếng Pháp du học Pháp ngành kỹ thuật TCF DELF] Plan: Đề xuất các lựa chọn phù hợp. #E4 = LLM[Có những lựa chọn học bổng nào phù hợp và cần chuẩn bị gì thêm? Given context: #E1, #E2, #E3] Example 5: Question: Em đang học năm cuối ngành dược, GPA 3.5, IELTS 7.0. Em muốn tìm học bổng du học Canada với chi phí thấp nhất có thể. Chi phí em chỉ có khoảng 300 triệu. Xin tư vấn ạ? Plan: Tìm thông tin về chi phí du học ngành dược tại Canada. #E1 = Google[chi phí du học Canada ngành dược học phí sinh hoạt] Plan: Tìm kiếm các chương trình học bổng phù hợp. #E2 = Google[học bổng du học Canada ngành dược điều kiện GPA IELTS] Plan: Phân tích khả năng với ngân sách hiện có. #E3 = LLM[Với 300 triệu và điểm GPA 3.5, IELTS 7.0, có những lựa chọn nào phù hợp để du học Canada ngành dược? Given context: #E1, #E2] Plan: Tìm thêm thông tin về cơ hội làm thêm và giảm chi phí. #E4 = LLM[Có những cách nào để giảm chi phí và tăng thu nhập khi du học Canada? Given context: #E1] Example 6: Question: Em muốn hỏi về điều kiện và yêu cầu để xin học bổng du học Pháp ngành công nghệ thông tin ạ. Em có IELTS 6.5 và TCF B1, không biết có cần nâng TCF lên B2 không ạ? Plan: Tìm thông tin về yêu cầu ngôn ngữ du học Pháp. #E1 = Google[yêu cầu tiếng Pháp du học Pháp ngành CNTT TCF DELF] Plan: Kiểm tra yêu cầu cụ thể cho ngành CNTT. #E2 = LLM[Yêu cầu trình độ tiếng Pháp cho ngành CNTT tại các trường đại học Pháp là gì? Given context: #E1] Plan: Tìm thông tin về học bổng có sẵn. #E3 = Google[học bổng du học Pháp ngành CNTT điều kiện IELTS TCF] Plan: Đưa ra lời khuyên về việc nâng trình độ ngôn ngữ. #E4 = LLM[Có cần nâng TCF từ B1 lên B2 cho du học Pháp ngành CNTT không? Given context: #E1, #E2] '''