---
title: "Beat GPT-4o at Python by searching with 100 dumb LLaMAs"
description: "Sampling LLaMA 3.1 8B Instruct many times and checking each candidate against HumanEval's unit tests raises pass@k from 66.4% at k=1 to 90.5% at k=100, matching GPT-4o's reported 90.2% pass@1, and to 95.1% at k=1000."
url: "https://swe.quest/articles/beat-gpt-4o-at-python-by-searching-with-100-dumb-llamas-907f6997678a8d61"
canonical: "https://modal.com/blog/llama-human-eval"
source: "Modal"
published: "2024-08-05"
difficulty: "medium"
kind: "Research"
reading_minutes: 7
tags: ["llms","inference","evals","ai-coding","serverless"]
---

# Beat GPT-4o at Python by searching with 100 dumb LLaMAs

A post on [Modal](https://swe.quest/sources/modal.md), published 2024-08-05, 7 min read, Research. Original: [https://modal.com/blog/llama-human-eval](https://modal.com/blog/llama-human-eval)

## Summary

Sampling LLaMA 3.1 8B Instruct many times and checking each candidate against HumanEval's unit tests raises pass@k from 66.4% at k=1 to 90.5% at k=100, matching GPT-4o's reported 90.2% pass@1, and to 95.1% at k=1000. This replicates the core claim of the Large Language Monkeys paper on a new model and dataset, with fail@k following a smooth log-log scaling law across three orders of magnitude. The setup used vLLM with prefix caching on ten A100s, reaching about 40k output tokens/s, plus Modal Sandboxes running about 3,000 isolated test executions in parallel, all for under $50. The larger argument is that search trades memory for compute and depends on fast, objective evaluation, so domains with verifiable outcomes like code and formal math benefit most.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Serverless](https://swe.quest/tags/serverless.md) (Backend & APIs)

## Prerequisites

- LLM sampling and inference ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- pass@k metric

## Keywords

LLaMA 3.1 8B, HumanEval, Large Language Monkeys, vLLM, Modal Sandboxes, GPT-4o

## Related posts

- [BigCodeBench: The Next Generation of HumanEval](https://swe.quest/articles/bigcodebench-the-next-generation-of-humaneval-19fbda5688a2d115.md): Hugging Face · 2024-06-18 · Medium · 10 min read · Evaluation, AI for coding, LLMs, Python
  BigCodeBench is a code-generation benchmark of 1,140 Python function-level tasks that require composing calls from 139 libraries.
- [Code Llama: Llama 2 learns to code](https://swe.quest/articles/code-llama-llama-2-learns-to-code-bbc6e9367fb26138.md): Hugging Face · 2023-08-25 · Medium · 12 min read · LLMs, AI for coding, Inference & serving, Python, Evaluation
  Code Llama is a family of 7B, 13B and 34B Llama 2 derivatives trained on 500B tokens of code.
- [Introducing the LiveCodeBench Leaderboard - Holistic and Contamination-Free Evaluation of Code LLMs](https://swe.quest/articles/introducing-the-livecodebench-leaderboard-holistic-and-contamination-free-cd05ed71356a1cca.md): Hugging Face · 2024-04-16 · Easy · 4 min read · Evaluation, LLMs, AI for coding
  LiveCodeBench is a code-LLM benchmark built from LeetCode, AtCoder and CodeForces contest problems annotated with release dates, so models can be scored only on problems published after their training cutoff to avoid contamination.
- [StarCoder: A State-of-the-Art LLM for Code](https://swe.quest/articles/starcoder-a-state-of-the-art-llm-for-code-ae224d2374e67db4.md): Hugging Face · 2023-05-04 · Easy · 5 min read · LLMs, AI for coding, Evaluation, Open source
  StarCoder and StarCoderBase are ~15B-parameter code LLMs trained on 1 trillion tokens of permissively licensed GitHub data from The Stack 1.2, covering 80+ languages, commits, issues and notebooks, with StarCoder further fine-tuned on 35B Python tokens.
- [Code Llama: Meta’s state-of-the-art LLM for coding](https://swe.quest/articles/code-llama-meta-s-state-of-the-art-llm-for-coding-c2f826fd04e42ba1.md): Meta Engineering · 2023-08-24 · Easy · 7 min read · LLMs, AI for coding, Model training
  Code Llama is a code-specialized family of Llama 2 models, built by further training Llama 2 on 500B tokens of code (1T for the 70B model).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
