Better Together, in the Right Order: Classical-then-LLM Optimization for SE
The paper introduces SNAP2, a novel approach that outperforms both standalone large language models and classical-optimizer-led hybrid methods in software engineering configuration tasks by first using a cheap classical learner to seed an LLM, thereby achieving superior results with reduced cost and faster execution.
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 find the single best recipe for a cake out of a cookbook containing 100,000 pages. You have two tools to help you:
- The Fast Scout (Classical Optimizer): A robot that can flip through pages incredibly fast, taste a few, and quickly narrow down the search to the "good" section of the book. It's cheap, fast, and doesn't need to think deeply, but it might miss the perfect cake because it's just looking for "good enough."
- The Master Chef (Large Language Model): A brilliant human chef who can taste a recipe and imagine exactly how to tweak it to make it perfect. However, this chef is slow, expensive to hire, and gets tired if you ask them to taste every single page in the book.
The Old Way: Asking the Chef First
For a long time, researchers tried to solve this by asking the Master Chef to start the process. They'd say, "Here is the book, guess the first few recipes, and then we'll use the robot to finish the job."
The paper argues this is inefficient. The chef spends a lot of time and money (tokens) guessing blindly at the start, only to have the robot take over later. It's like hiring a world-famous chef to walk into a dark room and guess where the light switch is, before handing the job to a janitor to find the rest.
The New Way: SNAP2 (The Scout First, Then the Chef)
The authors discovered a much better order: Let the Fast Scout do the heavy lifting first, then hand the results to the Master Chef to finish.
They call this method SNAP2. Here is how it works in their experiment:
- The Scout (EZR): First, they let the cheap, fast robot scan the first 10 pages. It quickly identifies the "best" section of the cookbook and throws away the terrible recipes.
- The Chef (SNAP): Then, they give those 10 "good" recipes to the Master Chef. The chef says, "Ah, I see the pattern now. Based on these good starts, I can imagine the perfect recipe."
The Results: Why the Order Matters
The paper tested this on 105 different real-world software problems (like tuning computer settings to make them faster or cheaper).
- The Chef Alone: If you just ask the Master Chef to do the whole job, they get the top result about 75% of the time.
- The Scout Alone: If you just use the robot, it gets the top result about 71% of the time.
- The Old Combo (Chef first, then Robot): This only got about 70-74% success.
- The New Combo (SNAP2): By letting the robot scout first and the chef finish, they hit the top result 85% of the time.
The Analogy: It's like playing a video game.
- Old Way: You ask a genius strategist to guess the first move, then you play the rest.
- SNAP2 Way: You play the first few levels yourself to get a feel for the controls (the cheap robot work), then you ask the genius strategist to give you the winning strategy for the final boss. The strategist performs much better because they aren't starting from zero; they are building on a solid foundation.
The Bonus: It's Also Cheaper
Because the robot does the "boring" early work, the Master Chef doesn't have to read as many pages or think as hard.
- SNAP2 uses 30% fewer "tokens" (the currency used to pay the AI) than using the Chef alone.
- It runs 1.4 times faster.
The Bottom Line for Practitioners
The authors conclude that you shouldn't choose between a robot or a human; you should use both, but in the right order.
- Start with the cheap, fast method. It's nearly free and gives you a great head start.
- Only then, bring in the expensive AI. Use the AI to polish the results the robot found.
If you need the absolute best result for a critical system, use SNAP2. If you are on a tight budget or need an answer instantly, just use the robot (EZR), because it's surprisingly good and runs thousands of times faster. But never let the AI start from scratch if you can help it.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.