TTT-Discover

Give an open LLM one hard problem and let it keep training on its own attempts. On a GPU kernel contest it wrote a kernel that runs in 1,161 µs, faster than the best human's 1,371 µs. The same model, frozen and sampled 25,600 times, never got below 5,390 µs.

Pick a method and press Play. Watch the cloud of 512 attempts at each step, the best kernel so far, and the average. Then we build the method from zero. The problem becomes a game, a frozen model searches it, and a new objective cares only about the best. A rule picks where to start, and we add up the cost.

You need what an LLM does (it writes text, including code, one token at a time) and what reinforcement learning is (try, get a score, make high-scoring attempts more likely). We build the rest.

Spend 25,600 attempts

Ready
0 of 50

Press Play. Each step, the method writes 512 kernels and an evaluator times them on an H100.

The task is GPUMode's TriMul on an H100. Final best runtimes are from the paper's ablation table, all timed by the same evaluator (Table 8): best-of-25,600 5,352 µs, frozen model with the paper's reuse rule 2,061 µs, TTT-Discover 1,203 µs. The best human kernel is 1,371 µs (Table 4); the lede's 1,161 µs and 5,390 µs are the official leaderboard timings (Table 4). Curves are traced by eye from Figure 4. The clouds of dots are illustrative shapes drawn to match those curves; the paper shows such clouds only for TTT-Discover (Figure 1).

Chapter 0

A discovery is one number

Meet the kind of problem where only the single best answer counts, and see why a frozen model plateaus on it

Think back to your hardest programming assignment. You knew the textbook. You tried a few guesses, and they gave small signs of life, nothing more. So you studied your failed attempts, and each new attempt got a little smarter. After hours of this you understood the new idea, and the next attempt worked.

That story has two parts: trying and learning from the tries. Today's AI systems for scientific discovery mostly do only the first part. This paper adds the second.

Start with the problems themselves. Each one comes with a number that says how good a candidate is. A GPU kernel has a runtime. A mathematical construction certifies a bound. A contest program earns a score. The best number anyone has found so far is the state of the art.

The paper defines a discovery very simply: you find a candidate whose number beats the state of the art. The bigger the margin, the bigger the discovery. Nothing else counts. A thousand good attempts that all fall short are worth nothing. One attempt that beats the record is worth everything.

Four domains, one method

Pick a domain. Each bar is the best result of one method. Longer is better, whichever way the raw number goes. The yellow line is the best human result.

Numbers from the paper's summary table (page 1) and Tables 2, 4, 6 and 7. Erdős: upper bound, lower is better. TriMul A100: runtime in µs, lower is better. AtCoder ahc039: contest score, higher is better. Denoising (PBMC): benchmark score, higher is better. Bars are drawn on a scale that starts near the worst shown value, so small gaps stay visible; the read-out gives exact values. "Best-of-25,600" is the same open model, frozen, with the same number of attempts as TTT-Discover. No prior AI result exists for TriMul or denoising.

The bars tell a consistent story. The same open model, gpt-oss-120b, sampled 25,600 times without any training, lands below the best human in three of the four domains. On the Erdős problem plain sampling does edge past the old record, by far less. The same model trained on its own attempts lands above the human result every time. In the Erdős problem, its margin over the previous record is 16 times bigger than the previous record's margin over the human result.

The usual way to throw compute at such problems is test-time search. You prompt a frozen model many times, keep the good attempts, and feed them back into new prompts. AlphaEvolve is the famous example. The prompts get better, but the model never changes. It is like a student who keeps a notebook of past attempts but never really learns the idea behind them.

TTT-Discover does reinforcement learning at test time. The model attempts the problem, an evaluator scores each attempt, and the model's weights take a gradient step toward the better attempts. Then it attempts again, now a slightly different model. Fifty steps later it is a specialist in one problem.

The idea in one line: keep training on the problem in front of you, and train for the best attempt, not the average one. Standard RL wants a policy that does well on average, because the policy is the product. In discovery the policy is only a tool. The product is one record-breaking solution.

That second half matters as much as the first. A naive version of test-time RL barely beats sampling, as we will see in the ablations. The paper's gains come from two changes that point the whole loop at the maximum. Here is the road.

  1. The problem as a game: state, action, transition and reward, for math, kernels, contests and biology.
  2. Search with a frozen model: best-of-N, reusing states, and why the model's reach never grows.
  3. Learn at test time: the loop, the naive RL baseline, and why the average is the wrong target.
  4. The entropic objective: a weight that grows exponentially with reward, and the slider from mean to max.
  5. A KL budget sets β: how the paper picks the sharpness for every group automatically.
  6. PUCT picks where to start: an AlphaZero-style rule over an archive of past solutions.
  7. One run, with sizes and cost: 50 steps, 512 rollouts, LoRA rank 32, about $500.
  8. The results, read fairly: records, ties, a miss, and which comparisons are apples to apples.
  9. Which piece matters: the ablations on the kernel task, and the hero in full.
  10. Connections: the cheat sheet, the code and the limits.
Under the paper's definition, which outcome counts as a discovery?

Chapter 1

The problem as a game

Turn a math bound, a GPU kernel and a contest into the same four parts: a state, an action, a transition and a reward

Before the model can learn anything, the problem must become a game with a score. The paper follows AlphaEvolve's recipe. Every problem arrives as a text description, which we call d. It might say: "Here is a slow PyTorch module. Write a faster Triton kernel that gives the same output." The model always sees d.

A state s is a candidate solution: a kernel, a C++ program, or a step function stored as a list of numbers. An action a is what the model writes: some thinking tokens, then code. The transition turns the action into the next state. The reward R(s) scores that state.

Follow one attempt

Pick a problem, then press Next to follow one attempt from prompt to reward. Press Break it to see what happens to a kernel that gives the wrong answer.

The four parts per problem follow Table 1 and Sections 4.1 to 4.3. Token limits are from Section 3.3 and Table 9: a 32,768-token context, with prompt plus thinking capped at 26,000 tokens. Time limits: kernels are timed on H100s through Modal (Sec. 4.2); math code gets 10 minutes in Sec. 4.1 (Appendix B says up to 1,100 s); AtCoder programs get 2 s and 1,024 MB (Sec. 4.3). The code snippets are short illustrations, not the paper's code.

Look at the transition. For a kernel or a contest program, the code is the new state, so the environment just parses it out of the text. For math, the code is a program that builds the construction, often by running an optimizer. So the environment parses the code and runs it, and the output array is the new state.

Every reward comes after a validity check. A kernel must match the PyTorch reference output within the contest's tolerance. A step function for the Erdős problem must stay between 0 and 1 and integrate to 1. A program must finish in time. Fail the check, and the reward is 0. That rule matters later: many attempts fail, and the learning signal must handle a pile of zeros.

ProblemState sTransitionReward R(s)
Erdős minimum overlapstep function (array)run the parsed Python1 / certified upper bound
Autocorrelation, firststep functionrun the parsed Python1 / certified upper bound
Autocorrelation, secondstep functionrun the parsed Pythoncertified lower bound
GPU kernelTriton kernel codeparse the code1 / runtime
AtCoder contestC++ programparse the codescore on local tests
Single-cell denoisinganalysis codeparse the code1 / MSE

Why "one over" the bound or runtime? Because the method always maximizes reward. A smaller runtime must become a larger reward, and dividing does that. Keep this in mind: on a 1/runtime scale, going from 2,000 µs to 1,900 µs raises the reward by only about 5%. That small number will cause trouble in Chapter 3.

One more choice hides in the action. The model writes its action conditioned on the description and a starting state: a ~ πθ( · | d, s). Which starting state to give it is a real design decision. It could be empty. It could be the current record holder. It could be one of the model's own earlier attempts. The next chapter is about exactly this choice.

A generated kernel runs very fast but gives outputs that do not match the PyTorch reference. What reward does it get?

Chapter 2

Search with a frozen model

Compare sampling from scratch with reusing the best attempts, and find the limit that no amount of reuse removes

Suppose the model's weights are fixed. How can more compute still help? There are two classic answers. Both appear as baselines in the paper, so it pays to know them well.

The simplest is best-of-N. Give the model the description and an empty starting state. Sample N independent attempts. Keep the best one. The attempts never see each other. The paper sets N = 25,600, exactly the number of attempts TTT-Discover makes, so the two use the same sampling budget.

Best-of-N has a weakness. Each attempt starts from nothing, so it must invent every idea in one go. A great kernel might stack five tricks: lower precision, then fusing one layer, then another, and so on. If one attempt can only add one or two tricks, starting from scratch caps how far it can get. The paper calls this a short effective horizon.

Climb the ladder of tricks

Each rung is one more trick stacked into a solution. One attempt climbs a few rungs from its starting rung, or fails. Pick a method and press Run for 400 attempts. Then raise the reach slider: that is what learning changes.

45%

A toy, not the paper's data. An attempt adds one more rung with probability equal to the reach, again and again until it stops; 30% of attempts fail outright. Reuse picks a start from the five best states found so far. In "Reuse + learn" the reach rises by one point every 10 attempts, a cartoon of weight updates. The paper's real versions are best-of-25,600, OpenEvolve, and its own reuse rule with a frozen model (the "No TTT" ablation).

The fix is state reuse. Keep a buffer of past attempts with their rewards. For each new attempt, pick a starting state from the buffer, favouring high rewards but sometimes choosing weaker ones. The model now improves an existing solution instead of starting over. Each reuse adds one more timestep to that solution's history, so chains of improvements can grow long.

Evolutionary search, the family that includes AlphaEvolve, goes one step further. It also reuses the actions: the thinking and intermediate results behind each past solution. A hand-written reuse routine turns that history into extra natural-language context c for the next prompt. These routines often borrow ideas from evolution, such as mutation, crossover and measures of fitness and diversity.

si, ci
The starting state for attempt i, and extra context written from past attempts (only in state-action reuse).
reuse
The rule that picks from the buffer. In evolutionary search it is hand-crafted and domain-specific.
Hi
The buffer of all attempts so far: start state, action, new state and reward.
ai
The new action: thinking tokens and code.
πθ
The policy, which is the LLM with weights θ. In all search methods θ never changes.

Now run the toy above with Reuse, then with Reuse + learn. Reuse breaks the horizon limit: the best rung climbs steadily, because each good attempt becomes a launch pad. But look at the reach slider. Under search it never moves. The model is exactly as good at adding a trick at attempt 25,600 as at attempt 1.

That is the limit the paper attacks. "While these prompts can help the LLM improve previous solutions," the authors write, "the LLM itself cannot improve." The model's experience with this problem only ever changes the next prompt, never the model.

Why not start every attempt from the record holder? The paper considers this and usually does not. Conditioning on the best known solution is a strong push toward exploiting it. Under a big budget, very different directions might lead further. So most runs start the buffer from an empty or random state, and let reuse do the exploiting.
In evolutionary search such as AlphaEvolve, what changes from one attempt to the next?

Chapter 3

Learn at test time

Add one line to the search loop that updates the weights, then see why plain RL aims that update at the wrong target

Here is the whole idea in one change. Take the search loop from the last chapter. After the evaluator scores each attempt, use it as training data: take a gradient step on the model's weights. The next attempt comes from a slightly different model, one that has learned from this very problem.

The paper writes the general loop as Algorithm 1. Read it as a recipe with two blanks, reuse and train. Everything in the rest of the lesson is about filling those two blanks well.

  1. Turn the description d into a reward function R and a transition T.
  2. Start the buffer with the empty solution: H0 = {(<empty>, R(<empty>))}.
  3. Pick a start state and context from the buffer: si, ci ~ reuse(Hi).
  4. Sample an action from the current model: ai ~ πθi( · | d, si, ci).
  5. Apply it and score it: s′i = T(ai), ri = R(s′i).
  6. Add the attempt to the buffer.
  7. Update the weights: θi+1 = train(θi, attempt). This is the new line.
  8. Repeat. At the end, return the single state with the highest reward ever seen.

Look at the last step. The output is not the trained model. It is one solution, the best one found. Nobody needs the model afterwards; it is not the point. That one detail changes what "good training" means.

The obvious version: naive test-time RL

The natural first try is to fill the blanks with standard RL. For train, use a policy gradient that maximizes the expected reward, as PPO or GRPO do. For reuse, always start from the empty state:

θi+1
The weights after the update. In this paper only a small LoRA adapter on top of the frozen base model is trained.
η
The learning rate: how big a step to take.
E[R]
The expected reward: the average score of an attempt drawn from the current model.
δ<empty>
"Always start from the empty solution": no reuse at all.

This is a sensible baseline, and the paper runs it. On the kernel task it reaches 5,329 µs, almost the same as plain sampling's 5,352 µs (Table 8). Learning, aimed this way, buys almost nothing. Why?

In standard RL, the policy is the product. A robot policy will run a million times after training, so its average performance is what matters. In discovery, the paper lists three ways that goal goes wrong.

  1. The objective. Expected reward is indifferent to the state of the art. Take a kernel record of 2,000 µs. Reaching 1,900 µs may need a real breakthrough. On a 1/runtime reward, it is only about 5% more reward than 2,000 µs, so the gradient barely notices.
  2. The horizon. Starting every attempt from empty caps how many tricks one attempt can stack (Chapter 2).
  3. Exploration. An average-maximizer drifts toward safe, reliable attempts. Discovery needs the rare risky one. And at the reuse level, a greedy rule can lock onto a few good states and lose diversity.

The first point deserves a toy, because it is the heart of the paper. Below are two policies. Safe almost always writes a decent kernel. Bold often writes a mediocre one, but its attempts spread out more.

Average or best?

The curves show where each policy's attempts land. Drag Bold's spread wider. Watch the averages (dashed) and the typical best of 25,600 attempts (stars). The yellow line is the record to beat.

0.35
0.85

A toy with bell-shaped reward distributions. Safe has average 1.20 and spread 0.15. The star marks the median of the best of N draws, computed exactly for a bell curve. Rewards are in the units of the paper's Figure 4, where the best human kernel sits near 2.2; that line is the only number here taken from the paper.

Set Bold's average well below Safe's and its spread wide. Expected reward prefers Safe, clearly. Yet over 25,600 attempts, Bold's best attempt beats the record and Safe's never does. Standard RL would train the model toward Safe. Discovery wants Bold.

So the paper fills both blanks again, this time with the maximum in mind. For train, it uses an entropic objective that weighs the best attempts far more than the rest. For reuse, it uses PUCT, a rule borrowed from AlphaZero that scores a start state by the best thing ever found from it. The next three chapters build them.

Why does maximizing the expected reward fit discovery poorly?

Chapter 4

The entropic objective

Weigh each attempt by an exponential of its reward, and turn one knob from "push toward the average" to "push toward the best"

We want an objective that behaves like the maximum but still gives a smooth gradient. The maximum itself is useless for learning: only one attempt in a batch is the max, and a tiny change to the model rarely changes which one. We need something in between the average and the max, with a knob.

The paper uses the entropic objective, also explored by concurrent work on pass@k training. Instead of averaging the rewards, it averages e raised to β times the reward, then takes the log:

Jβ(θ)
The quantity the model is trained to increase. One value per starting state, then averaged over the starts that reuse picks.
eβR
The exponential of the reward times β. A large β makes the best attempts dominate the average, so log of the average tends to β times the maximum.

Why does this act like a max? Take two attempts with rewards 1 and 2, and β = 10. Their exponentials are e10 ≈ 22,000 and e20 ≈ 485 million. The average is almost exactly half the second one, so the log of it is about 20 − log 2, which is β times the max minus a little. Make β smaller and the gap closes. As β approaches 0, the objective behaves like β times the plain average.

Now the gradient. Differentiating the log of an average of exponentials gives a policy gradient where each attempt carries a weight:

wβ(a)
The weight of attempt a: its exponential divided by the group's average exponential. The weights average to exactly 1.
A(a; s)
The advantage: how strongly to make this attempt's tokens more likely (positive) or less likely (negative).
− 1
The baseline. Because the weights average to 1, subtracting 1 centers the advantages at zero.
λ log(πθ/πθ0)
A KL penalty that keeps the trained model close to the original one, θ0. The paper uses λ = 0.1, or 0.01 for the AtCoder tasks.

A worked number. Four kernels from one start state get rewards 1.0, 1.2, 1.5 and 2.0. Their average is 1.425.

β → 0: advantages proportional to reward − mean = (−0.43, −0.23, +0.08, +0.58)

β = 2:  w = (0.32, 0.47, 0.86, 2.35)  →  A = (−0.68, −0.53, −0.14, +1.35)

β = 3.5: w = (0.10, 0.19, 0.55, 3.16)  →  A = (−0.90, −0.81, −0.45, +2.16)

Watch the third kernel, at 1.5. It is above average, so under the plain average it gets a small push up. Under the entropic weights it gets a push down. Being better than average is not enough any more. The update reinforces only attempts near the top of the group.

Turn the knob from mean to max

The top row shows 64 attempts from one start state, sorted by reward; failures sit at 0. The bottom row shows each attempt's advantage. Drag β and watch the push concentrate on the best few. Press Adaptive to let the KL budget of the next chapter choose β.

Group
…

Illustrative rewards in Figure 4's units. Advantages use the paper's leave-one-out estimator (App. A.1): each attempt's exponential is divided by the average exponential of the other 63, minus 1. The slider runs on a square-root scale over 0 to 12 for the early group and 0 to 40 for the late group. The KL penalty term is left out because it depends on the model's token probabilities.

Small β is the old average-maximizer in disguise. A short expansion shows it: for small β, eβR ≈ 1 + βR, so w − 1 ≈ β(R − mean R). That is the ordinary policy gradient with a mean baseline, scaled by β. Large β puts nearly all the push on the single best attempt in the group, like training on the max.

So which β? The paper first tried a fixed β = 2, the value the concurrent work recommends. It found it hard to tune. Early in a run, rewards can jump a lot, and a big β lets one lucky outlier dominate the update, which makes training unstable. Late in a run, gains are small, and a small β makes every advantage tiny, so learning stalls. On the kernel task, the fixed β = 2 run ends at 1,484 µs, against 1,203 µs with the adaptive rule (Table 8). The adaptive rule is the next chapter.

Under the entropic objective with a large β, what happens to an attempt whose reward is a little above the group average but far from the group's best?

Chapter 5

A KL budget sets β

Choose the sharpness separately for every start state, so that the reweighted batch never moves too far from the batch you sampled

Here is the problem in plain words. The right β depends on the group. If one attempt is far better than the rest, even a small β already gives it almost all the weight. If all attempts are close, you need a large β before the best ones stand out. A single fixed number cannot serve both.

The paper's fix is to fix a different quantity instead: how concentrated the weights may get. Picture the 64 attempts of one group as 64 equal shares of a vote, the uniform distribution u. The entropic weights move the vote toward the best attempts. The paper limits how far the vote may move.

qβ(n)
The share of the vote that attempt n gets after reweighting. Its weight is w = N × q.
KL(qβ ‖ u)
How far the reweighted shares are from equal shares. Zero when β = 0; it grows as β grows.
γ = ln 2
The budget. The paper fixes it at ln 2 ≈ 0.693 for every task, and solves for β by bisection, a separate β for each start state.

The KL grows smoothly as β grows, so a simple bisection finds the β where it equals ln 2: try a β, check the KL, halve the interval, repeat. This mirrors Relative Entropy Policy Search, an older RL method that sets its temperature by the same kind of constraint.

Solve for β, group by group

Each curve is one group's KL as β grows. The budget is the warm line. Where a curve crosses it, that group gets its β. Drag the budget and watch the two β values move apart.

0.69

The two groups are the illustrative ones from Chapter 4. The KL, the bisection and γ = ln 2 follow App. A.1. The "acts like" count is our own reading of the formula: KL from uniform equals log N minus the entropy of q, so the exponential of the entropy is N times e to the minus KL.

The two groups get very different β. The early group, with one big jump, hits the budget at a small β. The late group, with small gaps, needs a large β. This is exactly the behaviour the paper wanted: no single lucky outlier takes over an early update, and late updates still separate the best from the rest.

There is a neat way to read the budget of ln 2 (this reading is ours, not the paper's). The KL from uniform equals log N minus the entropy of the shares. So a KL of ln 2 means the entropy is log(N/2). The reweighted vote is exactly as spread out as an equal vote among half the group. Every update, whatever the rewards, behaves as if it trained evenly on the best 32 of 64 attempts, softly.

N = 64, KL = ln 2  →  entropy = ln 64 − ln 2 = ln 32  →  effective vote ≈ 32 attempts

Two more details complete the estimator. First, the advantage of attempt n divides its exponential by the average exponential of the other attempts, a leave-one-out baseline, with a small ε for safety. Second, the paper subtracts the group's best reward inside every exponential before dividing. This changes nothing mathematically but avoids overflow.

An
The advantage given to every token of attempt n.
Ẑ−n
The average exponential of the other attempts in the group: the baseline, computed without attempt n itself.

Finally, the paper points out that this estimator ignores the reward's units. Multiply every reward by a positive number, or add a constant, and the advantages come out the same, because β simply rescales to hit the same KL. That is why a reward of "1/runtime" and a reward of "1/bound" need no hand-tuned scaling.

Two groups: in group A one attempt is far better than the rest; in group B all attempts are close. Under the KL budget, which group gets the larger β?

Chapter 6

PUCT picks where to start

Score every saved solution by the best thing ever grown from it, plus a bonus for being tried rarely, and start the next attempts from the winner

We have filled the train blank. Now the reuse blank. Each training step, the method must choose 8 starting states from its archive of past solutions. Each chosen start gets a group of 64 attempts. Choose badly and the 512 attempts either repeat the same idea or wander among weak solutions.

This is the old tension between exploitation (build on what works) and exploration (try what has been tried less). AlphaZero faced it when picking moves in a game tree, and solved it with a rule called PUCT. The paper adapts that rule to an archive of solutions.

score(s)
How attractive state s is as the next starting point. The top scorers are expanded.
Q(s)
The best reward among the children ever grown from s. Before s has been expanded, its own reward R(s).
c
The exploration coefficient. The paper uses c = 1.0 everywhere.
scale
The reward range in the archive, Rmax − Rmin, so the bonus is in the same units as Q.
P(s)
A prior from rank: the best state gets the largest share, falling linearly to the worst. A fast kernel is more likely to seed a faster one.
T
The total number of expansions so far. The bonus grows slowly as the run goes on.
n(s)
How many times s or any of its descendants has been expanded. Visits flow up to all ancestors.

Run PUCT on a small archive

Each dot is a saved solution, placed by its reward (right is better) and its depth in the family tree. The warm ring is the state PUCT picks next. Press Expand to grow two children from it. Move c to 0 and watch it get greedy.

1.0

The scoring rule, the rank prior, Q as the best child, visits flowing to every ancestor and "keep the top 2 children per expansion" follow App. A.2. The rewards are a toy: five seed solutions each hide a ceiling, and children climb part of the way toward their parent's ceiling, plus noise. Averaged over 200 random versions of this toy, the best reward after 30 expansions is about 1.0 with c = 1 and about 0.55 with c = 0. The real run picks 8 starts per step and blocks a chosen state's whole lineage from the rest of that batch.

Two choices make this rule fit discovery. First, Q is the maximum child reward, not the mean as in AlphaZero. A state that once produced a record is worth revisiting, even if most of its children were poor. That is the same "only the best counts" logic as the entropic objective, applied to search.

Second, visits flow up to every ancestor. If you expand a grandchild, the grandparent's bonus shrinks too. So one productive family cannot hog the budget by spreading its expansions over many members. The paper adds one more diversity rule: within one step's batch of 8 starts, once a state is chosen, its ancestors and descendants are blocked.

The archive itself stays bounded. After each expansion, the best 2 of the 64 children are inserted. Then the archive keeps only the 1,000 highest-reward states, plus the initial seed states, which are never dropped.

Why not ε-greedy? The paper tests the simplest rule too: start from the best state, except a random one 10% of the time. On the kernel task it does reasonably well, 1,329 µs, helped by an early lucky kernel. The authors add that in early experiments on other problems, a lack of exploration hurt more than it does on kernels. That is a claim we cannot check from the tables.
How does TTT-Discover's PUCT differ from AlphaZero's in what Q measures?

Chapter 7

One run, with sizes and cost

Trace one training step from the archive to the weight update, and add up what fifty steps cost

Now put the pieces together and attach the real numbers. The paper runs the same recipe, with the same settings, on every problem. Only the description, the evaluator and the KL coefficient change.

One step, stage by stage

Press Step to send one training step through the pipeline. Each stage lights up with what flows through it and its size. The counter adds up attempts and tokens over the run.

Sizes from Section 3.3, Table 9 and App. A: gpt-oss-120b with a rank-32 LoRA, 8 groups of 64 rollouts per step, 50 steps, temperature 1.0, a 32,768-token context, Adam at a learning rate of 4 × 10−5, one gradient step per batch, PUCT with c = 1.0, archive of the top 1,000 states. The token totals assume the paper's own averages of 3,000 prompt tokens and 16,000 sampled tokens per rollout.

Read the pipeline from the top. These are the stages of one training step.

  1. Pick 8 starts. PUCT scores the archive and picks 8 states, blocking lineages so they differ.
  2. Build 8 prompts. Each prompt holds the problem description, the start state and its context. The paper assumes about 3,000 tokens on average.
  3. Sample 512 rollouts. 64 per prompt, at temperature 1.0, from gpt-oss-120b plus the current LoRA, on Tinker's sampling servers. Reasoning effort is set to high.
  4. Cap the thinking. Prompt plus thinking may use at most 26,000 tokens. If the model is still thinking, the system forces in the text "... okay, I am out of thinking tokens. I need to send my final message now." That leaves room for the final code within the 32,768-token context.
  5. Evaluate. Parse the code; for math, also run it. Check validity. Time kernels on H100s through Modal, run contest programs on local tests, score denoisers on a training dataset. Invalid or late gives 0.
  6. Compute advantages. For each group of 64, solve for β under the KL budget and compute the leave-one-out entropic advantages.
  7. Update the LoRA once. One Adam step on the whole batch of 512, with an importance-sampling correction for the small mismatch between the sampler's and the trainer's probabilities, and the KL penalty to the original model. No extra off-policy steps.
  8. Update the archive. Insert the top 2 children of each start; keep the best 1,000 states.

Why a LoRA and not the full model? A rank-32 adapter is small, so each step is cheap, and the base model's knowledge stays intact. The KL penalty adds a second guard: it keeps the adapted model's choices close to the original model's.

What it costs

The paper prices a run at about $500 on Tinker. Its assumption is 3,000 prompt tokens and 16,000 sampled tokens per rollout. That gives a simple count, which is our arithmetic, not the paper's:

50 steps × 512 rollouts = 25,600 rollouts  ·  25,600 × (3,000 + 16,000) ≈ 486 million tokens  ·  $500 / 486 M ≈ $1 per million tokens, all-in

That figure covers sampling and training on Tinker. It does not include the evaluators. Timing kernels needs real GPUs, which the paper rents on Modal; math code runs on CPUs with 2 cores and 1 GB each (Appendix B). The paper does not price those parts.

Compare this with the frontier-model search systems the paper beats. AlphaEvolve used Gemini 2.0 Pro and Flash. ShinkaEvolve and ALE-Agent used ensembles of GPT-5, Gemini 2.5 Pro, Claude Sonnet 4 and others. TTT-Discover uses one open model you can download, and its code is public. That is a real practical difference, separate from the question of which method is better at equal footing.

In one TTT-Discover training step, what is updated, and how often?

Chapter 8

The results, read fairly

Walk through every problem the paper attempted, and sort the fair comparisons from the ones that differ in model or budget

The paper says it reports every problem it attempted. That is worth a lot: we see the misses as well as the records. Before reading the numbers, sort the baselines into two kinds.

Same model, same budget

fair comparisons

Best-of-25,600 and OpenEvolve (an open version of AlphaEvolve) use gpt-oss-120b with the same 25,600 attempts and the same context limit. These isolate the method. One caveat: OpenEvolve's prompts grow long, and many of its rollouts were cut off by the 32,768-token limit. The authors kept its prompts unchanged.

Different model or budget

records, not controlled tests

AlphaEvolve, ShinkaEvolve, ALE-Agent and ThetaEvolve use other models, often frontier ones, and their own budgets. Beating them sets a new record. It does not by itself show the method is better, except where the paper matches the setup, as it does for ThetaEvolve with Qwen3-8B.

Every problem attempted

Pick a domain, then a task. Bars are sorted best first. A teal tag marks the same-model, same-budget baselines.

Values from Tables 2 to 7. Bars use a scale that starts below the worst value shown, so tiny gaps (the math bounds differ in the fifth decimal) are visible; never compare bar lengths across tasks. TriMul B200 and MI300X, and all MLA values, are means of 10 trials on a GPUMode-replicated setup, not the official leaderboard. MLA shows instance 1 of 3; the other two instances tell the same story.

Mathematics: two records, one tie, one miss

On Erdős' minimum overlap problem the upper bound falls from AlphaEvolve's 0.380924 to 0.380876. The construction is a 600-piece step function, and unlike the earlier records it is not symmetric. The human record by Haugland used 51 pieces; AlphaEvolve's used 95. Surprisingly, plain best-of-25,600 also beat AlphaEvolve here, with 0.380906.

On the first autocorrelation inequality the bound falls to 1.50287 in Table 2 (the text says 1.50286), with a 30,000-piece step function built from scratch. The previous record, 1.50314, came from ThetaEvolve refining AlphaEvolve's construction. The model got there in stages: Adam on a softmax parameterization to about 1.510, linear programming to about 1.504, and finally heuristics that focus only on the nearly tight constraints. The authors say they never intervened.

On the second autocorrelation inequality there is no discovery. TTT-Discover certifies 0.9591; AlphaEvolve V2 holds 0.9610. On circle packing, TTT-Discover with the small Qwen3-8B matches the best known values for 26 and 32 circles and improves neither.

Against ThetaEvolve, the closest concurrent work, the paper runs a matched test. ThetaEvolve used DeepSeek's R1-Qwen3-8B for 65 steps of 512. TTT-Discover used the original Qwen3-8B, reported to be weaker, for 50 steps of 512. It still certifies tighter bounds on both autocorrelation inequalities: 1.50525 against 1.50681, and 0.9472 against 0.9468.

Kernels: big wins on TriMul, a tie on MLA

TriMul is the triangular matrix multiplication at the heart of AlphaFold's architecture. The model was trained with H100 timings only, yet its kernels set records on all four GPUs. On H100 it takes 1,161 µs against 1,371. On A100, 2,198 against 4,532. On B200, 914 against 1,039, and on AMD's MI300X, 1,556 against 2,516. The A100 kernel takes 51% less time than the best human kernel.

The paper also says the improvement over the best human is above 15% on every GPU. Our check: on B200 the human kernel takes 13.6% longer than TTT-Discover's (1,038.9 against 914.2 µs), so that claim does not hold for B200 as stated. The record itself does.

The GPUMode organizers reviewed the kernels. The model found that the problem is limited by memory traffic from the many element-wise operations. So it fuses the input LayerNorm, the gating sigmoid and multiply, and the output LayerNorm and gating, and hands the big matrix multiply to cuBLAS in FP16. The organizers note that FP16 activations fit the contest's tolerances but might cause numerical trouble in full workloads.

On MLA decode (DeepSeek's attention for inference, on MI300X) TTT-Discover lands within the noise of the top human kernels on all three instances, but never better with statistical significance. The paper says so plainly. Its best MLA kernels also lean on a torch.compile configuration rather than custom Triton code.

Contests: first place on two past AtCoder contests

AtCoder Heuristic Contests are optimization contests with hundreds of entrants. On ahc039 (a geometry problem: draw a net that captures fish), TTT-Discover starts from the same ALE-Agent program ShinkaEvolve started from, a 5th-place solution. It reaches 567,062, just above the human winner's 566,997. ShinkaEvolve reached 558,026, second place, using frontier models. On ahc058 (scheduling upgrades), it starts from scratch and scores 848,414,228, above every human entry and just above ALE-Agent's 848,373,282. These are past contests, submitted afterwards to the official scorer.

Biology: a better denoiser on a benchmark

Single-cell RNA sequencing counts which genes each cell uses, but the counts are noisy. On the OpenProblems denoising benchmark, TTT-Discover starts from the MAGIC code and adds gene-adaptive transforms, a low-rank SVD refinement and log-space polishing. It trains on the Pancreas dataset and is tested on two held-out datasets: score 0.71 against MAGIC's 0.64 on PBMC, and 0.73 against 0.64 on Tabula. OpenEvolve, with the same model and budget, is close behind at 0.70 and 0.71. The paper's own disclaimer applies: a benchmark score is not biological validity, and the reviewing biologist asks for tests on downstream tasks.

Which comparison best isolates the effect of TTT-Discover's method, holding everything else fixed?

Chapter 9

Which piece matters

Remove one part at a time on the kernel task and see how far the best kernel falls

The method has two parts, the training objective and the reuse rule. The paper removes or swaps each one on the TriMul H100 task, with the same budget of 512 attempts per step for 50 steps. Every run is timed by the paper's own evaluator, so the numbers are comparable with each other (but not exactly with the leaderboard's 1,161 µs).

Take the method apart

Pick a variant. Its curve is the best kernel found up to each step, with the full method in faint teal for reference. The bar on the right is the final best runtime. The yellow line is the best human kernel.

Final runtimes from Table 8. Curves are traced by eye from Figure 4 (left panel, "max reward up to step") and converted to runtime. The conversion is our reading: the figure's reward axis matches 3,016 divided by the runtime in microseconds, which puts the best human's 1,371 µs on the figure's "previous SOTA" line at 2.2 and every Table 8 runtime on its curve's end point. Figure 4's caption says N = 256,000 for best-of-N; with 50 × 512 it is 25,600, a typo.

Read the variants in pairs. The full method reaches 1,203 µs, below the best human's 1,371. It is the only variant that beats the human record.

  1. Constant β = 2 instead of adaptive: 1,484 µs. It tracks the full method early, then flattens. Late gains are small, so a fixed β leaves the advantages too weak to keep learning.
  2. Mean reward instead of entropic: 1,986 µs. Slower progress throughout.
  3. No training, only PUCT reuse with the frozen model: 2,061 µs. Both the average and the best stagnate. This is the frozen-search version of the method, the one the hero calls Search.
  4. ε-greedy instead of PUCT: 1,329 µs. Close behind, with help from an early lucky kernel.
  5. No reuse: 5,274 µs. Learning alone, always starting from scratch, barely moves.
  6. Naive RL (mean reward, no reuse): 5,329 µs. Best-of-N: 5,352 µs. Almost identical.

Two lessons stand out. Learning needs reuse: without a way to build on earlier kernels, the gradient steps add almost nothing. And reuse needs learning aimed at the max: the frozen model with the same reuse rule plateaus at 2,061 µs, while the same rule plus entropic training reaches 1,203.

Now go back to the hero and play it again with this in mind. Sample is the best-of-N row. Search is the No-TTT row: same reuse rule, frozen model. Learn is the full method. Watch the small chart of the average: TTT-Discover's average attempt improves too, but even at step 50 it is far below its best kernel. The method never needed a good average. It needed one great kernel.

The No-reuse variant trains with the full adaptive entropic objective but always starts from the empty state. What did it reach, and what does that show?

Chapter 10

Connections

Lock in the cheat sheet, run the core in a few lines of Python, and place TTT-Discover among its neighbours

You can now read this paper and defend each of its choices. Why a discovery is judged by one number. Why a frozen model's reach never grows, however clever the prompts. Why the average reward is the wrong target, and how the entropic weights aim at the best. Why β is solved for instead of tuned. Why PUCT keeps the best child, not the mean. Let's lock it in.

The one-paragraph summary

Discovery problems ask for a single solution that beats the state of the art, scored by a continuous, checkable reward. Search methods such as AlphaEvolve prompt a frozen LLM many times and reuse its best attempts, so the prompts improve but the model does not.

TTT-Discover runs reinforcement learning on the one test problem. Each of 50 steps, PUCT picks 8 starting solutions from an archive; the model writes 64 attempts from each; an evaluator scores them; and a rank-32 LoRA on gpt-oss-120b takes one gradient step. The objective is entropic: each attempt is weighted by an exponential of its reward, with the sharpness β chosen per group so the weights stay within a KL budget of ln 2. PUCT scores each saved solution by its best child plus an exploration bonus.

It uses one open model and about $500 of compute per run. It sets new records on Erdős' minimum overlap problem, the first autocorrelation inequality, the TriMul kernel on four GPUs, two past AtCoder contests and a denoising benchmark. It ties on circle packing and MLA decode and misses on the second autocorrelation inequality. Ablations on the kernel task show that both parts, the entropic training and the reuse, are needed.

The numbers that matter

QuantityValueSource
Modelgpt-oss-120b, reasoning effort high; LoRA rank 32Sec. 3.3, Table 9
Budget per run50 steps × 512 rollouts (8 groups × 64) = 25,600Sec. 3.3, 4
Context32,768 tokens; prompt + thinking ≤ 26,000Sec. 3.3
OptimizerAdam, lr 4 × 10−5, one step per batch; KL λ = 0.1 (0.01 for AtCoder)Table 9, App. A
Objectiveentropic, adaptive β per start state, KL budget γ = ln 2Sec. 3.2, App. A.1
ReusePUCT, c = 1.0, Q = best child, top-2 children kept, archive of 1,000App. A.2
Costabout $500 per run on Tinker (3k prompt + 16k sampled tokens per rollout)Sec. 3.3
Erdős upper bound0.380924 → 0.380876 (600 pieces)Table 2
Autocorrelation 11.50314 → 1.50287 (30,000 pieces)Table 2
Autocorrelation 20.9591, below AlphaEvolve V2's 0.9610 (no discovery)Table 2
TriMul H1001,161 µs vs best human 1,371; best-of-25,600 5,390Table 4
TriMul A1002,198 µs vs 4,532 (trained on H100 timings only)Table 4
AtCoder ahc039 / ahc058567,062 / 848,414,228, both above the human winnersTable 6
Denoising, PBMC / Tabula0.71 / 0.73 vs MAGIC 0.64 / 0.64Table 7
Ablation, TriMul H100full 1,203; no TTT 2,061; no reuse 5,274; best-of-N 5,352 µsTable 8

The cheat sheet

The core, as code

The sketch below is the whole method in miniature, and it runs as written with NumPy. The "LLM" is a Gaussian step with a learnable mean, standing in for the LoRA. The reward has a decoy peak near −1 and the real one at 3. It keeps the paper's shape: 50 steps of 8 groups of 64, PUCT over an archive of 1,000 with the top 2 children kept, and adaptive entropic advantages.

pythonimport numpy as np

def entropic_advantages(r, gamma=np.log(2), eps=1e-8):
    """Leave-one-out entropic advantages for one group (App. A.1)."""
    r = np.asarray(r, float); N = len(r)
    z = (r - r.mean()) / (r.std() + 1e-12)     # shift/scale do not change the answer
    def kl(beta):                                # KL(q_beta || uniform) on the batch
        q = np.exp(beta * (z - z.max())); q /= q.sum()
        return float(np.sum(q * np.log(N * q + 1e-300)))
    lo, hi = 0.0, 1.0
    while kl(hi) < gamma and hi < 1e6: hi *= 2   # grow until over budget
    for _ in range(60):                          # bisection: KL(beta) = gamma
        mid = (lo + hi) / 2
        lo, hi = (mid, hi) if kl(mid) < gamma else (lo, mid)
    e = np.exp(lo * (z - z.max()))
    Z_loo = (e.sum() - e) / (N - 1)              # average of the OTHER rollouts
    return e / (Z_loo + eps) - 1.0

def puct_pick(archive, T, c=1.0):
    R = np.array([s["R"] for s in archive])
    rank = np.argsort(np.argsort(-R))            # 0 = best
    P = (len(R) - rank) / np.sum(len(R) - rank)  # linear rank prior
    Q = np.array([s["m"] if s["n"] > 0 else s["R"] for s in archive])
    n = np.array([s["n"] for s in archive])
    scale = R.max() - R.min() + 1e-12
    return int(np.argmax(Q + c * scale * P * np.sqrt(1 + T) / (1 + n)))

reward = lambda x: np.exp(-(x - 3) ** 2) + 0.3 * np.exp(-4 * (x + 1) ** 2)
rng = np.random.default_rng(0)
mu, lr = 0.0, 0.05                               # mu stands in for the LoRA weights
archive = [{"x": 0.0, "R": reward(0.0), "m": 0.0, "n": 0}]
best = (archive[0]["R"], 0.0)
for step in range(50):                            # 50 training steps
    for g in range(8):                             # 8 start states per step
        s = archive[puct_pick(archive, T=step * 8 + g)]
        a = rng.normal(mu, 1.0, size=64)            # 64 attempts from one start
        xs = s["x"] + a; rs = reward(xs)
        A = entropic_advantages(rs)
        mu += lr * np.mean(A * (a - mu))           # REINFORCE step with entropic advantages
        s["m"] = max(s["m"], rs.max()); s["n"] += 1  # paper also credits ancestors
        for j in np.argsort(-rs)[:2]:             # keep the top 2 children
            archive.append({"x": xs[j], "R": rs[j], "m": 0.0, "n": 0})
        archive = sorted(archive, key=lambda d: -d["R"])[:1000]
        if rs.max() > best[0]: best = (rs.max(), xs[rs.argmax()])
print(f"best reward {best[0]:.4f} at x = {best[1]:.3f}")   # best reward 1.0000 at x = 3.000

Three things to try. Replace entropic_advantages(rs) with rs - rs.mean(), the mean-reward version. Set c=0.0 to make PUCT greedy. Change the step spread from 1.0 to 0.5: with that narrow reach, our runs stall on the decoy peak at −1, the toy version of a short horizon.

Limits the paper names, and ones we add

Where it sits in the field

Keep going

The takeaway. Search with a frozen model improves the prompt; learning improves the model. For a problem beyond what the model already knows, the attempts it makes are the best training data there is, because they come from exactly the right distribution. TTT-Discover trains on them, and aims every part of the loop at the maximum: weights that favour the best attempts, a β that keeps those weights in check, and a reuse rule that remembers the best child. The policy is the tool; the record is the product.

Now press Present or Teach and explain, out loud and from memory, why the average reward is the wrong target for discovery and how the entropic weights fix it. If you can, you own this paper. Then go back to the kernel contest and spend 25,600 attempts one more time.

Based on "Learning to Discover at Test Time" by Mert Yuksekgonul, Daniel Koceja, Xinhao Li, Federico Bianchi, Jed McCaleb, Xiaolong Wang, Jan Kautz, Yejin Choi, James Zou, Carlos Guestrin and Yu Sun (Stanford, NVIDIA, Astera Institute, UC San Diego, Together AI; 2026)
Read the original paper · Back to Veanors