Google's Antigravity /teamwork Makes TPU Kernels 2.69× Faster in 9 Days
Google's Antigravity /teamwork pairs parallel agents with fast proxy evaluators to optimize code where benchmarks take hours, hitting 2.69x TPU kernel speedups.
Takeaways
- Google's Antigravity /teamwork hit up to 2.69x speedups on DeepSeek-V4 TPU Pallas kernels over human references.
- Cheaper Gemini Hydrogen beat stronger Gemini Carbon (2.10x vs 1.97x geo-mean) by running 5x more LLM calls at similar cost.
- Agents built fast proxy "yardsticks" 20-50x faster than true benchmarks, validated by Kendall's tau rank correlation.
- Candidate Borg scheduler changes cut TPU workload interruptions by 55.1% in offline production trace replays.
- DPC4 CPU prefetcher design hit +5.0% geomean, beating human (+3.5%) and prior AI (+3.8%) in 9.6 days.
- Approach formalized in the DuoDiscover paper; rolling out in an upcoming Antigravity update.
Google’s Antigravity team and Google Research have introduced Antigravity /teamwork, a multi-agent workflow for optimizing production code when each benchmark run can consume hours or days. Early experiments report faster TPU kernels, fewer interruptions in offline Borg scheduler replays, and improved CPU prefetcher designs.
The accompanying DuoDiscover paper describes the underlying method. Agents jointly identify promising code regions and build cheap, target-specific evaluators called yardsticks, allowing them to test many edits before paying for a full benchmark run.
Slow benchmarks starve the agent loop
Production optimization exhausts a conventional coding agent’s wall-clock budget because every candidate edit must pass an expensive benchmark. The workloads studied by Google illustrate the range:
| Workload | Full evaluation time |
|---|---|
| TPU kernel suite | Tens of minutes |
| vLLM serving engine | Nearly 1.5 hours per candidate |
| CPU microarchitecture simulation | More than one day per design |
Fixed proxy benchmarks create another failure mode. An optimizer can exploit mismatches between the proxy and the full evaluation, raising the proxy score while production performance stalls or declines. Uncoordinated parallel agents also tend to converge on obvious hotspots and repeat one another’s experiments.
DuoDiscover builds fast feedback
DuoDiscover gives each worker agent responsibility for selecting an optimization target and constructing the evaluator used to search it. The workflow proceeds through five stages:
- Profile and choose a target. The worker examines the codebase from the bottom up and estimates the available performance headroom. Amdahl’s law bounds the gain available from accelerating one part of a system, while hardware roofline models indicate whether computation or memory bandwidth sets the limit.
- Build a yardstick. The worker creates a local correctness check and scoring function that runs 20 to 50 times faster than the full benchmark. Accurate candidate ordering is the required property; matching the full benchmark’s absolute score is unnecessary.
- Search in a fast inner loop. The agent edits the selected code and evaluates each candidate with the yardstick. This stage filters more than 80% of unpromising changes before a full evaluation.
- Verify in a slow outer loop. An isolated Evaluator applies an allowlisted diff to a pristine baseline, checks for benchmark manipulation, runs the complete test suite, and records the median benchmark result in an append-only ledger.
- Repair drifting yardsticks. When proxy scores stop tracking confirmed results, the worker rebuilds its yardstick on the existing branch and continues the search.
After each full evaluation, DuoDiscover compares the yardstick scores with confirmed benchmark scores using Kendall’s tau. This rank-correlation statistic ranges from -1 to 1: a score of 1 indicates identical ordering, while 0 indicates no consistent rank association. The system continues using a yardstick when tau reaches at least 0.5.
Google’s studies found that more than 40% of initially valid yardsticks eventually drifted as the code changed, supporting the decision to test proxy fidelity throughout a campaign.
Five TPU kernels, up to 2.69× faster
Google evaluated the workflow on five DeepSeek-V4 Pallas kernels, including four from the open-source vLLM TPU-Inference repository:
- Multi-Head Latent Attention
- Sliding-Window Attention MLA
- Masked Dense MLA
- Sparse MLA
- Streamindex TopK
The 1.00× baseline for each experiment was the existing Pallas reference kernel written by human performance engineers. Campaigns using Gemini Carbon, described as the stronger long-horizon reasoning model, and Gemini Hydrogen, the faster and cheaper model, produced speedups from 1.50× to 2.69× while passing every correctness and numerical-tolerance test.
| Metric | Gemini Carbon | Gemini Hydrogen |
|---|---|---|
| Geometric-mean speedup | 1.97× | 2.10× |
| Total LLM calls | 33,195 | 163,797 |
| Output tokens | 59.6 million | 202.1 million |
| Estimated API cost | $12,305 | $8,826 |
Hydrogen cost 2.67 times less per token, enabling roughly five times as many calls and 3.4 times as many output tokens at a lower estimated API cost. Its campaign achieved the higher geometric-mean speedup and led on three of the five kernels. For workflows with reliable, inexpensive feedback, search volume can offset lower reasoning capability per call.
Borg cuts interruptions in offline replays
Three Gemini Carbon campaigns modified the C++ scheduler in Google’s Borg cluster manager and evaluated the changes through offline replays of production traces. One campaign redesigned placement scoring across 15 C++ files and reported:
- 55.1% fewer overall interruptions per chip-hour, equivalent to a 2.23× improvement
- 72% to 83% fewer serving interruptions
- 54% to 93% fewer training interruptions
- 41.8% fewer disrupted chips
- Successful completion of all availability and disruption guardrails
A separate throughput campaign reduced CPU use in the colocation subsystem by 71.3% without changing placement decisions. Both sets of changes remain under review by the Borg team and have yet to enter production.
Prefetcher gains with 2,244 candidates
Google also tested DuoDiscover on the DPC4 benchmark for data prefetchers, hardware mechanisms that predict future memory accesses and load data into cache early. Each evaluation covers more than 1,700 simulations and can take up to 28 hours.
| Approach | Speedup | Elapsed time | Graded candidates |
|---|---|---|---|
| BertiGO, human-designed | +3.5% | Not reported | Not reported |
| ArchAgent v2, AlphaEvolve-based | +3.8% | More than 40 days | More than 12,000 |
| Antigravity with Gemini Carbon | +5.0% | 9.6 days | 2,244 |
Antigravity’s result covered all three DPC4 evaluation regimes. The paper compares the 5.0% benchmark gain with an estimated 3.5% annual improvement in single-core CPU performance, although DPC4 measures the narrower contribution of data prefetching.
Controls against proxy gaming
Goodhart’s law describes the risk that a proxy loses its usefulness once an optimizer targets it directly. DuoDiscover addresses that risk by continuously measuring rank correlation, rebuilding drifting yardsticks, and separating speculative editing from authoritative evaluation.
The reporting path adds two independent checks. The isolated Evaluator applies approved changes to a clean baseline and records full benchmark results, while a separate Victory Auditor rechecks accepted gains before publication. These controls prevent a worker’s local environment or proxy-specific tricks from becoming reported performance improvements.
Where the method fits
Workloads with quantitative objectives, runnable correctness tests, and expensive evaluations provide the clearest fit for this approach. Google identifies several potential applications:
- Triton, CUDA, and Pallas kernel optimization under strict numerical tolerances
- Repository-level performance work in large C, C++, and Python projects
- Latency, throughput, and memory tuning for inference-serving systems
- Prefetcher, branch-predictor, and cache-policy design using cycle-level simulators
What teams need to run it
DuoDiscover requires a benchmark command that produces a quantitative score, a correctness suite that rejects invalid changes, and enough compute to run periodic full evaluations. Engineering goals without a stable numeric objective fall outside its current scope.
- Yardsticks must be tailored to each target and monitored throughout the search.
- Full evaluations remain necessary for confirming milestones and final results.
- The Borg findings come from offline trace replays, with candidate changes still under review.
- The reported TPU API costs cover model usage and do not represent a unified compute-cost estimate for every experiment.
Google says the codebase-optimization capability will arrive in an upcoming Antigravity update. External researchers can already access Gemini 4 models through /teamwork and /boost, according to the company’s research overview.