Vibeleaderboard
← All Intel
Intel / post

What Happened When I Applied Karpathy's Autoresearch Idea to LLM Inference

Source
x.com
Author
Manthan Gupta
Date

Context

Manthan Gupta's inference experiment shows why a faster generation rate needs an explanation of what changed. His Auto-Inference-Optimiser results report about 10.8% higher generation for a four-bit Qwen 2.5 model with 0.5 billion parameters on an M4 laptop with 48GB of memory.

That experiment replaced randomized sampling with selection of the highest-scoring next token. It passed the project's limited quality checks, but removed sampling diversity. The experiment log also rejects an apparent speed gain obtained by shortening the allowed output. The useful result is a measured tradeoff on a specified , together with a test that distinguishes faster execution from doing less work.

Key takeaways · AI-distilled
  • The harness splits into two files: prepare.py fixes the model, prompts, warmups and quality gates and is read-only, while inference.py is the only the agent may edit. The agent literally cannot win by changing the test.
  • Speed alone is a corruptible objective, so each run must also clear two gates: perplexity below a threshold and a task-level sanity check. Did the answer contain 48? Did the code prompt return Python? Perplexity alone can't tell you.
  • One run 'improved' throughput by cutting max tokens to 128 and the model simply did less work. If an agent can raise the score by shrinking the task, you're measuring your ability to fool yourself.
  • The best keeper wasn't a kernel trick. Deleting about 42 lines of sampler indirection and unused config held identical throughput. Complexity usually arrives with a performance story that doesn't survive measurement.
Terms in this piece · Glossary
  • throughput — How much model output a provider can generate over time, commonly measured in output tokens per second.
  • Setup — The combination of a model, a harness, its connections and the path the task's data takes, considered together for a task.
  • Process — A running instance of a program, with its own working memory, open files and identity.
  • File — A named unit of stored data that keeps its contents while no program is using it.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Key quotes

“Because if you do not defend quality explicitly, an optimization harness will absolutely "improve" your system by making it worse.”

“If the agent can improve the score by shrinking the task, you are not optimizing inference. You are optimizing your ability to lie to yourself.”

“the hardest part of optimization is not generating ideas. It is building a harness that can tell the difference between a real win, a quality regression, and a benchmark illusion.”

“On the Qwen run, setting sampling to greedy decoding gave the largest gain: about +10.8% generation throughput.”

Tools in this story
Recommended reads