AI Trends

Singularity-Bench: Claude's Self-Written Inference Engine Cuts P90 Time to First Token to 0.478 Seconds

36Kr · AIUpdated Nov 20 08:31

AI summary

Singularity-Bench shows that an inference engine written by Claude Opus 5.5 using Claude Code reduced P90 time to first token from SGLang's 12.029 seconds to 0.478 seconds on the same hardware and model with 16 concurrent sessions. The two had similar cache hit rates and generation speeds, but Claude's engine processed 19% more uncached tokens per GPU per second and completed 983 requests within the same time limit, compared with 705 for the control. When the six tasks were weighted equally, the combination scored 1.252 with five wins and one tie, exceeding the human baseline score of 1.

Why read this

AI score 70

The study compares an AI-developed system with mature baselines using real-world coding sessions and standardized hardware, providing a concrete benchmark for assessing agents' engineering optimization capabilities.

Topics

Tags

Body · AI translation

After revising the code according to its suggestions, you reran the login test. Another red error message appeared in the terminal—the exact same error as before.

Fixing a bug often takes several rounds of this back-and-forth.

Recently, someone tested this using real coding sessions, and Claude cut this idle waiting time from about 12 seconds to half a second.

On November 12, researchers from Carnegie Mellon University, NVIDIA, and other institutions submitted a preprint titled “Singularity-Bench: Can Agents Build Agents?”

In one task, the researchers gave Claude Opus 5.5 a basic server codebase, four GB300 GPUs, and 12 hours.

During the task, the development environment restricted internet access. Claude had to use Claude Code to write an inference engine responsible for receiving user requests, scheduling GPUs to run the model, and returning the generated responses.

After the engine was finished, the researchers did not merely inspect the code; they tested its performance directly using real coding sessions.

They had the two engines run the same model on four GB300 GPUs and replayed the same batch of real coding sessions at 16-way concurrency.

The metric was called P90 time to first token:

Sort the waiting times from when each request is sent until the model begins responding; the time at the 90th percentile is the P90. In other words, 90% of requests begin receiving a response within that time.

The result: the mature SGLang engine (v0.5.20) took about 12 seconds, while Claude’s engine took just 0.48 seconds.

Under the same hardware and model conditions, Claude’s custom inference engine achieved a P90 time to first token of 0.478 seconds, compared with 12.029 seconds for SGLang.

In 12 seconds, you might already have switched back to the editor and scanned several lines of code around the error. In half a second? You have barely pressed Enter before the first character of the AI’s response appears in the chat box.

Once generation began, the two engines ran at nearly the same speed: by the median, Claude’s engine generated 124.2 tokens per second, while SGLang generated 125.0.

So how exactly did Claude eliminate those 11.5 seconds before the AI began speaking?

You had already pasted the source code and error messages and tried several versions of the solution. This time, you added just one sentence: “Move the login button a little to the right.”

In the coding sessions replayed for the paper, chat histories from previous turns were also sent to the server. With 16 concurrent sessions, the median input size per request was 89,000 tokens.

The model must process the input before it can begin responding. This step is called “prefill.”

If the beginning of a new request is identical to the previous one, the engine can retrieve previously computed results and continue processing only the newly added content. This is called “prefix caching.”

Here, the “computed results” are the computational records left after the model reads that earlier context. The model used in this test leaves two sets of records.

One preserves information from the preceding context so the model can refer back to it; the other is like a running balance in a ledger, updated each time the model reads a little more.

Claude’s engine stores both sets of records corresponding to the same preceding context. The next time it encounters an identical beginning, the engine can resume reading from the end of that context and compute only the newly added content.

SGLang also used prefix caching, and both engines achieved cache hit rates of around 96%.

When 16 requests arrive simultaneously, the content that misses the cache still has to be processed by the GPUs.

Performance comparison between Claude’s custom inference engine and SGLang. The two have similar cache hit rates and generation speeds, but Claude’s engine has a markedly lower P90 time to first token.

Meanwhile, you are standing at the back holding just a bottle of mineral water—in other words, asking a one-sentence follow-up in an existing conversation, with 96% of the preceding context already cached.

Rigidly enforcing “first come, first served” under concurrent inference is like making someone buying a single bottle of water wait behind a cart piled with holiday groceries.

Claude therefore established a queuing rule for the inference engine:

Process whichever request has the least computation remaining first.

When the engine encounters a huge new request containing tens of thousands of tokens, it divides it into smaller chunks and processes them in batches, never allowing one large task to block the entire lane.

This gives the follow-up you added to an existing conversation a chance to bypass the wait behind long requests and be processed first.

During generation, the engine also layers on “speculative decoding”:

A lightweight prediction layer built into the model first guesses a token, which the main model then verifies. If the guess is correct, the predicted result is accepted directly; if it is wrong, the prediction is discarded and generation continues using the main model’s result.

At the same time, the engine batches previously scattered GPU operations together, reducing unnecessary scheduling and data transfers.

Even with SGLang also using prefix caching and speculative decoding, Claude’s engine still had an advantage in input processing and request scheduling: averaged per GPU per second, it processed 19% more uncached tokens.

The horizontal axis shows P90 time to first token, while the vertical axis shows the number of uncached tokens processed per GPU-second. Claude’s custom engine both reduced the wait for the first token and improved the efficiency of uncached input processing.

Within the same replay time limit, SGLang completed 705 requests, while Claude’s engine completed 983—nearly 40% more.

The completed requests were then converted into “simulated revenue” using preset input and output prices. The Claude engine’s output per GPU-hour rose from SGLang’s $8.18 to $11.52, an increase of 40.8%.

Of course, in real-world work, only delivered results count: running at blazing speed while spouting nonsense is merely a high-speed crash.

When grading the submissions, the researchers imposed two strict thresholds: first, under concurrent load, the system had to generate responses of the required length in full; second, it had to pass the accuracy checks on hidden tests.

Of the 11 proprietary AI-built engines tested, only five ultimately cleared both hurdles. The other six either dropped text and cut sentences short midway or suffered a collapse in accuracy, and were immediately assigned a score of zero under the rules.

11 AI Teams Build Infrastructure

Claude: Five Wins and One Draw

Building an inference engine from scratch was only one of the six challenges in Singularity-Bench.

The research team divided the core hard work of building AI into six independent closed-book exams: three focused on training—from-scratch pretraining, data selection for mid-training, and reinforcement-learning-based post-training for coding—while the other three covered infrastructure: inference engines, agent runtime frameworks, and GPU cluster scheduling.

Eleven AI teams, formed by combining seven mainstream models with the Claude Code and Codex runtime frameworks, received starter code while completely offline and had to submit their work before a countdown expired. All competed on identical hardware against mature solutions refined by humans over many years.

In addition to its decisive win in inference, Claude Opus 5.5 paired with Claude Code also beat the human baseline on four other challenges.

After receiving the pretraining exam (four GB300 GPUs, 12 hours), Claude did not rush to begin training. Instead, it spent the first 44 minutes testing GPU performance and then determined the model size based on the results. It did not start training until the 44-minute mark.

Ultimately, Claude used only about half the training compute yet achieved a validation-set perplexity of 12.77, outperforming the human baseline of 14.22, which used OLMo 2 1B with Megatron-LM.

For mid-training (four GB300 GPUs, 12 hours), the task shifted to selecting the next batch of “teaching materials” for an existing model, then evaluating the training results using the same set of reinforcement-learning tasks to assess performance in mathematics, coding, and science.

Claude mainly selected data containing complete problem-solving processes and verified answers. Its approach ultimately raised average downstream accuracy from 17.5% with the human-designed PRISM recipe to 31.9%, nearly doubling it.

The agent runtime framework challenge (one GB300 GPU, six hours) was the most dramatic: it tested when the model should call tools and how it should inspect logs after an error, while the human control was none other than the original Claude Code.

Claude effectively performed surgery on itself, raising the average downstream score from 0.438 to 0.468. In the same batch of tests, the new framework fixed one more bug than the original Claude Code.

The cluster scheduling challenge (16 GB300 GPUs, four hours) required 16 GPUs to simultaneously serve requests across 28 models.

Claude found through testing that some engines competed for resources and slowed one another down when sharing GPUs, so it adjusted the scheduling strategy to let them take turns using the GPUs.

In the end, it achieved a combined score of 0.510 across the latency compliance rate and request completion rate, surpassing the 0.460 scored by NVIDIA Dynamo paired with KAI Scheduler.

Able to modify even its own framework and outperform NVIDIA’s solution in the cluster scheduling test, Claude put its engineering capabilities on full display this time.

The only challenge without a clear winner was post-training (four GB300 GPUs, 12 hours).

Claude used reinforcement learning to improve the programming ability of a given model and ultimately achieved a problem-solving rate of 53.3%, compared with 53.9% for the human control solution, Miles. In a problem-by-problem comparison, each side uniquely solved 18 questions, so the paper ruled it a draw.

With all six results weighted equally and the human baseline set at 1 point, Opus 5.5 paired with Claude Code earned 1.252 points with “five wins and one draw,” becoming the only combination to surpass the human baseline. GPT-6.1 Sol paired with Codex placed second with 0.969 points, while the remaining 10 groups averaged only 0.58 points.

The overall rankings also revealed another point: the model’s brain determines the upper limit of its capabilities, while the runtime framework determines how much of that ability it can actually realize.

The same open-source model scored 0.228 with Codex, but rose to 0.657 when paired with Claude Code—nearly three times its original score. Another model showed precisely the opposite pattern, scoring 0.698 with Codex but falling to 0.520 with Claude Code.

This shows that having a sufficiently powerful model is not enough: choosing the wrong framework can still lead to poor performance.

After taking first place overall, how much did Claude spend on API calls alone?

During the development phase alone, Opus 5.5 spent $425.41 on API calls, more than the previous-generation Opus 5’s $328.19 and roughly five times the $84.52 spent by second-place GPT-6.1 Sol. GPU and downstream evaluation costs were additional.

The Next Challenge

Post-training optimized a given model, while the inference engine served a different off-the-shelf model. For each challenge, humans predetermined the starting code, the metric to optimize, and the allotted time and compute.

The paper’s authors also acknowledge that truly testing recursive self-improvement (RSI) will require more time and compute.

Building one component well and improving an entire production line on one’s own are completely different things.

After identifying a bottleneck, the system must also decide where to intervene, then reintegrate the improvement into the full R&D process for validation.

Ultimately, the evaluation must consider not only how much compute and time were saved, but also whether the next-generation model produced through training genuinely became stronger.

Going a step further, the next-generation model must be able to take over the work of its predecessor, continue identifying problems and improving the process, and deliver new results that withstand repeated testing.

References:

This article originally appeared on the WeChat public account “AI Era” (ID: AI_era). Author: ASI Apocalypse; editor: Yuanyu. Republished by 36Kr with permission.

Source

36Kr · AI