Google says its Antigravity coding agents, powered by Gemini, can run autonomous codebase optimization on systems where a single test takes hours. In reported results, the agents sped up DeepSeek-V4 TPU kernels by up to 2.69x, found scheduler changes that cut TPU workload interruptions by 55.1% in offline replays, and beat the best known CPU prefetcher designs on a public benchmark.
The slow benchmark problem
Most coding agents assume that checking a candidate solution is quick. Real production systems break that assumption. Benchmarking a TPU kernel suite takes tens of minutes. Measuring a serving engine like vLLM takes nearly 1.5 hours per candidate. Simulating a CPU design across realistic traces can take more than a day. Within a fixed time budget, a standard agent loop gets only a handful of true evaluations.
Hand-built shortcuts don’t scale, since every bottleneck needs its own proxy. Fixed proxies also invite Goodhart’s law: the agent learns to exploit gaps between the proxy and the real benchmark, so the proxy score rises while real performance stalls or drops. Adding more parallel agents doesn’t help either, because they crowd onto the same obvious hotspots.
How the approach works
This style of codebase optimization starts from the idea that a fast stand-in can guide search. The team’s method comes from a paper called DuoDiscover and runs in Antigravity through a /teamwork feature, which Google says will roll out in the next update. Each worker agent explores the codebase on its own, profiles execution and picks a target region with real headroom. It then builds a yardstick, a proxy evaluator that scores edits 20x to 50x faster than the true benchmark. The yardstick only needs to rank edits in the same order as the true evaluation.
Workers hill-climb on the yardstick in seconds, screening out more than 80% of weak edits. Promising results go to a slower loop, where an isolated evaluator runs the full test suite and the real benchmark. A statistical check compares the two sets of scores and rebuilds the yardstick if it drifts.
TPU kernel results
Google tested five DeepSeek-V4 Pallas TPU kernels, four of them in the open-source vLLM TPU-Inference repository. The baseline was the existing reference kernel authored by performance engineers. Across all five, the agents reached speedups of 1.50x to 2.69x while passing every correctness test.
The team ran two models. Gemini Carbon, its strongest long-horizon reasoning model, reached a 1.97x geometric mean. Gemini Hydrogen, the faster and cheaper model, reached 2.10x. Hydrogen costs $1.50 per million uncached input tokens and $7.50 per million output tokens, against $4.00 and $20.00 for Carbon. At a comparable total spend, Hydrogen ran nearly five times as many calls, 163,797 against 33,195.
Borg scheduler results
The same workflow was applied to Borg, Google’s cluster manager. These numbers come from offline replays of production traces, and the changes are under review with the Borg team. They are not deployed.
- A redesigned TPU placement scoring order across 15 C++ files cut interruptions per chip-hour by 55.1%.
- Changes across 24 files cut CPU usage in the TPU colocation subsystem by 71.3% and raised scheduling throughput by 27.1%, with no change to placement decisions.
- Changes across 26 files in the core host scheduler raised throughput by 37.3% with zero infeasible placements.
CPU prefetcher design
On the DPC4 data-prefetcher benchmark, Antigravity with Gemini Carbon reached a +5.0% geometric-mean speedup. The best human entry, BertiGO, scored +3.5%, and the earlier AlphaEvolve-based ArchAgent v2 scored +3.8%. ArchAgent v2 spent over 40 days and graded more than 12,000 candidates. The new run took 9.6 days and 2,244 graded candidates. Single-core CPU performance currently improves by roughly 3.5% a year.
What the numbers say about the method
Google’s claim is that the approach holds across the computing stack, from accelerator kernels to cluster schedulers to chip microarchitecture, even when a true evaluation takes hours or days. The common thread is the yardstick: a fast stand-in that is checked against the real benchmark and rebuilt when it stops matching.
The TPU kernel cost comparison matters for teams planning their own agent runs. A cheaper model that makes far more attempts matched or beat the pricier one on three of the five kernels, including Masked Dense MLA at 2.69x against 2.56x. Prompt cache hit rates also moved the bill: 85.7% on Hydrogen against 48.4% on Carbon.
What happens next
Codebase optimization is due in the next Antigravity update. The Borg results still need validation in production before anyone can say they hold up outside a replay.
Source: Google Antigravity