ES is a population-based, gradient-free method that optimises directly in weight space through random
perturbations. Unlike RL, which sharpens the output distribution around its single best guess, ES raises
pass@1
while preserving solution coverage — so the model keeps benefiting from additional test-time
samples. See the
paper repository.
Following Yue et al. (2025), all benchmarks are sampled at:
1python -m es_pass_k.math_pass_k \
2 --model-path conorfhayes/Qwen2.5-14B-ES-MATH \
3 --eval-dataset datasets/evaluation_suite/math/math500 \
4 --k 256 --temp 0.6 --top-p 0.95 --max-tokens 16384 \
5 --template math \
6 --use-gpus 0
The model expects the Qwen2.5-Math prompt format, with the reasoning instruction in the system turn.
Using a different template is out-of-distribution and will depress accuracy:
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained("conorfhayes/Qwen2.5-14B-ES-MATH", torch_dtype="bfloat16", device_map="auto")
4tok = AutoTokenizer.from_pretrained("conorfhayes/Qwen2.5-14B-ES-MATH")
5
6question = "What is the smallest positive integer n such that n! is divisible by 1000?"
7prompt = (
8 "<|im_start|>system\nPlease reason step by step, and put your final answer "
9 "within \\boxed{}.<|im_end|>\n<|im_start|>user\n"
10 + question
11 + "<|im_end|>\n<|im_start|>assistant\n"
12)
13
14out = model.generate(**tok(prompt, return_tensors="pt").to(model.device),
15 max_new_tokens=2048, temperature=0.6, top_p=0.95, do_sample=True)
16print(tok.decode(out[0], skip_special_tokens=True))
1@article{hayes2026beyond,
2 title = {Beyond the Best Guess: Improving LLM Solution Coverage with Evolution Strategies},
3 author = {Hayes, Conor F. and Meyerson, Elliot and Schweighofer, Kajetan and
4 Dailey, Roberto and Hodjat, Babak and Miikkulainen, Risto and Qiu, Xin},
5 year = {2026}
6}