All ideasMore in Work

He had LLMs rewrite his Python science code in Rust and it now answers instantly

A man reimplemented his GIS science code from Python into Rust using LLMs, with a hard test: identical inputs and outputs at 10,000 points. Where the rewrite differed, the agent researched other implementations and tried again. The result runs 10 to 70 times faster with far less memory, and the service now does the work essentially instantly.

How it works

  1. He sets the done rule: identical input and output pairs at 10,000 points
  2. The LLM rewrites the code in Rust
  3. Mismatches send the agent back to research other implementations and retry
  4. The new service runs 10 to 70 times faster with much lower memory

Why it’s worth knowing

The rewrite was held to a strict rule, same answers at 10,000 test points, and still came out up to 70 times faster.

Where it’s from

Summarized from a public post on news.ycombinator.com. See the original ↗

Upgraded prompt

A ready-to-use prompt for this idea, built from research on what makes AI agents do the job right: who the AI should be, the exact steps, and a check to make sure it was done the way you wanted.

1Who the AI should be
2The prompt, with the steps
3The check when it’s done
Upgraded prompts are coming soon.

Try next

Every idea is a real post from someone who tried it, summarized in our words, with a link to the original. App names are swapped for plain words.