Get the latest tech news

Can LLMs write better code if you keep asking them to “write better code”?


Most coders want AI to write code faster: I want AI to write FASTER CODE.

For this experiment, we will give Claude 3.5 Sonnet an interview-style coding prompt using Python: one that is both simple and could be implemented by a novice software engineer, but one that can be heavily optimized. “Planning” is a long-used trick to help align LLM output for a first pass — the modern implementation of “ let’s think step by step.” Some LLMs ignore it, but Claude 3.5 Sonnet always obeys. Real-world systems are obviously much more complicated than a job-interview-esque programming problem, but if a quick for-loop repeatedly asking Claude to implement a feature provides any hint which can speed up the code by 100x, the pipeline is more than worth it.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of LLMs

LLMs

Photo of better code

better code

Related news:

News photo

Alibaba Slashes Prices On LLMs By Up To 85% As China AI Rivalry Heats Up

News photo

Things we learned about LLMs in 2024

News photo

Performance of LLMs on Advent of Code 2024