← Latest papers
🤖 machine learning

When Independent Sampling Outperforms Agentic Reasoning

This paper demonstrates that for competitive programming tasks, allocating inference-time compute to repeated independent sampling (k-shot) consistently yields better accuracy-cost and accuracy-query tradeoffs than agent-based reasoning, even when accounting for prompt caching.

Original authors: Yihe Dong, Boris Shigida

Published 2026-05-12
📖 4 min read☕ Coffee break read

Original authors: Yihe Dong, Boris Shigida

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 limited amount of money to spend on finding a hidden treasure in a maze. You have two main strategies to choose from:

  1. The "Deep Thinker" (Agentic Reasoning): You hire one very smart, persistent detective. This detective enters the maze, tries a path, hits a wall, gets frustrated, tries to debug their map, talks to themselves, and slowly refines their approach. They might solve the puzzle, but they spend a lot of time (and money) talking, thinking, and backtracking.
  2. The "Swarm of Darts" (Independent Sampling): Instead of one detective, you hire a hundred different people. You give each of them a small amount of money and tell them, "Go in, guess the path, and if you get stuck, stop." You don't let them talk to each other or fix their mistakes. You just throw a huge number of independent guesses at the problem.

The Paper's Big Discovery:
The researchers at Princeton University tested these two strategies on competitive programming problems (like the math and logic puzzles found on Codeforces). They found that Strategy 2 (The Swarm of Darts) almost always wins.

Even when they gave the "Deep Thinker" a lot of money to think deeply, the "Swarm" solved more problems for less money.

Why does the "Deep Thinker" fail here?

The paper explains that competitive programming problems are like self-contained riddles. They have a specific, correct answer, and the rules are clear.

  • The Detective's Trap: The "Deep Thinker" (the agent) often gets stuck in a loop. It tries a solution, fails, tries to "debug" it, fails again, and keeps tweaking the same idea without ever realizing the whole approach was wrong. It wastes its budget on unproductive refinement. It's like a person trying to fix a broken watch by tightening the same screw over and over, instead of realizing they need a new watch.
  • The Swarm's Advantage: The "Swarm" (k-shot) relies on exploration. Because everyone is guessing independently, the swarm is more likely to stumble upon the one lucky, correct path early on. It doesn't waste time fixing mistakes; it just keeps trying new, fresh ideas.

The "Cost-Per-Success" Metric

The authors didn't just look at who solved the most problems; they looked at efficiency. They introduced a simple rule for how to spend your budget:

Don't ask: "How smart is this method?"
Ask: "How much does it cost to fail, and how often does it fail?"

They proved mathematically that if you have a fixed budget, the best way to maximize your chances of success is to find the method that gives you the lowest "log failure likelihood per dollar."

In plain English: If a single quick guess is cheaper and has a decent chance of working, you should just make that guess over and over again. You shouldn't spend extra money on a long, complex process that only slightly increases your odds of success.

The Takeaway

  • For Software Engineering (fixing bugs in huge codebases): The "Deep Thinker" is great because the problem is messy, the environment is complex, and you need to interact with files and tools to fix things.
  • For Competitive Programming (solving logic puzzles): The "Swarm" is better. These problems are like isolated math equations. You don't need a detective to talk to the walls; you just need to try enough different equations until one works.

In summary: When you have a limited budget and a self-contained puzzle, don't overthink it. Throw a lot of cheap, independent guesses at the problem rather than paying for one expensive, deep-dive investigation. The paper shows that quantity of independent attempts often beats quality of deep reasoning in this specific context.

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 →