Code LLM evaluation with engineers: tests, review and real issues

For companies4 min read

Two software engineers at a shared desk in a Kigali co-working space, one reading a diff on a monitor while the other writes notes in a paper notebook, morning light.

Code LLM evaluation has moved from short function puzzles to real repository issues, and each step needs different human work. Tests can say whether code runs. Only engineers can say whether it is the right change. Here is how to set up evaluation at three levels and where experts fit in.

Code LLM evaluation, level one: functions that tests can check

The first public standard was HumanEval, released with the Codex paper. It measures whether a model can write a program from a docstring, judged by functional correctness: does the code pass the tests. In that paper, Codex solved 28.8% of problems, GPT-3 solved none, and GPT-J solved 11.4%. With 100 samples per problem, Codex reached 70.2%.

Source: Evaluating Large Language Models Trained on Code (arXiv:2107.03374)(opens in a new tab)

The last number carries a lesson. A model that can sometimes produce a correct answer is different from one that does it on the first try. Decide which your product needs. An autocomplete tool can offer several candidates, while an autonomous agent that commits code needs the first answer to be right. Ask your engineers to define the unit of success before any run: one attempt, three attempts, or any of ten. Write it in the evaluation plan, because the same model can look weak or strong depending on that choice, and a buyer reading your report will want to know which one you used. Also record how many times each model was run and with what settings, so someone else can repeat the result.

Level two: changes in a real repository

SWE-bench shifted the question. It collected 2,294 problems from real GitHub issues and the pull requests that fixed them, across 12 popular Python repositories. The model gets a codebase and an issue description and must edit the code to resolve it, which often means coordinating changes across several functions, classes and files. In the original paper the best model, Claude 2, resolved 1.96% of issues.

Source: SWE-bench: Can Language Models Resolve Real-World GitHub Issues? (arXiv:2310.06770)(opens in a new tab)

Models have moved on since that paper, so read the figure as a snapshot of difficulty at the time. The design is the useful part: use real tasks from real projects, and check with the project's own tests.

If you want this for your own stack, you can build a private version. Take closed issues from your repositories, snapshot the code before the fix, and keep the tests that failed before and pass after. Ask an engineer to confirm that each task is solvable from the issue text alone, because vague issues produce unfair failures.

Level three: judgement that tests miss

Passing tests is not the same as a good change. The code may duplicate logic, ignore the project's conventions, add a dependency or handle errors badly. Engineers must read the diff. A dataset like the one behind CodeReviewer, built from real code changes and review comments in open-source projects across nine programming languages, shows what reviewers actually comment on, and can seed your own review checklist.

Source: Automating Code Review Activities by Large-Scale Pre-training (arXiv:2203.09095)(opens in a new tab)

Ask your reviewers to score a sample of passing solutions on separate lines.

  • Correctness beyond the tests: edge cases, error handling, concurrency.
  • Fit with the codebase: naming, structure, existing helpers reused.
  • Scope: the change fixes the issue without unrelated edits.
  • Security: input handling, secrets, unsafe calls.
  • Readability: another engineer could maintain it.

Match the engineer to the language and task

Code evaluation fails quietly when reviewers are generalists. A Rust reviewer sees ownership mistakes that a Python reviewer would call fine. A mobile engineer knows lifecycle rules that a backend engineer may not. Match reviewers to the language and framework, and record the match.

Evaluation typeEngineer neededOutput
Function generationStrong in the languagePass or fail, plus notes on style
Repository issueMaintainer-level in that stackTask validity and diff quality
Code review commentsSenior reviewerIs the comment correct and useful?
Test writingQA or backend engineerDo tests catch real defects?
Debugging tracesEngineer on that systemIs the diagnosis right?

Steps for a first evaluation round

  1. Pick 50 to 100 tasks from your own work, spread across languages and difficulty.
  2. Write or collect tests, and have an engineer check that each task is fair.
  3. Run each model several times, and record both first-try and best-of-several results.
  4. Sample passing outputs for engineer review using the lines above.
  5. Keep a private set that is never published or used for prompt tuning.
  6. Re-run after every model or prompt change and compare by category.

Watch for tests that can be gamed

Weak tests let wrong code pass. Ask engineers to try breaking the test suite: delete the fix and see whether tests still pass, or write an obviously wrong solution and check it fails. If a poor solution passes, the task needs stronger tests before it counts.

Curatrain vets engineers with graded skill tests, and companies receive a shortlist of experts who already passed the tests their project needs. You approve each match through a secure link, and an NDA and a data processing agreement are part of company sign-up.