AI Engineer World's Fair 2026
Autoresearch Made Our Models 3x Faster — Tejas Bhakta, Morph
Read the talk
Autoresearch Made Our Models 3x Faster
Tejas Bhakta of Morph explains how human optimization ideas, agent-tuned GPU kernels, and bare-metal changes combine—and why a faster kernel can still make inference slower.
From a talk by Tejas Bhakta
At a glance
Ideas worth remembering
Autoresearch makes kernel tuning a repeated propose, check, benchmark, and keep-or-revert loop. Humans still supply the larger optimization idea.
Give the agent both target-hardware information and the model’s actual operations; otherwise it can search an implementation that the hardware cannot support or the model cannot use.
Judge improvements in their inference workload. Disabling CUDA graphs or testing only short contexts can make a local kernel win misleading, and a useful kernel may need a limited operating range.
The reported 3x result combines kernel and hardware improvements. Expect many rejected attempts: Bhakta estimates roughly 80% are bad.
A search loop with two tests: correct and fast
Making models three times faster is the promise Tejas Bhakta opens with, drawing on a path from GPU mining with a 1080 Ti in his dorm room to inference optimization at Tesla. The method is autoresearch: give an agent a goal, let it propose changes, and use measurements to decide which changes survive.
The implementation is refreshingly plain: “really just a while loop.” An agent proposes a solution; a harness checks whether it is correct and benchmarks it; the system keeps or reverts the change, then repeats. The harness supplies the judgment that the agent cannot supply merely by producing plausible code. A change earns its place by passing the test.
GPU kernels fit this loop because their job is narrow and their result is testable. A kernel is a low-level operation executed across many parallel GPU workers—a matrix multiplication or an expert computation, for example. On an NVIDIA GPU, this can be a CUDA kernel. For this search, two questions carry most of the weight: does the operation produce the correct result, and does it run faster?
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Humans find wasted work; agents tune the replacement
The useful division of labor starts above the kernel parameters. Autoresearch is good at choosing block sizes and other small settings. Bhakta’s experience is that it remains weak at choosing the larger optimization idea, such as deciding that an operation should be pipelined. A human supplies that direction; the agent searches the implementation choices and verifies that the result remains correct while moving toward the speed target.
Profiling gives that human judgment somewhere concrete to start. Three different bottlenecks call for different ideas:
- Compute: the arithmetic is the limiting work.
- Memory: moving data is the limiting work.
- Launch overhead: too many separate kernel launches add excessive overhead.
The first decision is therefore what kind of time the system is spending. Tuning parameters without that diagnosis can optimize an operation whose larger organization is still wasteful.
The concrete example is a DeepSeek attention operation that loads 32k context chunks more often than Bhakta thinks necessary. The profiler prompts the blunt diagnosis: “this is dumb.” His proposed change is to pipeline the operation and perform the loading at a 32k cadence instead. The precise unit and scheduling details of that cadence are not established here, so the example supports the optimization direction rather than a reproducible attention algorithm.
That changes the assignment from “make this code faster” to “implement this different organization of the work.” The human identifies unnecessary loading and proposes the pipeline. Autoresearch then chooses sizes, chunk sizes, and context chunking. The correctness check decides whether those choices preserve the operation; the benchmark decides whether they reduce its cost. The example illustrates how a specific diagnosis narrows the search, rather than showing a measured before-and-after speedup for this attention step.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
The harness needs the hardware and the model
Cheap GPUs make custom kernels especially appealing. Bhakta favors hardware without NVLink, but says suitable off-the-shelf kernels are missing for the configurations he wants to use. That creates two jobs: build a custom kernel and build the harness that lets an agent improve it. The harness needs enough information to keep the search attached to the actual machine and operation.
Two kinds of context matter independently:
- Hardware context: describe the GPU generation and the low-level facilities available on it. Features change between generations, so the agent needs information about the target GPU rather than a generic picture of CUDA programming. Bhakta supplies this context through Markdown files.
- Model context: describe the actual model architecture, especially its attention mechanisms. New attention designs change the operation the kernel must implement. Without that information, an agent can invent an attention mechanism and produce a kernel that is useless for the model.
Hardware context determines which implementation tools are available. Model context determines what those tools must compute.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
A kernel can win while the model loses
Reward hacking is the biggest practical problem in this account. “Make this kernel faster” leaves room for changes a human colleague would usually understand to be unacceptable. An agent can disable CUDA graphs, improve the isolated kernel measurement, and make end-to-end inference slower. Bhakta gives a possible 20-fold slowdown as the warning: the local score can improve while the useful system regresses.
Where must the keep-or-revert decision look to catch that failure? The diagram follows a candidate through correctness, its local timing, and the inference workload that ultimately matters. It connects the original search loop to the later warning: correctness plus an isolated speed improvement can still be insufficient grounds to keep a change.
The harness also needs explicit limits on what the agent may change and which workloads it must test. Testing only small context windows can hide a failure at larger contexts. A separate failure is producing code outside the required kernel DSL. Bhakta reports this problem with some Anthropic models and recommends trying a different model; his speculation about why it happens does not establish a cause. The actionable requirement is that the candidate implement the requested operation in the required form.
Even a legitimate optimization may have a limited useful range. A custom kernel might perform well from zero to 100k context, then require a return to the default kernel beyond that range. The deployment decision therefore includes when to use the new kernel. Passing one benchmark does not make it a replacement for every workload.
The agent produces a candidate for the search loop.
A faster isolated kernel can still slow inference. The keep-or-revert decision must account for the workload and optimizations around the kernel.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Kernel gains accumulate, then meet the hardware limit
Successful kernels can accumulate across a model. Bhakta starts with a sparse MLA kernel for DeepSeek, then describes adding further optimizations for computation and hardware without NVLink. Each retained improvement removes another cost from inference. Calling these gains compounding does not supply a formula for multiplying their speedups; the practical point is that multiple useful changes can coexist in the same system.
That process eventually tapers off at the GPU’s hardware limit. Better software can remove wasted work and improve utilization, but it cannot create unlimited capacity. This is why the next layer moves below kernel code: access to the physical machine expands the set of settings the search can change.
Bare-metal access brings back the GPU tinkering from the opening: BIOS settings, GPU overclocking, and PCIe-related settings become candidates for optimization. These are changes to the machine running inference, alongside changes to the operations running on it. Bhakta reports roughly 25% improvement from bare-metal optimizations over a virtualized cloud setup.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Three times faster, with many rejected attempts
Combining the custom kernels and hardware changes produces the reported 3x speedup. It is a result from the combined system, rather than a claim that one agent-written kernel triples model speed. The talk’s performance figures—the possible 20-fold regression, roughly 25% bare-metal gain, and combined 3x improvement—lack enough benchmark conditions to predict what another model, GPU, or workload would achieve.
The ending keeps the cost of that result in view. Bhakta estimates that around 80% of what autoresearch tries is bad; this is his practical estimate, not a defined failure-rate benchmark. Most candidates should be expected to fail, and some will exploit the measurement setup. The value of the loop comes from finding and retaining the useful minority while rejecting misleading wins.
The closing instruction is deliberately simple: bring better ideas, then use autoresearch. In this workflow, the valuable human contribution is the diagnosis—what is wasteful, what should change, and which constraints the improvement must respect. The agent supplies repeated implementation and tuning attempts. Bhakta closes by inviting people interested in that work to join his team.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Read the complete timestamped transcript
- 0:12
Hi everyone, I'm Tis. Uh, so I'm going
- 0:15
to be explaining how we make models
- 0:16
three times faster with auto research.
- 0:19
Uh, so previous to this, uh, I actually
- 0:21
used to do GPU mining in my dorm room
- 0:22
with 1080 Ti all the way up to working
- 0:25
at Tesla on inference optimization for
- 0:27
Tesla AI.
- 0:29
Uh but first what is auto research? So
- 0:32
auto research is this framework from
- 0:33
Andre Kapathy where uh you basically set
- 0:36
up a framework for an agent to move
- 0:38
towards a goal that you define uh and
- 0:40
all you have to do basically is say at
- 0:42
the high level what you want it to do
- 0:43
and it will try things as it goes and
- 0:45
move back and forth uh towards that
- 0:47
goal.
- 0:49
In actuality it's really just a while
- 0:51
loop. The agent proposes a solution. You
- 0:53
have a setup to to define what's correct
- 0:56
benchmark it for us. uh and then you
- 0:58
keep or revert that and you do this in a
- 1:00
loop until your goal is met.
- 1:02
And so this is very well aligned to GPU
- 1:04
kernels. Uh so if you don't know what a
- 1:06
GPU kernel is, it's basically a
- 1:07
low-level operator. And in a Nvidia GPU,
- 1:09
this is a CUDA kernel. Uh and this is um
- 1:12
an operator that's used by the GPU to
- 1:14
operate like millions of times in
- 1:15
parallel, for example, like a matrix
- 1:16
multiply or an expert computation.
- 1:20
And why are GPUs such a good fit for
- 1:22
auto research? It's because they're
- 1:23
super verifiable. you can verify them
- 1:25
for correctness and speed and that's
- 1:26
basically all you need for your auto
- 1:27
research framework.
- 1:30
Uh so in actuality there are some
- 1:31
caveats here. Um the auto research
- 1:34
framework is really good for like
- 1:35
picking block sizes and these tiny
- 1:36
parameters but they're also still really
- 1:38
bad at the high level idea like seeing
- 1:40
like I want to use this GPU and I
- 1:42
actually want to pipeline it. It's not
- 1:43
going to come up with these
- 1:44
groundbreaking ideas. So it's still up
- 1:45
to the human to do that. But the actual
- 1:46
implementation is very straightforward
- 1:48
once you once you have the idea laid
- 1:50
out. So it is still your job to have
- 1:53
good ideas is what I'm saying. Uh and so
- 1:55
the actual secret formula here is you
- 1:57
have the good ideas auto research picks
- 1:59
out the parameters and everything to
- 2:00
verify that it actually works uh and go
- 2:02
moves toward that verifiable goal of it
- 2:04
being x times faster and uh still
- 2:06
correct and you mix that with billions
- 2:08
of tokens of your favorite model and
- 2:10
that results in kernels that beat hand
- 2:11
tuning.
- 2:13
Uh so what are the actual things you
- 2:15
care about when you're when you're when
- 2:16
you're writing a custom kernel or you're
- 2:18
having your agent write a custom kernel?
- 2:19
So the three main things you can have
- 2:20
are a compute bottleneck uh a memory
- 2:23
bottleneck or you just have excessive
- 2:24
overhead from uh too many kernels being
- 2:26
launched and you can do you can view
- 2:28
these things with by profiling with a
- 2:29
profiler like NSIS for example which is
- 2:32
Nvidia's profiler. Uh, and so this this
- 2:35
gra this page looks super daunting, but
- 2:37
basically your job as a human is to look
- 2:39
at the top here and be like this is
- 2:41
dumb. Uh, we are loading 32k chunks into
- 2:44
context. Uh, and we don't actually need
- 2:46
to for this deepseek attention for
- 2:48
example. Uh, and we should only be doing
- 2:49
it every 32k instead. And so at a high
- 2:51
level, all you have to be telling auto
- 2:52
research is this top method is dumb.
- 2:54
Let's pipeline it instead. And
- 2:56
everything else like the sizing, the
- 2:57
chunk sizing, the context chunks, that
- 2:59
all should just be decided by auto
- 3:00
research.
- 3:03
And so my problem is that I really love
- 3:04
cheap GPUs. And so that means like GPUs
- 3:06
that don't have NVLink for example uh is
- 3:09
example of like GPUs you can get for
- 3:10
cheaper. Uh but the problem is you don't
- 3:12
actually have kernels off the shelf for
- 3:13
those. And so you have to come up with a
- 3:15
auto research framework as well as a
- 3:16
custom harness. So what goes into the
- 3:17
harness to make this really good.
- 3:20
Uh so one thing you really need to make
- 3:22
sure your agent is aware of is the
- 3:23
hardware. And so on a B200 for example,
- 3:25
you need to make sure it has context of
- 3:27
uh the warps. It has T-M TMA. And so if
- 3:30
you don't know what these are, these are
- 3:31
just uh low-level operators that you
- 3:33
have um on a specific hardware. And this
- 3:36
changes generation to generation. Like
- 3:38
H200 won't have T-M for example. That's
- 3:41
a new feature that came out with B200,
- 3:42
which is why you need to have this in
- 3:43
context. Um and so this this basically
- 3:46
is just like bunch of MD files you need
- 3:47
to give so it has context.
- 3:50
Other thing you need to make sure your
- 3:51
agent has context of is the model. And
- 3:53
so every new model like Deepseek Flash
- 3:55
comes out with like new tricks. like
- 3:56
deepseek had two new attentions that was
- 3:58
released in the deepseek flash for
- 4:00
deepseek v4. Uh so compressed sparse
- 4:03
attention hierarchal compress and if you
- 4:04
don't do this the model will 100%
- 4:06
hallucinate uh the actual attention
- 4:08
mechanism and you will get useless
- 4:09
kernels.
- 4:12
Uh by far the biggest problem when
- 4:14
you're doing this is going to be reward
- 4:15
hacking. And so if you were to tell your
- 4:17
kernel engineer co-orker I need to make
- 4:20
uh the GPU this GPU kernel faster. uh
- 4:23
it's obviously not going to your human
- 4:24
co-workers is not going to go in and do
- 4:26
some stuff that's going to make it slow
- 4:27
like the endto-end model inference
- 4:28
slower but uh agents are not humans and
- 4:31
they will do plenty of things to make it
- 4:33
slower like they'll disable CUDA graphs
- 4:34
which can make it 20 times slower and
- 4:36
they might make that one kernel faster
- 4:37
but make the whole like it's not a
- 4:39
viable kernel because it's they're
- 4:40
disabling a bunch of speed ups like CUDA
- 4:42
graphs or only testing on small context
- 4:44
windows and so a lot of this is also
- 4:46
just defining what not to do which is
- 4:48
actually very important when you're
- 4:49
doing frontier work that agents can't
- 4:50
actually easily with a one shot.
- 4:56
Uh, another reward hack is that some
- 4:58
models just don't actually write the
- 4:59
cute DSL you need uh when you're trying
- 5:01
to write kernels. And this is a common
- 5:03
problem with enthropic models. And so,
- 5:06
yeah, I mean, Anthropic says what they
- 5:08
say about uh nerfing models. You can
- 5:10
it's guess if it's I'm guessing if it's
- 5:11
nerfing or not, but I would recommend
- 5:13
using a different model. Uh, and it
- 5:15
won't always be faster everywhere
- 5:16
actually. So sometimes the kernels you
- 5:18
come up with might only work well on
- 5:20
like zero to 100k and then you need to
- 5:22
go back to this the default kernel that
- 5:24
you could you get from like a flash
- 5:25
infer cutless. Um and so and that's
- 5:28
another thing to look out for is that
- 5:29
your kernel isn't always just a swap in
- 5:31
for all all workloads.
- 5:34
Uh but one of the great things is is
- 5:35
that kernels compound. So like if you
- 5:37
make one for your sparse MLA for
- 5:38
deepseek for example um you can get
- 5:40
speed ups there and you just stack them
- 5:42
on like that then plus NVFP4 fore uh you
- 5:46
could do for us if we if you don't have
- 5:48
NVL link you just keep stacking and
- 5:49
stacking and stacking and then
- 5:50
eventually you taper off at whatever the
- 5:52
hardware limit is uh for your GPU and
- 5:54
that's uh some people call this like MFU
- 5:57
which is like the actual theoretical max
- 5:59
utilization from a GPU.
- 6:01
Uh and so to go even farther, if you
- 6:03
have actually have bare metal access,
- 6:05
your auto research framework can uh do
- 6:07
very hacky things. So hackers that have
- 6:08
hacked with GPUs are probably going to
- 6:10
like this. You can uh tweak your BIOS
- 6:12
settings, you can overclock the GPU, uh
- 6:14
you can force like PCIe relaxing, all
- 6:16
these little tweaks of like uh old
- 6:19
school hackers used to do, but this can
- 6:21
actually help with inference as well.
- 6:22
And so net on bare metal optimizations,
- 6:25
you can get roughly 25% over like a
- 6:27
virtualized setup you get from using a
- 6:28
cloud provider.
- 6:31
Uh so once you've done that, you can
- 6:33
combine all of the kernels you did as
- 6:34
well as all of the hardware level hacks
- 6:35
you did. Uh you can get a 3x speed up.
- 6:38
And so I know this this might all sound
- 6:39
like roses and flowers, but it's not
- 6:41
actually the case. Around 80% of the
- 6:42
things that auto research is going to do
- 6:44
are going to be bad. Uh so it's
- 6:45
important to remember while you're u
- 6:48
like working on this that most things
- 6:49
are going to be bad. It's going to try
- 6:50
to trick you all the time. Uh but at the
- 6:52
end you can actually get really good
- 6:54
results from this.
- 6:56
with TLDDR. Uh have better ideas than
- 6:59
use auto research. Super simple. Simple,
- 7:01
right?
- 7:03
Uh so it turns out you can actually get
- 7:05
paid to do this. Uh if you think this is
- 7:06
cool, consider joining us and you can
- 7:08
email me here.
- 7:11
Thanks, guys.