← Latest papers
🤖 AI

Algorithmic algorithm development with LLMs: A Case Study on LLM-Usage for Contraction Order Optimization in Tensor Networks

This paper presents a case study using OpenEvolve to demonstrate how verifier-guided LLM agents can effectively develop and improve algorithms for tensor network contraction order optimization, while emphasizing the critical role of human scientists in evaluation, validation, and interpretation.

Original authors: Fabian Hoppe, Melven Röhrig-Zöllner, Philipp Knechtges

Published 2026-06-02
📖 5 min read🧠 Deep dive

Original authors: Fabian Hoppe, Melven Röhrig-Zöllner, Philipp Knechtges

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to solve a massive, complex puzzle. In the world of physics and computing, this puzzle is called a Tensor Network. To solve it, you have to combine many smaller pieces (tensors) together in a specific order.

Here's the catch: The order in which you snap these pieces together matters immensely.

  • If you snap them in the wrong order, the puzzle might temporarily grow to the size of a skyscraper before shrinking back down. This requires a huge amount of computer memory and time (FLOPs, or "math steps").
  • If you snap them in the right order, the puzzle stays small and manageable, solving itself quickly.

Finding the perfect order is like trying to find the shortest path through a maze that changes shape every time you look at it. It's so hard that even supercomputers struggle with it for big puzzles.

The Experiment: Teaching an AI to be a Puzzle Master

The authors of this paper wanted to see if a Large Language Model (LLM)—a type of AI that is very good at writing code and solving logic problems—could learn to find these better puzzle orders on its own. They didn't just ask the AI for an answer; they set up a game of evolution.

Think of it like a cooking competition:

  1. The Contestants: The AI generates many different "recipes" (algorithms) for snapping the puzzle pieces together.
  2. The Judges: A computer program acts as the judge. It doesn't actually cook the meal (run the full physics simulation); it just calculates how many ingredients (math steps) each recipe would use.
  3. The Evolution: The AI looks at the recipes that used the fewest ingredients, mixes them together, and tries to make a new, even better recipe. It repeats this thousands of times, slowly "evolving" a master chef.

What They Tested (The "Knobs" the Human Turned)

The researchers realized that the AI isn't a magic wand; it's a tool that needs very specific instructions. They tested three main things to see what made the AI succeed or fail:

1. Which AI Chef did they hire? (The Model Choice)
They tried different versions of AI models, from small ones to massive ones.

  • The Result: Surprisingly, a medium-sized AI model (GPT-OSS-20B) actually performed better than the giant, expensive ones. It was like finding a local baker who made better bread than a famous international chain. The biggest models sometimes got confused or took too long to think.

2. How did they measure "Good"? (The Metric)
The AI needs a score to know if it's winning. The researchers tried different ways to score the recipes:

  • Average Score: "How good is the recipe on average?"
  • Worst-Case Score: "What is the worst recipe this AI could make?"
  • The Result: It turned out that telling the AI to optimize for the "average" worked best. If they told it to optimize for the "worst case," the AI would get confused and make bad recipes for everyone else. The way you define "winning" changes who wins.

3. What kind of puzzles did they practice on? (The Test Data)
They let the AI practice on small puzzles, medium puzzles, and large puzzles.

  • The Result: If the AI practiced only on small puzzles, it became a master at solving small puzzles and surprisingly good at medium ones. But if it practiced on medium puzzles, it actually got worse at solving the small ones. It's like a gymnast who trains only on the balance beam and then fails at the floor exercise. The specific practice data you choose dictates what the AI learns.

The "Best" Result: A Surprise Discovery

After running the experiment, the AI (specifically the medium-sized one) found a new way to order the puzzle pieces.

  • The Good News: It found a method that used significantly fewer math steps than the standard human-made methods for medium-sized puzzles. It was about 47 times faster in terms of calculation steps!
  • The Catch: The AI's code was a bit of a "black box." It was long, complex, and didn't have many comments explaining why it worked. When the humans looked at it, they realized the AI had rediscovered a known mathematical trick but added a weird, new twist to it that no one had written down before.
  • The Warning: While the AI's recipe was mathematically efficient, the process of figuring out the recipe took a long time. For very large puzzles, the AI's method was too slow to even be useful in real life.

The Big Takeaway

The paper concludes that while AI is a powerful tool for inventing new algorithms, humans are still the captains of the ship.

  • You can't just say "Go." You have to carefully design the rules of the game (the test data, the scoring system, and the timeout limits). If you design the game poorly, the AI will find a "cheat code" that wins the game but doesn't solve the actual problem.
  • Verification is key. Just because the AI says it found a faster way doesn't mean it's ready for the real world. Humans still need to check if the code makes sense, if it's readable, and if it actually works under real-world conditions (like running out of time).
  • The "Instrument" Metaphor: The authors suggest we shouldn't view these AI systems as "magic oracles" that give us answers. Instead, we should view them as complex scientific instruments. Just like a telescope needs a skilled astronomer to point it and interpret the stars, an AI algorithm needs a skilled scientist to point it at the right problem and interpret the results.

In short: The AI is a brilliant, fast, but sometimes confused apprentice. The human scientist is the master chef who must choose the ingredients, set the menu, and taste the final dish to ensure it's actually edible.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →