Can LLMs Solve Science or Just Write Code? Evaluating Quantum Solver Generation
This paper introduces Q-SAGE, an iterative evaluation methodology demonstrating that while Large Language Models can generate quantum solvers with improved success rates through refinement, they still struggle with numerical accuracy and incur significant computational overhead, revealing current limitations in fully automating scientific quantum software development.
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 have a very talented, hyper-fast robot assistant that is amazing at writing computer code. You ask it to build a complex machine to solve a difficult physics puzzle. The robot types out the code, and the machine starts running. It doesn't crash! It doesn't throw an error message! It seems to work perfectly.
But here's the catch: The machine is running, but it's giving you the wrong answer.
This is the core problem researchers at Politecnico di Milano and the University of Luxembourg tackled in their paper, "Can LLMs Solve Science or Just Write Code?" They wanted to know if Large Language Models (LLMs)—the AI brains behind tools like ChatGPT—can actually write code that solves real scientific problems correctly, or if they just write code that looks right but fails the math test.
The "Q-SAGE" Workshop
To find out, the researchers built a testing framework called Q-SAGE. Think of Q-SAGE as a strict, iterative workshop for AI code:
- The Assignment: The AI is given a scientific problem (like figuring out how electrons behave in a tiny magnet or how molecules bond).
- The Draft: The AI writes a Python script to solve it.
- The Test Run: The script is executed on a computer.
- The Reality Check: The result is compared against a "Golden Standard"—a trusted, old-school classical computer program that we know gives the correct answer.
- The Feedback Loop: If the AI's answer is wrong (or the code crashes), the workshop doesn't just say "Fail." It tells the AI why it failed (e.g., "You got a math error" or "The code crashed"). The AI then rewrites the code and tries again.
They ran this workshop with five different types of scientific problems (ranging from quantum physics to chemistry) and five different AI models (some open-source, some from big tech companies).
What They Discovered
1. The "First Draft" Problem
When the AI was asked to write the code just once (no feedback), it often failed. It was like asking a student to take a final exam without any study or practice. Many scripts crashed immediately, or they used the wrong tools (like using a hammer to screw in a lightbulb).
2. The Magic of "Try, Fail, Fix"
When the researchers let the AI iterate—letting it see its mistakes and try again—the success rate jumped dramatically.
- Analogy: Imagine a chef trying to bake a cake. The first time, they forget the eggs. The judge says, "No eggs." The chef tries again, adds eggs, but burns the cake. The judge says, "Lower the heat." By the third or fourth try, the chef finally bakes a perfect cake.
- The Result: For simpler problems, the AI got very good at fixing its own mistakes within about 5 tries.
3. The "Silent Killer": Wrong Math
Here is the most important finding: As the AI models got smarter, the type of mistakes changed.
- Dumb AI: Made "syntax" errors. The code wouldn't even run. It was like a car that wouldn't start because the keys were in the wrong ignition.
- Smart AI: The code ran perfectly! But the numbers were wrong. It was like a car that drove smoothly but took a wrong turn because the GPS was slightly off.
- The Lesson: Even the best AI models struggle with numerical accuracy. They can write code that looks like a quantum physics solution, but the math inside is slightly off, leading to scientifically useless results.
4. The Cost of Perfection
Getting the AI to fix its mistakes takes time.
- Analogy: If you ask a human to write a report, it takes an hour. If you ask them to write it, get feedback, rewrite it, get feedback again, and rewrite it five times, it might take five hours.
- The Result: The researchers found that while iterative feedback worked, it came with a huge "time tax." Getting a correct answer often took much longer than just running the code once. For very complex problems, the AI sometimes got stuck in a loop of trying and failing, burning up a lot of computer time.
The Bottom Line
The paper concludes that while AI is getting better at writing code, it is not yet a reliable scientist.
- Can it write code? Yes, especially if you let it fix its mistakes.
- Can it solve science? Not reliably on its own. It often produces code that runs but gives the wrong numbers.
The researchers suggest that for now, AI is a great "draftsman" that can get you 80% of the way there, but a human expert (or a very strict verification system) is still needed to check the final math. You can't just trust the AI to do the science; you have to verify the results, because a running program doesn't always mean a correct answer.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.