Writing Rust code that's faster than state-of-the-art libraries by asking agents to make the code faster
- In January 2025, I had a fun hypothesis for a blog post: can LLMs write better code if you keep asking them to “write better code”?
- That was prior to the advent of robust agentic coding, but Claude Sonnet 3.5 was still able to iteratively improve on algorithmic Python code.
- The “better” instruction turned out to be underspecified: Sonnet abused that ambiguity to instead add a ton of useless features but the code was indeed faster.
Unverified
- In January 2025, I had a fun hypothesis for a blog post: can LLMs write better code if you keep asking them to “write better code”?
- That was prior to the advent of robust agentic coding, but Claude Sonnet 3.5 was still able to iteratively improve on algorithmic Python code.
- The “better” instruction turned out to be underspecified: Sonnet abused that ambiguity to instead add a ton of useless features but the code was indeed faster.
Sources: Minimaxir