The Monkey Tax

A 2024 Stanford paper found that sampling a cheap model 250 times beat one try from GPT-4o or Claude 3.5 Sonnet on SWE-bench Lite, at lower total cost. The catch nobody prices in: that result assumes a perfect selector already knows which of the 250 samples is correct. Self-consistency voting needs quadratically more samples to resolve a close call; best-of-N with a reward model needs quadratically fewer samples but pays for a scoring pass on every one of them. Either way, most production systems fix N as a flat constant and pay full generation cost on requests one sample would have solved. Three 2025-2026 papers, ST-BoN, Slim-SC, and uncertainty-aware budget allocation, cut that tax by making the sample count a live, per-request decision instead of a config value nobody revisits.

Published 2026-09-12 by Dor Amir on the Nadir blog.

Filed under Agents.

The paper that turned a cheap model into a cheat code

In July 2024, a Stanford team published a result that reads like a loophole: sample a model enough times, and a cheap one starts beating an expensive one, on both accuracy and price, at once. Source: Brown et al., "Large Language Monkeys: Scaling Inference Compute with Repeated Sampling," arXiv:2407.21787. On SWE-bench Lite, DeepSeek-V2-Coder-Instruct solved 15.9% of issues given one attempt. Given 250 attempts, it solved 56%, more issues than a single try from GPT-4o or Claude 3.5 Sonnet, and at lower total cost than either. The relationship wasn't a fluke of one model or one benchmark: coverage, the fraction of problems solved by at least one sample, scaled with sample count as a log-linear power law across every task and model family the paper tested.

That's the pitch every "test-time compute" headline since has repeated in some form: don't train a bigger model, just ask a smaller one more times. The paper's own title is a wink at why that pitch is incomplete. Give infinite monkeys infinite typewriters and one of them eventually types Hamlet. The number that made headlines, 56% coverage, assumes something the metaphor glosses over: somebody already knows which page is Shakespeare. Coverage is a pass@k number. It credits a set of N samples with a win the moment any one of them is correct, whether or not anything in your system could have identified which one. Production doesn't get to return a set. It has to return one answer. Picking that answer, cheaply and reliably, is the part the coverage curve never bills you for.

Bar chart showing SWE-bench Lite coverage for DeepSeek-V2-Coder-Instruct rising from 15.9% at one sample to 56.0% at 250 samples, with a note that coverage assumes a perfect selector picks the correct sample out of N.
Bar chart showing SWE-bench Lite coverage for DeepSeek-V2-Coder-Instruct rising from 15.9% at one sample to 56.0% at 250 samples, with a note that coverage assumes a perfect selector picks the correct sample out of N.

Two ways to pick, two very different bills

There are two standard ways to turn N generated samples into one returned answer, and they fail in opposite directions.

Self-consistency, the original 2022 technique, samples N full reasoning chains and takes a majority vote on the final answer. Source: Wang et al., "Self-Consistency Improves Chain of Thought Reasoning in Language Models," arXiv:2203.11171. No reward model, no extra scoring pass, just a vote. The catch is in how many votes a close call needs: recent sample-complexity analysis shows self-consistency requires Θ(1/Δ²) samples to reliably surface the correct answer, where Δ is the probability gap between the correct answer and the next most likely one. Source: "Sample Complexity and Representation Ability of Test-Time Scaling Paradigms," arXiv:2506.05295. Squared. The requests where the model is most genuinely torn between two plausible answers, exactly the ones a voting scheme exists to rescue, are the ones that need quadratically more samples before the vote can be trusted.

Best-of-N with a reward or verifier model scores every sample and returns the highest-scoring one. The same analysis found it needs only Θ(1/Δ) samples for the same reliability, quadratically fewer than plain voting. But every one of the N samples now has to be scored, by a separate model call, which is its own token bill stacked directly on top of the N generations it's judging. This blog has already measured how expensive that judge call gets on its own; running it N times per request multiplies a cost that was already easy to underestimate.

Either method is usually implemented with N fixed once, at integration time, as a flat constant: 5, 10, 20, 40 samples, applied to every request in the traffic mix regardless of whether that particular request needed one try or would have needed three hundred. That flat constant is the monkey tax: full generation cost, and often a full scoring pass, paid on requests a single sample would have nailed, while the rare request that actually needed the full budget is still capped at the same number as everything else.

What a year of test-time-scaling research actually fixed

The gap between "coverage exists" and "coverage is affordable" is where most of 2025 and 2026's test-time-compute research has been spent. None of it argues against sampling. All of it argues against spending the same fixed N on every request.

ST-BoN watches how consistent a sample's internal decoding state looks before it finishes generating, and truncates the ones that are already trailing instead of paying to complete them. No separate reward model required. Source: "Sampling-Efficient Test-Time Scaling: Self-Estimating the Best-of-N Sampling in Early Decoding," NeurIPS 2025, arXiv:2503.01422. Reported result: over 80% less GPU memory, 50% less latency, and either 70 to 80% lower cost at matched accuracy, or 3 to 4 points higher accuracy at matched cost, against a full Best-of-N baseline.

Slim-SC applies the same instinct to self-consistency specifically: it prunes reasoning chains that would cast a redundant vote, a sample that's substantively the same as one already drawn, so the ensemble reaches the same voting confidence on fewer complete generations. Source: "Slim-SC: Thought Pruning for Efficient Scaling with Self-Consistency," arXiv:2509.13990.

Uncertainty-Aware Budget Allocation moves the decision up one more level: instead of fixing N per method, it fixes a budget and spends it per query, based on measured uncertainty, drawing more samples for a request the model is genuinely unsure about and stopping at one or two for a request it already agrees with itself on. Source: "Uncertainty-Aware Budget Allocation for Adaptive Test-Time Reasoning," arXiv:2605.26849.

Bar chart comparing inference cost, latency, and GPU memory for full Best-of-N sampling versus ST-BoN's early-truncation selector at matched accuracy: cost drops to 20-30%, latency drops 50%, GPU memory drops over 80%.
Bar chart comparing inference cost, latency, and GPU memory for full Best-of-N sampling versus ST-BoN's early-truncation selector at matched accuracy: cost drops to 20-30%, latency drops 50%, GPU memory drops over 80%.

The common thread across all three is the same sentence repeated three ways: stop treating N as a number you set once. Each one turns "how many tries does this request need" into a live, per-request measurement instead of a constant copied into a config file during initial integration and never revisited.

The same decision, one level down from routing

That sentence should sound familiar. It's the same argument this blog makes about model choice: a router that sends every request to the same model regardless of difficulty pays a tax on the easy majority to cover the hard minority; a sampling scheme that draws the same N regardless of difficulty does exactly that, one layer further into the request. Both problems have the same shape, and both have the same fix: a calibrated signal that knows when the cheap path has already converged, and escalates, in tries or in model tier, only when it hasn't.

This blog has already covered what a verifier-gated cascade buys over blind escalation: the value isn't the ceiling case, it's removing the cost of continuing past the point where continuing stopped helping. The same verifier score that decides whether to escalate a request from a cheap model to an expensive one is the same kind of signal that decides whether a second sample is worth drawing at all. Treated as two separate engineering problems, they get solved twice, once per team, often with two different ad hoc thresholds nobody has measured against real traffic. Treated as one problem, calibrated confidence gating an escalation, in tier or in sample count, it's a single mechanism.

What to check this week

A minimal version of the early-stop, routed so the generation step and the agreement check use whichever models are actually cheapest for each:

from collections import Counter
import openai

client = openai.OpenAI(
    base_url="https://api.getnadir.com/v1",
    api_key="ndr_...",
)

def adaptive_sample(prompt, max_samples=20, agreement_threshold=3):
    votes = Counter()
    for _ in range(max_samples):
        response = client.chat.completions.create(
            model="auto",
            messages=[{"role": "user", "content": prompt}],
        )
        answer = response.choices[0].message.content.strip()
        votes[answer] += 1

        top_answer, top_count = votes.most_common(1)[0]
        # Stop as soon as one answer has a clear, stable lead —
        # not when max_samples is reached.
        if top_count >= agreement_threshold and top_count > sum(votes.values()) - top_count:
            return top_answer, sum(votes.values())

    return votes.most_common(1)[0][0], sum(votes.values())

Same call shape as talking to any OpenAI-compatible endpoint. Nadir routes each of those calls to the cheapest model and provider that can handle it and reports the routing decision per request, so the sample count this loop settles on, not a hardcoded N, becomes the only variable left to tune.

Related reading


Sources: [Brown et al., "Large Language Monkeys: Scaling Inference Compute with Repeated Sampling," arXiv:2407.21787](https://arxiv.org/abs/2407.21787). [Wang et al., "Self-Consistency Improves Chain of Thought Reasoning in Language Models," arXiv:2203.11171](https://arxiv.org/abs/2203.11171). ["Sample Complexity and Representation Ability of Test-Time Scaling Paradigms," arXiv:2506.05295](https://arxiv.org/abs/2506.05295). ["Sampling-Efficient Test-Time Scaling: Self-Estimating the Best-of-N Sampling in Early Decoding," NeurIPS 2025, arXiv:2503.01422](https://arxiv.org/abs/2503.01422). ["Slim-SC: Thought Pruning for Efficient Scaling with Self-Consistency," arXiv:2509.13990](https://arxiv.org/abs/2509.13990). ["Uncertainty-Aware Budget Allocation for Adaptive Test-Time Reasoning," arXiv:2605.26849](https://arxiv.org/abs/2605.26849).

More on agents

What Nadir is

Nadir is an LLM router. Nadir sends each prompt to the cheapest model that can handle it. A small decision model reads each prompt against your model menu and picks the lowest-cost model it expects to handle it. When the decision model is uncertain or unavailable, the request goes to the strongest model on the menu. The routing step makes no call to your model provider.

Nadir runs two ways. The decision API returns a model, reasoning-effort, cache, context, and policy recommendation without calling a model provider, beside the gateway you already run. That is how a shadow-mode evaluation works, and its projected savings stay advisory. The OpenAI compatible managed proxy executes the route, and migration is a two-line change: point the base URL at api.getnadir.com and set model to auto. On that path an optional verifier can score a complete non-streaming answer and escalate to a stronger model when it misses the configured bar. Streaming bypasses post-generation verification. BYOK is supported on every tier.

For coding agents, Nadir Auto is a terminal launcher for Claude Code or Codex that asks Nadir for the main-session model before each turn, with your configured model as the fallback and cost ceiling. Delegation integrations for Claude Code, Codex, or Cursor instead recommend a model tier for subagent work, and the agent decides; the Claude plugin can also move a main-thread turn to Haiku when Nadir's cache check prices it cheaper, unless its switch_main_model option is off. Either way inference runs on your own provider account, so Nadir holds no provider keys on that path.

What the numbers are, and what they are not

Nadir publishes each evaluation with its scope. On checkable code, run-check-escalate solved 392 of 395 common HumanEval and MBPP problems (99.2%), graded by running the canonical tests; that applies only to tasks with runnable deterministic tests. Nadir-Tumbler posts an arena_score of 72.3 on RouterArena's public scorer, 5th of 23 routers, which measures the routing decision on RouterArena's own model pool. A reference-assisted RouterBench evaluation over 11,420 held-out triples produced a 60% lower projected cost than always-Opus with about 98% retained quality and a 1.7% catastrophic-route rate. That experiment gave the verifier the expensive-model reference answer, which production does not have, so it is a research ceiling and not the deployed path.

None of these is a production guarantee, a universal savings rate, or a forecast for any particular workload. Customer savings are reported from measured execution against a declared baseline, and customer quality only from outcome-labelled traffic. Projected savings and realized savings are separate artifacts and are never blended.

Design-partner program

Three rungs, picked by risk appetite. Rung 0 Shadow runs advisory decision calls alongside live traffic and returns a projected receipt, with nothing in the request path changed. Rung 1 Hosted is the two-line swap on a production slice and returns a realized receipt. Rung 2 On-prem is a supervised six-week proof of concept inside the partner's VPC, where no prompt, response, or usage reaches Nadir. The commitments are the same at every rung. Apply for a rung directly: Rung 0 Shadow, Rung 1 Hosted, or Rung 2 On-prem. Not sure which fits? Start at getnadir.com/contact/?reason=design-partner.

Licensing

NadirClaw is the self-hosted core, source-available under the PolyForm Noncommercial License. Source-available is the correct label; NadirClaw is not open source. Nadir Route's hosted plan has no base fee and charges a variable fee only on measured savings from requests Nadir executed.

Pages on this site

Machine-readable summaries of this site: llms.txt and llms-full.txt.