{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Imports & Env Setup" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "%reload_ext autoreload\n", "%autoreload 2\n", "import sys\n", "import os\n", "from dotenv import load_dotenv\n", "load_dotenv()\n", "\n", "import dspy\n", "sys.path.append(os.path.abspath('../'))\n", "from prompt_migrator.benchmarks import llama_mmlu_pro, leaderboard_mmlu_pro" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Configuration" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "NUM_THREADS = 16\n", "\n", "FEW_SHOTS = 5\n", "\n", "# See https://docs.litellm.ai/docs/providers/vllm for details\n", "TASK_MODEL = dspy.LM(\n", " \"hosted_vllm/meta-llama/Llama-3.3-70B-Instruct\",\n", " api_base = 'http://localhost:8000/v1' , # or api_base ?\n", " # api_version: Optional[str] = None,\n", " # api_key: Optional[str] = None,\n", " # seed: Optional[int] = None,\n", " # max_tokens: Optional[int] = None,\n", " # timeout: Optional[Union[float, int]] = None,\n", ")\n", "PROMPT_MODEL = dspy.LM(\n", " \"hosted_vllm/meta-llama/Llama-3.3-70B-Instruct\",\n", " api_base = 'http://localhost:8000/v1', # or api_base ?\n", " # api_version: Optional[str] = None,\n", " # api_key: Optional[str] = None,\n", " # seed: Optional[int] = None,\n", " # max_tokens: Optional[int] = None,\n", " # timeout: Optional[Union[float, int]] = None,\n", ")\n", "\n", "dspy.configure(lm=TASK_MODEL)\n", "\n", "# replace this with llama_mmlu_pro or whatever\n", "benchmark = leaderboard_mmlu_pro\n", "\n", "# Without chain of thought:\n", "# program = dspy.Predict(\n", "# benchmark.signature(\"\")\n", "# )\n", "\n", "# With chain of thought:\n", "program = dspy.ChainOfThought(\n", " benchmark.signature(\"\") # put your initial system prompt here, or leave blank\n", ")\n", "\n", "evaluate = dspy.Evaluate(\n", " devset=[],\n", " metric=benchmark.metric,\n", " num_threads=NUM_THREADS,\n", " display_progress=True,\n", " display_table=True,\n", " return_all_scores=True,\n", " return_outputs=True,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Load dataset" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(1203, 2165, 8664)" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trainset, valset, testset = benchmark.datasets(\n", " train_size=0.1,\n", " validation_size=0.2,\n", ")\n", "\n", "len(trainset), len(valset), len(testset)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Optimize Subset + Evaluation" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:44:49 INFO dspy.teleprompt.mipro_optimizer_v2: \n", "RUNNING WITH THE FOLLOWING LIGHT AUTO RUN SETTINGS:\n", "num_trials: 7\n", "minibatch: False\n", "num_candidates: 5\n", "valset size: 20\n", "\n", "2025/01/15 17:44:49 INFO dspy.teleprompt.mipro_optimizer_v2: \n", "==> STEP 1: BOOTSTRAP FEWSHOT EXAMPLES <==\n", "2025/01/15 17:44:49 INFO dspy.teleprompt.mipro_optimizer_v2: These will be used as few-shot example candidates for our program and for creating instructions.\n", "\n", "2025/01/15 17:44:49 INFO dspy.teleprompt.mipro_optimizer_v2: Bootstrapping N=5 sets of demonstrations...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Bootstrapping set 1/5\n", "Bootstrapping set 2/5\n", "Bootstrapping set 3/5\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ " 20%|███████████████████████████████████████████████ | 4/20 [00:20<01:23, 5.19s/it]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Bootstrapped 4 full traces after 4 examples for up to 1 rounds, amounting to 4 attempts.\n", "Bootstrapping set 4/5\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ " 40%|██████████████████████████████████████████████████████████████████████████████████████████████ | 8/20 [00:52<01:18, 6.56s/it]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Bootstrapped 4 full traces after 8 examples for up to 1 rounds, amounting to 8 attempts.\n", "Bootstrapping set 5/5\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ " 20%|███████████████████████████████████████████████ | 4/20 [00:21<01:24, 5.29s/it]\n", "2025/01/15 17:46:23 INFO dspy.teleprompt.mipro_optimizer_v2: \n", "==> STEP 2: PROPOSE INSTRUCTION CANDIDATES <==\n", "2025/01/15 17:46:23 INFO dspy.teleprompt.mipro_optimizer_v2: We will use the few-shot examples from the previous step, a generated dataset summary, a summary of the program code, and a randomly selected prompting tip to propose instructions.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Bootstrapped 2 full traces after 4 examples for up to 1 rounds, amounting to 4 attempts.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:46:47 INFO dspy.teleprompt.mipro_optimizer_v2: \n", "Proposing instructions...\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: Proposed Instructions for Predictor 0:\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: 0: Given the fields `question`, `options`, produce the fields `reasoning`, `answer`.\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: 1: To address the task effectively, provide a detailed, step-by-step explanation for your reasoning when answering multiple-choice questions across various subjects, including biology, chemistry, physics, and social sciences. Ensure your response includes the following elements: \n", "1. A clear understanding of the question being asked.\n", "2. An evaluation of each option based on relevant knowledge and critical thinking.\n", "3. A logical deduction of the most appropriate answer.\n", "4. A concise summary of your reasoning process.\n", "5. The final answer choice selected from the provided options.\n", "\n", "When constructing your response, consider the complexity and diversity of the questions, and tailor your reasoning to demonstrate a broad range of knowledge and analytical skills. This approach will facilitate the development of a robust and reliable question-answering system capable of handling a wide spectrum of educational and general knowledge queries.\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: 2: To answer multiple-choice questions that require reasoning and analysis of the subject matter, follow these steps: \n", "\n", "1. Read the question carefully and identify the key concepts and information provided.\n", "2. Analyze the options and determine which ones are plausible based on the information provided in the question.\n", "3. Use a combination of natural language processing and knowledge retrieval to generate a step-by-step reasoning process to arrive at an answer.\n", "4. Evaluate the reasoning process and select the most appropriate answer based on the analysis.\n", "5. Provide a clear and concise explanation of the reasoning process used to arrive at the answer.\n", "\n", "Given the fields `question`, `options`, produce the fields `reasoning`, `answer` by following the above steps and using a language model to generate a step-by-step explanation of how to arrive at the answer.\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: 3: To address the given task effectively, I propose the following instruction: \n", "\n", "\"Given a multiple-choice question across various subjects, including but not limited to biology, chemistry, physics, and social sciences, and a list of possible options, generate a detailed, step-by-step reasoning process to arrive at the correct answer. Consider the context, key concepts, and any relevant theories or principles that apply to the question. Ensure the reasoning is clear, logical, and easy to follow, and conclude by selecting the correct answer from the provided options.\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: 4: You are a highly skilled expert in a high-stakes testing environment, and your task is to answer a series of challenging multiple-choice questions to determine your suitability for a prestigious position. The questions will cover a wide range of subjects, including biology, chemistry, physics, and social sciences. You must carefully read each question, analyze the options, and provide a step-by-step reasoning process to arrive at the correct answer. The correct answer and your reasoning will be evaluated by a panel of judges, and your performance will determine your eligibility for the position. Given the fields `question`, `options`, produce the fields `reasoning`, `answer` to demonstrate your expertise and critical thinking skills.\n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: \n", "\n", "2025/01/15 17:47:40 INFO dspy.teleprompt.mipro_optimizer_v2: Evaluating the default program...\n", "\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Average Metric: 5.00 / 20 (25.0%): 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.24s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:48:05 INFO dspy.evaluate.evaluate: Average Metric: 5 / 20 (25.0%)\n", "2025/01/15 17:48:05 INFO dspy.teleprompt.mipro_optimizer_v2: Default program score: 25.0\n", "\n", "2025/01/15 17:48:05 INFO dspy.teleprompt.mipro_optimizer_v2: ==> STEP 3: FINDING OPTIMAL PROMPT PARAMETERS <==\n", "2025/01/15 17:48:05 INFO dspy.teleprompt.mipro_optimizer_v2: We will evaluate the program over a series of trials with different combinations of instructions and few-shot examples to find the optimal combination using Bayesian Optimization.\n", "\n", "2025/01/15 17:48:05 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 1 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 15.00 / 20 (75.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:23<00:00, 1.19s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:48:29 INFO dspy.evaluate.evaluate: Average Metric: 15 / 20 (75.0%)\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: \u001b[92mBest full score so far!\u001b[0m Score: 75.0\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 75.0 with parameters ['Predictor 0: Instruction 1', 'Predictor 0: Few-Shot Set 1'].\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0]\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 75.0\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:48:29 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 2 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 16.00 / 20 (80.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.13s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:48:52 INFO dspy.evaluate.evaluate: Average Metric: 16 / 20 (80.0%)\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: \u001b[92mBest full score so far!\u001b[0m Score: 80.0\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 80.0 with parameters ['Predictor 0: Instruction 2', 'Predictor 0: Few-Shot Set 1'].\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0]\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:48:52 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 3 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 15.00 / 20 (75.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:22<00:00, 1.14s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:49:15 INFO dspy.evaluate.evaluate: Average Metric: 15 / 20 (75.0%)\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 75.0 with parameters ['Predictor 0: Instruction 4', 'Predictor 0: Few-Shot Set 1'].\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0, 75.0]\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 4 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 16.00 / 20 (80.0%): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:00<00:00, 1428.33it/s]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:49:15 INFO dspy.evaluate.evaluate: Average Metric: 16 / 20 (80.0%)\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 80.0 with parameters ['Predictor 0: Instruction 2', 'Predictor 0: Few-Shot Set 1'].\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0, 75.0, 80.0]\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:49:15 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 5 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 14.00 / 20 (70.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:25<00:00, 1.30s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:49:41 INFO dspy.evaluate.evaluate: Average Metric: 14 / 20 (70.0%)\n", "2025/01/15 17:49:41 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 70.0 with parameters ['Predictor 0: Instruction 4', 'Predictor 0: Few-Shot Set 3'].\n", "2025/01/15 17:49:41 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0, 75.0, 80.0, 70.0]\n", "2025/01/15 17:49:41 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:49:41 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:49:41 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 6 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 15.00 / 20 (75.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:24<00:00, 1.25s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:50:06 INFO dspy.evaluate.evaluate: Average Metric: 15 / 20 (75.0%)\n", "2025/01/15 17:50:06 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 75.0 with parameters ['Predictor 0: Instruction 0', 'Predictor 0: Few-Shot Set 1'].\n", "2025/01/15 17:50:06 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0, 75.0, 80.0, 70.0, 75.0]\n", "2025/01/15 17:50:06 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:50:06 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:50:06 INFO dspy.teleprompt.mipro_optimizer_v2: ===== Trial 7 / 7 =====\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Average Metric: 15.00 / 20 (75.0%): 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:26<00:00, 1.34s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:50:33 INFO dspy.evaluate.evaluate: Average Metric: 15 / 20 (75.0%)\n", "2025/01/15 17:50:33 INFO dspy.teleprompt.mipro_optimizer_v2: Score: 75.0 with parameters ['Predictor 0: Instruction 4', 'Predictor 0: Few-Shot Set 4'].\n", "2025/01/15 17:50:33 INFO dspy.teleprompt.mipro_optimizer_v2: Scores so far: [25.0, 75.0, 80.0, 75.0, 80.0, 70.0, 75.0, 75.0]\n", "2025/01/15 17:50:33 INFO dspy.teleprompt.mipro_optimizer_v2: Best score so far: 80.0\n", "2025/01/15 17:50:33 INFO dspy.teleprompt.mipro_optimizer_v2: =======================\n", "\n", "\n", "2025/01/15 17:50:33 INFO dspy.teleprompt.mipro_optimizer_v2: Returning best identified program with score 80.0!\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "subset_size = 20\n", "optimizer = dspy.MIPROv2(\n", " metric=benchmark.metric,\n", " auto=\"light\",\n", " num_threads=NUM_THREADS,\n", " task_model=TASK_MODEL,\n", " prompt_model=PROMPT_MODEL,\n", " max_labeled_demos=FEW_SHOTS,\n", ")\n", "\n", "optimized_program = optimizer.compile(\n", " program,\n", " trainset=trainset[:subset_size],\n", " valset=valset[:subset_size],\n", " requires_permission_to_run=False,\n", ")" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "BEST PROMPT:\n", " To answer multiple-choice questions that require reasoning and analysis of the subject matter, follow these steps: \n", "\n", "1. Read the question carefully and identify the key concepts and information provided.\n", "2. Analyze the options and determine which ones are plausible based on the information provided in the question.\n", "3. Use a combination of natural language processing and knowledge retrieval to generate a step-by-step reasoning process to arrive at an answer.\n", "4. Evaluate the reasoning process and select the most appropriate answer based on the analysis.\n", "5. Provide a clear and concise explanation of the reasoning process used to arrive at the answer.\n", "\n", "Given the fields `question`, `options`, produce the fields `reasoning`, `answer` by following the above steps and using a language model to generate a step-by-step explanation of how to arrive at the answer.\n" ] } ], "source": [ "print(\"BEST PROMPT:\\n\", optimized_program.predict.signature.instructions)" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Average Metric: 13.00 / 20 (65.0%): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:26<00:00, 1.32s/it]" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2025/01/15 17:52:03 INFO dspy.evaluate.evaluate: Average Metric: 13 / 20 (65.0%)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "data": { "text/html": [ "
\n", " | question | \n", "options | \n", "example_answer | \n", "reasoning | \n", "pred_answer | \n", "metric | \n", "
---|---|---|---|---|---|---|
0 | \n", "A certain map uses a scale of 1 inch equals 25 miles. How many mil... | \n", "[A. 50, B. 150, C. 100, D. 25, E. 5, F. 200, G. 75, H. 125, I. 175... | \n", "H | \n", "To find the number of miles represented by 5 inches on the map, we... | \n", "B | \n", "\n", " |
1 | \n", "When a ball at rest hangs by a single vertical string tension in t... | \n", "['A. may be equal to mg depending on the speed of the ball', 'B. i... | \n", "D | \n", "To solve this problem, we need to consider the forces acting on th... | \n", "D | \n", "✔️ [True] | \n", "
2 | \n", "A 125-kW, 250-V, 1800-rev/min, cumulative compound d-c generator h... | \n", "['A. 90%, 200 hp', 'B. 87.5%, 195 hp', 'C. 84.7%, 175 hp', 'D. 88.... | \n", "D | \n", "To find the efficiency and input horsepower requirements of the cu... | \n", "E | \n", "\n", " |
3 | \n", "The diameter of the objective lens of a telescope is 30 mm and the... | \n", "[A. 80%, B. 70%, C. 100%, D. 30%, E. 40%, F. 90%, G. 25%, H. 60%, ... | \n", "B | \n", "To determine the fraction of the area of the objective lens that i... | \n", "B | \n", "✔️ [True] | \n", "
4 | \n", "The temperature at the point $(x, y, z)$ in a substance with condu... | \n", "[A. $800\\pi$, B. $1504\\pi$, C. $1248\\pi$, D. $1560\\pi$, E. $960\\pi... | \n", "C | \n", "To find the rate of heat flow inward across the cylindrical surfac... | \n", "C | \n", "✔️ [True] | \n", "
5 | \n", "Which of the following must be done when universal screening data ... | \n", "['A. The school must invest in more modern educational technology.... | \n", "G | \n", "When universal screening data show that very few students are succ... | \n", "G | \n", "✔️ [True] | \n", "
6 | \n", "Sulfurylchloride decomposes according to the equation, SO_2CI_2(g)... | \n", "['A. 1.49 × 10^-2, .0386', 'B. 7.45 × 10^-3, .0542', 'C. 2.98 × 10... | \n", "A | \n", "To find the equilibrium constant K_p, we can use the equation: K_p... | \n", "A | \n", "✔️ [True] | \n", "
7 | \n", "A number’s prime factors are 2, 5, 7, 13, and 31. Which of the fol... | \n", "[A. 10, B. 25, C. 6, D. 8, E. 15, F. 30, G. 20, H. 4] | \n", "A | \n", "To find a factor that must be a factor of the number, we need to l... | \n", "A | \n", "✔️ [True] | \n", "
8 | \n", "How many ribs are there in the human body? | \n", "[A. 42, B. 24, C. 18, D. 36, E. 40, F. 28, G. 22, H. 30, I. 20, J.... | \n", "B | \n", "The human body typically has 12 pairs of ribs, which are attached ... | \n", "B | \n", "✔️ [True] | \n", "
9 | \n", "To what extent have biological agents been weaponized? | \n", "['A. Military professionals believe that the majority of biologica... | \n", "C | \n", "The question asks about the extent to which biological agents have... | \n", "A | \n", "\n", " |
10 | \n", "A swimming pool is circular with a $40-\\mathrm{ft}$ diameter. The ... | \n", "['A. $1800\\\\pi$ $\\\\mathrm{ft}^3$', 'B. $1400\\\\pi$ $\\\\mathrm{ft}^3$... | \n", "A | \n", "To find the volume of water in the pool, we first need to understa... | \n", "A | \n", "✔️ [True] | \n", "
11 | \n", "Determine the heat of vaporization ofacetonitrilewith a normal boi... | \n", "['A. 7.8 kcal mol^-1', 'B. 6.8 kcal mol^-1', 'C. 7.0 kcal mol^-1',... | \n", "E | \n", "To determine the heat of vaporization of acetonitrile, we can use ... | \n", "A | \n", "\n", " |
12 | \n", "Feinberg claims that the best way to pursue happiness is to: | \n", "['A. strive for success.', 'B. pursue knowledge.', 'C. pursue happ... | \n", "G | \n", "Feinberg's claim is related to the concept of happiness and how to... | \n", "G | \n", "✔️ [True] | \n", "
13 | \n", "Consider a profit-maximizing firm in a perfectly competitive marke... | \n", "[\"A. lead the firm to reduce workers' wages as they now contribute... | \n", "B | \n", "In a perfectly competitive market, firms are price takers, meaning... | \n", "B is incorrect because while the firm will hire more workers, the ... | \n", "\n", " |
14 | \n", "Which Confucian philosopher is described as a mystic due to his f... | \n", "[A. Zhuangzi, B. Dao, C. Xunzi, D. Laozi, E. Zisi, F. Wang Yangmin... | \n", "G | \n", "The question asks for a Confucian philosopher who is described as ... | \n", "A | \n", "\n", " |
15 | \n", "What children's TV character is known as 'Da Niao' in China? | \n", "['A. Barney', 'B. Tinky Winky', 'C. Mickey Mouse', 'D. Winnie the ... | \n", "E | \n", "The question asks for a children's TV character known as 'Da Niao'... | \n", "E | \n", "✔️ [True] | \n", "
16 | \n", "A buyer filed a lawsuit against a seller based on a written contra... | \n", "['A. admissible, because the original contract was lost.', 'B. ina... | \n", "J | \n", "The best evidence rule generally requires that the original docume... | \n", "A | \n", "\n", " |
17 | \n", "Mr. Williams owns a piece of property assessed at $7,800 in a city... | \n", "[A. $218.40, B. $220.00, C. $234.00, D. $210.00, E. $225.60, F. $2... | \n", "A | \n", "To find the amount of property taxes Mr. Williams pays, we need to... | \n", "A | \n", "✔️ [True] | \n", "
18 | \n", "An externality | \n", "['A. results in a deficit of goods in the market', 'B. results in ... | \n", "G | \n", "An externality refers to a situation where the production or consu... | \n", "G | \n", "✔️ [True] | \n", "
19 | \n", "If GNP = $2,000 billion and the velocity of money is 4, what isthe... | \n", "['A. $300 billion', 'B. $250 billion', 'C. $700 billion', 'D. $100... | \n", "J | \n", "To find the money supply, we can use the equation: M * V = GNP, wh... | \n", "J | \n", "✔️ [True] | \n", "