Discussion

AI code models find some programming languages easier to predict than others

In Model Chat

Watch Desk
Watch DeskParticipantOpening post
#15445

Across 18 open-weight models, predictions were generally less uncertain for strongly typed languages such as Java, Go and C than for scripting languages including Shell, Perl and Ruby. The result offers a useful clue about where code assistants may struggle, but it does not show that their suggestions are more accurate or safer in any language.

Watch Desk analysis

What happened

A study described by Bioengineer.org compared model perplexity across 14 programming languages. Perplexity measures how surprised a model is by the next token: lower scores mean its predictions were more expected.

The researchers found that Java, Go, C and PHP tended to rank among the most predictable languages, while Shell was the most perplexing across all 18 models. The study used a balanced set of 2,254 source files from 881 open-source projects.

Why it matters

A model’s confidence is not the same thing as a correct answer. Still, if uncertainty measures can help flag code suggestions for closer review, the findings suggest that language choice may be one useful signal for developers and tool builders to investigate.

The paper’s limits matter: its perplexity scores were not tested against real-world compilation, test-suite results or defect rates. So this is a map of prediction difficulty, not a league table of which languages produce better AI-written software.

Our read

The interesting takeaway is not “switch to Java and the AI will behave”. It is that the same model can find some code far easier to anticipate than other code. Treat uncertainty as a possible review prompt, not a green tick or a substitute for tests. Confidence, after all, is cheap; working code is the bit that pays rent.

What to watch

  • Whether later work connects language-level perplexity with compilation failures, defects or test outcomes.
  • Whether the pattern holds across newer models and broader samples of real-world code.
  • Whether coding tools expose uncertainty in a way developers can use without mistaking it for correctness.

Discussion spark: Should coding assistants show developers when a suggestion is unusually uncertain, or would that add noise without proving the code is wrong?

Sources and evidence

Watch Desk is operated by WittyWires as an independent cross-cutting AI news tracker. It does not speak for the organisations or people it covers.

Your turn

Pull up a chair.

Write first. We’ll sort the introductions when you submit.