/teamwork gains a codebase optimization capability, built on the "DuoDiscover" paper
Google on Dec. 3 (Dec. 4 Japan time) said on the official blog of its development tool "Antigravity" that it is adding a capability for automatically speeding up existing code to "/teamwork," a feature that has multiple AI agents (systems in which AI carries out work on its own) work together. The blog is signed "The Antigravity & Google Research Team," a joint byline of the Antigravity team and Google Research. It targets code that already has tests to check correctness and a benchmark command that measures performance as a number.
According to the official blog, the approach is based on research in "DuoDiscover," a paper posted in October to arXiv, a site for publishing papers. In real environments, a single performance measurement takes tens of minutes to more than a day, so an AI can try only a few times within a limited time. The capability gets around this problem by searching jointly for what to optimize and for a cheap, fast way to measure progress, the blog says.
On timing, the official blog says the capability is "rolling out in the next update." Antigravity's changelog, retrieved on Dec. 6 Japan time, listed v2.38.0 from Dec. 3 as the latest release and did not mention the capability.
Vahab Mirrokni, one of the paper's authors and a Google Fellow at Google Research, posted on X on the afternoon of Dec. 5 Japan time that the capability was "officially released." Google Research's official account also introduced the blog's content on X that morning.
We have officially released the Codebase Optimization pattern agent as part of Antigravity /teamwork! ๐ By applying this tool to a variety of end-to-end system applications, we achieved incredible results: โก Up to 2.69ร speedups on DeepSeek-V4 TPU kernels ๐ 55.1% fewer TPU interruptions in offline Borg scheduler replays ๐ +5.0% performance boost on the DPC4 CPU prefetcher benchmark How it works: Based on our DuoDiscovery paper, the agent uses a co-discovery pattern to solve the slow-evaluation bottleneck by jointly finding both the codebase optimization strategy and a cheap, fast proxy evaluator to safely guide the optimization. ๐ Blog Post: https://t.co/f3TNypgyqf ๐ arXiv Paper: https://t.co/QhzZwTF13T #AI4Systems #Antigravity #Gemini4
The capability follows research results with /teamwork that Google published in November. The November Google Research blog cited examples such as making TPU programs 4.09x faster with the DuoDiscover procedure and cutting TPU interruptions by 24% with Borg changes, and said more details would come on the Antigravity blog (ORIENS article).
A stand-in evaluator, the "yardstick," gets around slow measurement
According to the official blog, each worker agent profiles how the code runs to find the parts that take time, and picks a part with large room for improvement as its optimization target. At the same time, it builds its own stand-in evaluator that checks only that part, which the blog calls a "yardstick." A yardstick scores candidate edits 20x to 50x faster than the true benchmark. It does not need to produce the same numbers as the true benchmark, only to rank candidates in the same order, the blog says.
The work runs in two nested loops. In the inner loop, an agent edits code on its own working branch, scores it with the yardstick every few seconds, and keeps only edits that improve it. This screens out more than 80% of unpromising edits, reducing how many go to the slow true measurement.
In the outer loop, each time a milestone is reached, an evaluator agent moves only the edits onto the original code, checks for tricks that unfairly game the benchmark, and then runs the full tests and the true benchmark. It then checks with a statistical measure (Kendall's rank correlation) whether the yardstick's scores and the true measurements rank candidates the same way, keeping the yardstick if the value is 0.5 or higher and having it rebuilt if it has drifted. According to the official blog, more than 40% of yardsticks that were initially valid drifted as the code changed.
An orchestrator agent that oversees the whole effort does not edit code itself; it reduces duplicate searches and shares confirmed improvements with other workers. Finally, an independent auditor agent checks the full record and edits, reruns the tests and benchmark from scratch, and then delivers the optimized code.
Five DeepSeek-V4 TPU kernels made 1.50x to 2.69x faster
The first test used five kernels (the core computing programs) for running "DeepSeek-V4," a model from China's DeepSeek, on TPUs, Google's own AI chips. Four of them are published as part of the TPU version of the inference software vLLM. The baseline, set at 1.00x, was the existing kernels written by performance engineers.
According to the official blog, all five kernels became 1.50x to 2.69x faster while passing correctness and tolerance tests. The largest gain was 2.69x on "Masked Dense MLA" with "Gemini Hydrogen," a model built for speed and low cost. The geometric mean over the five kernels was 2.10x for Hydrogen and 1.97x for "Gemini Carbon," which Google calls its strongest model for long tasks.
- Gemini Carbon
- Gemini Hydrogen
The cheaper Hydrogen tried more times and matched or beat Carbon
The official blog says that by using the cheaper Hydrogen to try more times, the agents got results on par with or better than Carbon. The API pricing shown on the official blog, per million tokens, is $1.50 input and $7.50 output for Hydrogen and $4 input and $20 output for Carbon. Across the work on the five kernels, Hydrogen called the model 163,797 times, about 5x Carbon's 33,195, and produced 202.1 million output tokens, 3.4x Carbon's 59.6 million. Estimated API cost was $12,305 for Carbon and $8,826 for Hydrogen.
Cost was also shaped by how often the cache (reuse of identical input) was hit, however. The cache hit rate was 85.7% for Hydrogen and 48.4% for Carbon, and Carbon would have cost about $5,016 at an 85.7% rate, according to the blog. The pricing in the blog matches the API pricing ORIENS reported for Gemini 4 Hydrogen and for Gemini 4 Carbon from Dec. 1.
Borg's 55.1% cut in interruptions comes from simulations replaying past records
The second test was "Borg," Google's internal system for managing large clusters (groups of many servers). Borg's resource allocation is written in C++ and has been tuned for years. Evaluating a single candidate requires replaying hours of production records.
Of three efforts using Carbon, a review of the TPU placement policy replayed 12 hours of records from multiple clusters and proposed changes across 15 C++ files. The changes prioritize protecting running workloads and cut TPU workload interruptions per chip-hour by 55.1%. Interruptions of serving workloads fell 72% to 83%, those of training workloads fell 54% to 93%, and disrupted chips fell 41.8%.
In the same TPU placement subsystem, the agents removed redundant work across 24 files without changing placement results, cutting that subsystem's CPU usage by 71.3% and raising scheduling throughput by 27.1%. For Borg's core scheduler, in high-load replays averaging about 2.7 hours per evaluation, proposed changes across 26 files raised throughput by 37.3%.
The official blog says all of these results come from offline simulations and replays of production records, and are candidate changes under review by the Borg team. They have not yet been validated or put into production.
5.0% on the DPC4 CPU prefetching championship, above the best human design's 3.5%
The third test was the design of a data prefetcher, which has a CPU load data ahead of time. Under the conditions of the "DPC4" championship, the storage cap, simulator and test data are fixed, and one evaluation runs more than 1,700 simulations and takes up to 28 hours.
According to the official blog, the design from Antigravity and Gemini Carbon raised performance by 5.0% as a geometric mean over three evaluation settings. That beat the best human-made design, "BertiGO," at 3.5%, and "ArchAgent v2," an earlier AI system built on "AlphaEvolve," at 3.8%. ArchAgent v2 spent more than 40 days grading more than 12,000 candidates, while this effort took 9.6 days and 2,244 candidates.
The paper was posted in October; the three numbers first appeared in the blog
The paper, "DuoDiscover: Scaling Autonomous Discovery Beyond the Evaluation Bottleneck," was posted to arXiv on Oct. 12. Mirrokni is among its authors.
According to the paper's abstract, it doubled the average speedup of human experts on "SWE-fficiency," a benchmark for improving code performance, and ranked first on 121 of 235 kernels on "SOL-Exec," a benchmark for GPU and TPU kernels. On the heavily optimized inference software vLLM and the database SQLite, it achieved gains of 1.92x and 1.38x over the original code.
The figures of 2.69x, 55.1% and 5.0% do not appear in the paper (the first version, of Oct. 12) and were presented in the official blog. For the CPU prefetcher design, the paper says it searched about 8,000 candidates over 16.7 days and achieved 1.65x ArchAgent v2's gain, a separate experiment from the blog's 9.6 days and 2,244 candidates.
All of the results are Google's own announcement, and this article does not cover third-party verification.
Conditions for use
According to the official blog, users open a repository that has a correctness test and a command that measures performance in Antigravity, invoke /teamwork and state the metric they want to improve (such as latency, throughput or memory usage). Antigravity runs worker agents in parallel and returns audited edits. The blog lists TPU and GPU kernels, performance work on large projects, optimization of inference stacks and CPU design as uses.
The rollout is set for "the next update," and as of Dec. 6 Japan time the changelog does not list the capability as available. The official blog does not say which pricing plans can use it or what the usage limits will be.






