TokenGolf mark: a green pin flag and ball on a putting green.

TokenGolf

TASKone of 8 categories$0 · EXACT-OR-ABSTAINsolve_matharithmetic · percentages$0solve_codeAST-locked sandbox$0local Qwensentiment 1.00 · NER 0.88$0proved?agree ≥ τyesnoKEEP THE FREE ANSWERanswered locally, on CPU0 scored tokensFIREWORKS · 1 CALLreasoning_effort = none−46% tokens · never a chainthe only tokens scored0scored tokens on the submitted :local imageevery task answered on the free tiers · :smartlocal pays one reasoning-off call for the rest

When the leaderboard counts tokens, the cheapest correct answer is the one you never sent to the cloud.

Author

  • Soren Nguia1

Affiliation

  1. Independent Researcher (Seoul)

Built

Jun–Jul 2026 · AMD Developer Hackathon ACT II · Track 1

Repository

GitHub

Ship

Docker amd64 · Fireworks AI

TL;DR

TokenGolf is a Track-1 agent for the AMD Developer Hackathon ACT II. It answers eight capability categories - factual recall, math, sentiment, summarisation, named-entity recognition, code debugging, logic, and code generation - and is scored on a single axis above an accuracy gate: the number of Fireworks tokens it spends. Fewer tokens wins. So the whole agent is a cost-ordered cascade: every task tries the cheapest path first and only pays when nothing free can prove an answer.

The tiers, in cost order: a $0 calculator, a $0 sandboxed code executor, and a free local model (Qwen2.5-3B on CPU under llama.cpp) that owns sentiment and named entities - each exact-or-abstain, so it can never lower accuracy. A separate calibrated mode, which neither the :local nor the :smartlocal image runs, adds a free confidence gate that keeps a local answer when its self-consistency clears the threshold - free, but decided on agreement rather than proof, so it is counted as a gate and not as a tier. Then, only for what is left, a single Fireworks call with reasoning_effort = none (the hidden reasoning was the dominant cost; turning it off cuts scored tokens about 46% at .958 accuracy). The submitted :local image goes all the way: it answers every task on the free tiers and never calls Fireworks at all - 0 scored tokens, the only kind of entry that can win a fewest-tokens ranking. 216 offline tests, shipped as a Docker amd64 image verified to fit the 4 GB / 2 vCPU grading box.

Ranked by tokens, not by answers

Track 1 does not rank agents by how many questions they get right; correctness is a floor, and the leaderboard is the token bill above it. That inverts the usual instinct. The straightforward way to raise accuracy - sample more, reason longer, chain a few calls - is exactly the way to lose, because every one of those tokens is charged. The design question becomes: for each task, what is the cheapest path to a correct answer, and can we tell in advance which path that is?

The card, stated plainly
TokenGolf project card: AMD Developer Hackathon, Track 1. A calibrated, token-efficient routing agent that turns off the Fireworks models' hidden reasoning. reasoning off gives minus 46 percent tokens, .958 accuracy, 8 of 8 categories, Docker amd64.
Figure 1: The project card. One binary cascade, never a chain: local answers what it can for free, the rest gets a single Fireworks call with reasoning turned off.
The cascade, one task at a time
One task, down the cost ladder01 / 05

A task tries each stage in cost order - three exact-or-abstain tiers, then the confidence gate - and stops at the first that can settle an answer. It only costs tokens if it reaches the bottom.

01$0
solve_math
arithmetic
02$0
solve_code
evaluate
03$0
local Qwen
sentiment · NER
04$0
confidence
agree ≥ τ
05scored
Fireworks
1 call
0
scored tokens · answered free above the paid tier
01 · solve_math
Exact arithmetic and percentages (47 * 13, 15% of 240) are answered by an AST-safe evaluator. A word problem it cannot prove, it abstains and drops through. Never a wrong answer for free.
02 · solve_code
“output of this code” runs in an AST-locked sandbox: imports, dunder access, and dangerous builtins are rejected, with a hard timeout. Generative debug and generation abstain, because running is not the same as correct.
03 · local Qwen
A 3B model on CPU under llama.cpp answers sentiment (1.00) and named-entity extraction (0.88) for zero scored tokens. Everything it is not reliable on, it declines rather than guess.
04 · confidence
Separate calibrated mode, not :local or :smartlocal: the local model's self-consistency (AUC 0.807, n=150) decides keep-or-escalate against a τ calibrated on held-out data. A gate, not a fourth $0 tier: it keeps on agreement, not proof.
05 · Fireworks
Only what nothing above could prove escalates to a single Fireworks call with reasoning_effort = none, which cuts scored tokens by about 46% at .958 accuracy. One capped call, never a chain.

The submitted :local image stops at the free tiers for every task: 0 scored tokens, the only entry that can win a fewest-tokens ranking. The :smartlocal fallback keeps the three free tiers and pays one reasoning-off call for the rest. The confidence gate belongs to a separate calibrated mode; neither image runs it.

Figure 2: Scroll to follow a single task down the cost ladder. It passes through the free tiers at 0 scored tokens and is charged only if it reaches the paid Fireworks call at the bottom.

The 0-token play

The cleanest way to win a ranking by fewest tokens is to spend none. Local, in-container inference is not on the leaderboard - those tokens score zero - so the primary submission, the :local image, answers all eight categories on the local model plus the $0 deterministic solvers and never opens a Fireworks connection. Its scored-token total is exactly zero.

That only works if the free tiers clear the hidden accuracy gate on their own, which is why each tier is exact-or-abstain and why the local model is used only where it is measured-reliable. The :smartlocal fallback is the insurance: the same free tiers, but whatever they decline escalates to one reasoning-off Fireworks call, so it stays above the gate for a small, bounded token bill. :smartlocal also carries a zero-Fireworks-call guard that forces one paid call if an entire batch is somehow answered free - a hedge against a run with no API calls being ruled invalid, a rule the written Participant Guide does not state. The guard is off in :local, which never calls Fireworks by design.

Three $0 exact-or-abstain tiers, and a gate

Before any token is spent, three tiers try to answer for free. The discipline that makes them safe is the same in each: answer only when the answer can be proven, otherwise abstain and fall through. A tier that guessed would drag accuracy; a tier that abstains cannot. A fourth free stage exists in a separate calibrated mode - the confidence gate - and it is counted separately on purpose: it costs no scored tokens either, but it keeps an answer on measured agreement rather than on proof, so it is a gate, not a fourth exact-or-abstain tier. Neither the :local nor the :smartlocal image runs it.

The local model is used narrowly on purpose. Measured on the dev bench, the 3B clears only sentiment and NER; it fails math (0.00), factual recall (0.25), and code generation (0.25), so those never go local. But sentiment and NER are expensive to buy remotely, so offloading just those two is worth about 22% off an all-remote baseline - the saving a leaner all-remote entry leaves on the table.

reasoning_effort = none

The single largest lever is the least glamorous. The Fireworks reasoning models emit a hidden reasoning trace before the answer, and those tokens are scored just like the answer's. On these eight categories the trace is not buying accuracy that survives measurement; it is buying cost. Setting reasoning_effort = none on the escalated call removes the trace and cuts scored tokens by roughly 46% with no measured accuracy loss (kimi-k2p7-code on the 24-task dev bench: 8192 scored tokens down to 4448, accuracy .917 to .958). The hidden reasoning was the dominant expense, and the tasks did not need it.

Scored tokens, reasoning on vs. off
reasoning on
reasoning = none
reasoning on (baseline)reasoning = none (shipped)
Figure 3: The same escalated calls, scored with and without the hidden reasoning trace. Turning reasoning off keeps about 54% of the token bill - a −46% cut - while accuracy holds at .958. This is a claim about these eight categories, not a general claim that reasoning is useless.

The calibrated confidence gate

For the part of the local model's range beyond the safe two categories, keep-or-escalate is a judgment call, and TokenGolf makes it from the local model's own self-consistency: sample it a few times and measure how tightly the samples agree. High agreement is kept for free; low agreement escalates. On held-out data this separates the local model's right answers from its wrong ones with an AUC of 0.807 (n=150) - keeping the most-confident ~40% local lands 0.90 accuracy on that slice.

The keep-or-escalate threshold τ is calibrated on held-out data, not hand-picked, to trade the two failure modes: too low and confident-but-wrong local answers cost accuracy; too high and easy tasks burn tokens the local model could have saved. The honest limit is that self-consistency rewards agreement, not correctness - a model consistently wrong (about 3% of cases here, all arithmetic slips) is kept when it should escalate - which is exactly why math routes to the deterministic solver or to Fireworks, never to the local vote. Escalation itself is always a single capped call, never a chain, so the token cost per task stays bounded.

The calibration package behind τ is reused, not new: it is copied verbatim from GAUGE, which took it verbatim from PARALLAX, and here it is pointed back at the model-routing decision it was built for. TokenGolf is a recombination of calibrated-abstaining routing and self-consistency, not a new method.

# :smartlocal - $0 tiers, then one call (:local answers the rest locally instead)
if (ans := solve_math(task)) is not None: return ans   # $0 exact
if (ans := solve_code(task)) is not None: return ans   # $0 sandbox
if category in (SENTIMENT, NER):        return local(task)  # $0 local
return fireworks(task, reasoning_effort="none", max_tokens=CAP)

# separate calibrated mode - the confidence gate
answer, votes = local.sample(task)       # free: local tokens score 0
if agreement(votes) >= TAU:              # threshold from held-out data
    return answer                        # keep it, 0 scored tokens
return fireworks(task,                    # exactly one remote call
                 reasoning_effort="none", # drop the hidden trace: -46%
                 max_tokens=CAP)          # terse, output-capped

Built to not fall over

The grading box is unforgiving: linux/amd64, 4 GB of RAM, 2 vCPUs, an image of at most 10 GB compressed, 60 s to start, ten minutes total and under 30 s per request, and a crash or timeout scores whatever is in /output/results.json at that instant. So that file is written incrementally and atomically - it is a complete, valid JSON array after every task, never a half-written one - which turns any crash or the ten-minute cap into partial credit instead of zero. A time watchdog watches the clock and, as the budget runs low, stops handing tasks to the slow local model and flushes the rest to fast Fireworks, trading a few tokens to guarantee every task is answered.

The fit was measured, not assumed: under those constraints the :smartlocal image peaks at 2229 MiB (about 1.8 GB of headroom under the 4 GB cap), stays well under 30 s per request, and exits clean. The routing, the solvers, the sandbox's rejections, and the atomic writer are covered by 216 passing offline tests. Tasks and models were revealed only on launch day, so the agent is model-agnostic: model ids and thresholds are read from the environment, and retuning is a config change, not a rewrite. The calibration loop was rehearsed before launch on RouterBench, for $0, to protect a $50 Fireworks credit budget.

Measured, and left out

One tier was built, measured, and deliberately switched off. A "local model writes Python, the sandbox executes it" path would, in principle, solve math word problems for free. But measured on GSM8K the 3B mistranslates the word problem into the wrong setup stably - the same wrong translation across samples - so the agreement gate does not catch it, and only about one in five of its confident answers was correct. Shipping it would put wrong answers into the free tier and drag accuracy, so it stays dormant behind a flag and math word problems go to Fireworks (reasoning-off kimi was 100% on the dev math set). It stays in the code for a stronger local model. A measured negative, kept out, is the same discipline as the exact-or-abstain tiers: a free path may answer only when it can prove it is right.

Results

0
scored tokens · the :local image
−46%
tokens, reasoning off (kimi, n=24)
.958
accuracy, reasoning off
8/8
capability categories covered

The submitted :local image answers all eight categories on the free tiers for 0 scored tokens; the :smartlocal fallback keeps accuracy above the gate by paying one reasoning-off call for what the free tiers decline, at about 46% fewer tokens than the same call with reasoning on. Escalation is bounded to one capped call per task, so the token bill is predictable rather than open-ended - the property a token-ranked leaderboard actually rewards. Which image ranks best is decided on the leaderboard, the only ground truth.

Limitations

Conclusion

When the leaderboard is the token bill, the discipline is to answer as much as possible without sending anything to the cloud, and to prove you are right before answering for free. TokenGolf pushes that to the limit: a cost-ordered cascade of exact-or-abstain tiers that, in its submitted form, answers every task locally for zero scored tokens, with a reasoning-off Fireworks fallback for insurance and a set of guards so that even a crash still scores. The scoring rule, turned into the architecture.