Abstract
Large language models (LLMs) often struggle with the multi-step stochastic reasoning required for university-level probability and statistics. This research demonstrates that OpenAI’s Codex can overcome these challenges by translating natural language problems into executable programs. By employing "Concept-Grounded Task" prompting and large-scale simulations, the authors achieved perfect results on datasets from MIT and Harvard. The study highlights the effectiveness of program synthesis as a problem-solving paradigm and identifies critical nuances like the "Logic Trap," where models may produce correct answers through flawed code.
Introduction
While foundation models excel at general reasoning, high-level quantitative problems remain a significant hurdle. Existing benchmarks often focus on grade-school mathematics, failing to capture the complexity of undergraduate curricula. University-level probability involves intricate dependencies and abstract theorems that demand more than simple textual deduction. This paper proposes a shift toward program synthesis, where models generate code to either solve problems analytically or simulate scenarios to find empirical answers.
Methodology
The researchers utilized OpenAI’s Codex, a model fine-tuned on code, to bridge the gap between problem text and numerical solutions. The approach relies on three key pillars:
- Prompt Engineering: Converting raw questions into explicit programming tasks.
- Probabilistic Simulation: Prompting the model to estimate results via large-scale simulation. This allows the model to bypass complex algebraic derivations by simulating the underlying stochastic process thousands of times.
- Concept-Grounded Task Prompting: Priming the model with relevant mathematical concepts (e.g., Bayes’ Theorem) to provide a structural framework for code generation.
Datasets and Evaluation
The study evaluated performance on two new datasets of undergraduate-level problems:
- MIT 18.05 (Introduction to Probability and Statistics): 20 questions on topics like the Central Limit Theorem and Bayesian updating.
- Harvard STAT110 (Probability): 20 conceptual questions, including Markov chains and quantitative finance brain teasers.
Success was measured by the correctness of the program's output. For simulation-based tasks, answers within 1% of the ground truth were considered correct to account for the inherent variance in stochastic simulations.
Key Insights
Simulation as a Robust Solver
Probabilistic programming provides a flexible mechanism for solving stochastic tasks. If a model can accurately describe the rules of a scenario in code, the simulation will reveal the answer, regardless of the complexity of the closed-form solution. This effectively offloads the mathematical heavy lifting from the model's reasoning engine to the execution environment.
The "Logic Trap"
A critical finding is that models can sometimes produce the correct numerical answer through flawed logic. Evaluating program synthesis requires inspecting the generated code for logical correctness, as a "correct" answer does not always imply a correct understanding of the problem's mechanics. For instance, a model might implement a simplified or incorrect version of a probability problem that coincidentally yields the expected value.
Prompt Sensitivity and Effort
The authors found that relatively minor textual adjustments were sufficient to guide the model to a correct solution. By measuring the Sentence-BERT similarity between original and transformed questions, they observed that the "effort" to transform questions was relatively low, as the transformed tasks remained highly similar (average similarity ~0.8) to the original questions while providing the necessary clarity for the model.
Results and Conclusion
The methodology yielded 100% correctness across all 40 problems in the MIT and Harvard datasets after prompt engineering. While these results are promising, the authors note that the current process requires manual human expertise for prompt engineering. Future work aims to automate this translation and scale the evaluation to larger, more diverse datasets. Additionally, hybrid approaches combining analytical and simulation-based code could optimize computational overhead, as large-scale simulations are more resource-intensive than direct analytical solutions.
Summary updated