How AlphaCode 2 takes on unfamiliar programming challenges
Neutral Software development By What The Future Newsroom · December 6, 2023 · 2 min read

How AlphaCode 2 takes on unfamiliar programming challenges

Google says AlphaCode 2, built on a coding-tuned version of Gemini Pro, outperformed an estimated 85% of competitors on average across a subset of Codeforces contests. It generates and filters many candidate solutions, but the system still relies on trial and error and is costly to operate at scale.

Google’s AlphaCode 2 is designed to do more than translate a prompt into code. The system breaks down unfamiliar programming challenges, generates possible solutions and selects candidates it considers promising. Google says it performed substantially better than the original AlphaCode in a subset of programming contests, while also acknowledging practical limits to how it works.

“This is a technical capability update with contest results and practical limits, but no clear lean toward harm or human deskilling.”Why it scores Neutral

Stronger results in a contest subset

AlphaCode 2 is powered by Gemini Pro fine-tuned on coding contest data. In selected Codeforces competitions, it used Python, Java, C++ and Go, and performed better than an estimated 85% of competitors on average, according to Google. The original AlphaCode bested roughly 50% of competitors on the same subset.

The technical whitepaper describes 12 recent contests, each with more than 8,000 participants, drawn from division 2 or the harder division “1+2.” Across 77 problems, AlphaCode 2 solved 43% within 10 attempts. The original system solved 25% in that setting.

These figures describe performance on a particular group of contests and problems. They show progress against the earlier system in that evaluation, while leaving open how well AlphaCode 2 would perform in other programming contexts.

Reasoning before implementation

The challenges can involve complex mathematics and theoretical computer science. DeepMind research scientist Rémi Leblond says AlphaCode 2 can use dynamic programming, a technique that repeatedly divides a difficult problem into simpler sub-problems.

The system’s ability to decide both when that method fits and where to apply it matters because dynamic programming was a major weakness for the original AlphaCode. More broadly, the description suggests that solving a challenge involves choosing an approach and designing a solution before writing its implementation.

Leblond said the system handles problems it has never encountered before. That claim describes the intended capability: using learned patterns to work through new contest questions, rather than relying only on having seen the exact problem already.

How AlphaCode 2 chooses an answer

AlphaCode 2 does not produce just one solution and stop. It uses a family of “policy models” to generate multiple code samples for each challenge. It then removes samples that do not fit the problem description.

Next, a clustering algorithm groups samples that are semantically similar, which helps avoid counting redundant approaches as separate options. A scoring model ranks candidates from the 10 largest clusters, and the system surfaces its best candidate as its answer.

This multi-stage process gives AlphaCode 2 several chances to find a workable approach. It also shows why the result depends on more than code generation alone: filtering, grouping and scoring all help determine which candidate is returned.

Capabilities come with operating costs

The whitepaper also describes significant limitations. AlphaCode 2 requires extensive trial and error, is too costly to operate at scale and depends heavily on filtering out obviously bad code samples. The paper speculates that migrating to a more capable Gemini version, such as Gemini Ultra, might mitigate some of these issues.

Whether AlphaCode 2 will become a product remains uncertain. The original AlphaCode was never released. In a briefing, DeepMind VP of product Eli Collins pointed to the potential for programmers to improve performance by defining properties that code should follow.

Collins described a future in which capable AI models act as collaborative tools across software development, from reasoning about problems to assisting with implementation. For now, AlphaCode 2’s contest results offer evidence of progress, while its cost and reliance on many candidate attempts remain challenges for broader use.

← Back to the wire

Read next