aider/website/docs/leaderboards/index.md
Paul Gauthier 559279c781 copy
2024-06-20 09:56:18 -07:00

8.9 KiB

highlight_image nav_order
/assets/leaderboard.jpg 950

Aider LLM Leaderboards

Aider works best with LLMs which are good at editing code, not just good at writing code. To evaluate an LLM's editing skill, aider uses a pair of benchmarks that assess a model's ability to consistently follow the system prompt to successfully edit code.

The leaderboards below report the results from a number of popular LLMs. While aider can connect to almost any LLM, it works best with models that score well on the benchmarks.

Claude 3.5 Sonnet takes the top spot

Claude 3.5 Sonnet is now the top ranked model on aider's code editing leaderboard. DeepSeek Coder V2 only spent 4 days in the top spot.

The new Sonnet came in 3rd on aider's refactoring leaderboard, behind GPT-4o and Opus.

Sonnet ranked #1 when using the "whole" editing format, but it also scored very well with aider's "diff" editing format. This format allows it to return code changes as diffs -- saving time and token costs, and making it practical to work with larger source files. As such, aider uses "diff" by default with this new Sonnet model.

Code editing leaderboard

Aider's code editing benchmark asks the LLM to edit python source files to complete 133 small coding exercises. This benchmark measures the LLM's coding ability, but also whether it can consistently emit code edits in the format specified in the system prompt.

{% assign edit_sorted = site.data.edit_leaderboard | sort: 'pass_rate_2' | reverse %} {% for row in edit_sorted %} {% endfor %}
Model Percent completed correctly Percent using correct edit format Command Edit format
{{ row.model }} {{ row.pass_rate_2 }}% {{ row.percent_cases_well_formed }}% {{ row.command }} {{ row.edit_format }}

Code refactoring leaderboard

Aider's refactoring benchmark asks the LLM to refactor 89 large methods from large python classes. This is a more challenging benchmark, which tests the model's ability to output long chunks of code without skipping sections or making mistakes. It was developed to provoke and measure GPT-4 Turbo's "lazy coding" habit.

The refactoring benchmark requires a large context window to work with large source files. Therefore, results are available for fewer models.

{% assign refac_sorted = site.data.refactor_leaderboard | sort: 'pass_rate_1' | reverse %} {% for row in refac_sorted %} {% endfor %}
Model Percent completed correctly Percent using correct edit format Command Edit format
{{ row.model }} {{ row.pass_rate_1 }}% {{ row.percent_cases_well_formed }}% {{ row.command }} {{ row.edit_format }}

LLM code editing skill by model release date

connecting to many LLMs

Notes on benchmarking results

The key benchmarking results are:

  • Percent completed correctly - Measures what percentage of the coding tasks that the LLM completed successfully. To complete a task, the LLM must solve the programming assignment and edit the code to implement that solution.
  • Percent using correct edit format - Measures the percent of coding tasks where the LLM complied with the edit format specified in the system prompt. If the LLM makes edit mistakes, aider will give it feedback and ask for a fixed copy of the edit. The best models can reliably conform to the edit format, without making errors.

Notes on the edit format

Aider uses different "edit formats" to collect code edits from different LLMs. The "whole" format is the easiest for an LLM to use, but it uses a lot of tokens and may limit how large a file can be edited. Models which can use one of the diff formats are much more efficient, using far fewer tokens. Models that use a diff-like format are able to edit larger files with less cost and without hitting token limits.

Aider is configured to use the best edit format for the popular OpenAI and Anthropic models and the other models recommended on the LLM page. For lesser known models aider will default to using the "whole" editing format since it is the easiest format for an LLM to use.

Contributing benchmark results

Contributions of benchmark results are welcome! See the benchmark README for information on running aider's code editing benchmarks. Submit results by opening a PR with edits to the benchmark results data files.