# LLaMA-Berry: Pairwise Optimization for O1-like Olympiad-Level Mathematical Reasoning

- **ID:** 577
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2410.02884
- **Authors:** Di Zhang, Jianbo Wu, Jingdi Lei, Tong Che, Jiatong Li, Tong Xie, Xiaoshui Huang, Shufei Zhang, Marco Pavone, Yuqiang Li, Wanli Ouyang, Dongzhan Zhou
- **Venue:** arXiv / Fudan University / Shanghai AI Laboratory / Stanford
- **Published:** 2024
- **License:** CC BY 4.0
- **License family:** Permissive (auto-classified)
- **Tags:** llama-berry, mcts, self-refine, pprm, ebc, aime, olympiad-math, naacl, shanghai-ai-lab
- **Topics:** mathematical reasoning, MCTS, reward models
- **Added:** 2026-10-01
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/577

## Summary

SR-MCTS treats a full solution as a state and Self-Refine (critique+rewrite) as the action; PPRM (Gemma2-2B DPO on 7.78M PRM800K/OpenMathInstruct pairs) predicts pairwise prefs; Enhanced Borda Count plus Floyd-Warshall lifts them to global quantiles. Untrained LLaMA-3.1-8B-Instruct at 16 rollouts: GSM8K 96.1 rm, MATH 75.3, AIME24 8/30 (26.7) vs 2/30 greedy, AMC23 54.2, GPQA-Diamond 92.4. Beats ToT/rStar at fewer rollouts. NAACL 2025. No official code on abs.

## Attributes

- **Purpose:** Search Olympiad-level math solutions with Self-Refine MCTS and pairwise rewards
- **Scale:** LLaMA-3.1-8B-Instruct (no extra train) + Gemma2-2B PPRM; rollouts 8/16. GSM8K/MATH/GaoKao2023En/OlympiadBench/College Math/MMLU-STEM plus AIME24/AMC23/Math Odyssey/GPQA-Diamond. Berry-Tree eval used 16+4 A100s on GSM8K (~3.87s/sample @16).
- **Time period:** 2024-10-03 (arXiv 2410.02884 v1); last revised 2024-11-21 (v2). NAACL 2025 (ACL anthology 2025.naacl-long.375). HF paper publishedAt 2024-10-03.

## From the source (fetched 2026-10-03)

- **Published:** Oct 3, 2024 (arXiv)
- **Last revised:** Nov 21, 2024 (arXiv)
- **arXiv categories:** cs.AI, cs.CL (arXiv)
- **Citations:** 100 (3 influential) (Semantic Scholar)
- **References:** 67 (Semantic Scholar)

## Abstract

This paper presents an advanced mathematical problem-solving framework, LLaMA-Berry, for enhancing the mathematical reasoning ability of Large Language Models (LLMs). The framework combines Monte Carlo Tree Search (MCTS) with iterative Self-Refine to optimize the reasoning path and utilizes a pairwise reward model to evaluate different paths globally. By leveraging the self-critic and rewriting capabilities of LLMs, Self-Refine applied to MCTS (SR-MCTS) overcomes the inefficiencies and limitations of conventional step-wise and greedy search algorithms by fostering a more efficient exploration of solution spaces. Pairwise Preference Reward Model~(PPRM), inspired by Reinforcement Learning from Human Feedback (RLHF), is then used to model pairwise preferences between solutions, utilizing an Enhanced Borda Count (EBC) method to synthesize these preferences into a global ranking score to find better answers. This approach addresses the challenges of scoring variability and non-independent distributions in mathematical reasoning tasks. The framework has been tested on general and advanced benchmarks, showing superior performance in terms of search efficiency and problem-solving capability compared to existing methods like ToT and rStar, particularly in complex Olympiad-level benchmarks, including GPQA, AIME24 and AMC23.

## Research notes

- Primary: arxiv abs (cs.AI; also cs.CL). License CC BY 4.0 on HTML at check. Equal contrib Zhang/Wu/Lei; corresponding Yuqiang Li and Dongzhan Zhou (zhoudongzhan/liyuqiang @pjlab.org.cn). Fudan / Shanghai AI Lab / UC Merced / HK PolyU / UNSW / SJTU / Stanford (Pavone). No official code URL on abs. Related later repo SimpleBerry/LLaMA-O1 not treated as abs-linked. HF paper page 53 upvotes; unofficial/follow-up linked models (SimpleBerry/LLaMA-O1-Supervised-1129, di-zhang-fdu/PPRM-gemma-2-2b-it, etc.) not copied into hf_* fields. Linked HF sets (pprm_math_preference, OpenLongCoT-*, AIME_1983_2024) are preference/CoT derivatives of public MATH/GSM8K/AIME, not a new hosted pretraining corpus, so no datasets_local row. Discord posted abs.

## Cites, within this collection

- [Improve Mathematical Reasoning in Language Models by Automated Process Supervision](https://papers.projxon.ai/entries/909) (paper 2024, #909)
- [Large Language Monkeys: Scaling Inference Compute with Repeated Sampling](https://papers.projxon.ai/entries/951) (paper 2024, #951)

## Similar entries

- [Mixture of Self-Improving Branches For Agent Harness Optimization](https://papers.projxon.ai/entries/1193) (paper, #1193)
- [Planned Test-Time Scaling with Coordinated Reasoning Paths](https://papers.projxon.ai/entries/1043) (paper, #1043)
- [Logic-of-Thought: Injecting Logic into Contexts for Full Reasoning in Large Language Models](https://papers.projxon.ai/entries/880) (paper, #880)
- [Understanding and Mitigating Premature Confidence for Better LLM Reasoning](https://papers.projxon.ai/entries/501) (paper, #501)
- [Ring-Zero: Scaling Zero RL to a Trillion Parameters for Emergent Reasoning](https://papers.projxon.ai/entries/477) (paper, #477)
- [Adaptive Reward Routing: Dynamic Multi-Reward Optimization for Joint Audio-Video Diffusion via Forward-Process RL](https://papers.projxon.ai/entries/1199) (paper, #1199)
