{"slug": "google-patents-a-two-ai-system-that-checks-its-own-code-translation-work", "title": "Google Patents a Two-AI System That Checks Its Own Code Translation Work", "summary": "Google has patented a two-model AI system that generates multiple candidate prompts for code migration, scores each rewritten codebase by predicted validation error count, and delivers the version with the fewest predicted errors to the developer. The filing is the 18th Google patent tracked since May in Patentlyze's \"AI models working in teams\" watchlist, following filings on autonomous ad building and AI grading its own image drafts. The system pairs a first AI model that writes optimized instructions with a second model that performs the actual code rewrite, aiming to reduce the cost and error risk of large-scale legacy code migration.", "body_md": "# Google Patents a Two-AI System That Checks Its Own Code Translation Work\n\n[Get the best of each week in your inbox, free →](#get-weekly)\n\nGetting an AI to rewrite your code is one thing. Getting it to check whether its own rewrite is correct is another. Google's latest patent does both by pitting two AI models against each other.\n\n## What Google's prompt-optimizing code migrator actually does\n\nEver tried to convert a massive old document into a new format, only to find the automated tool mangled half of it? That's what happens when companies try to move millions of lines of code from one programming language or framework to another using AI.\n\nGoogle's patent describes a fix: instead of asking one AI to do the conversion and hoping for the best, the system uses **two AI models in sequence**. The first model's only job is to write better instructions for the second model, the one that actually rewrites the code. It produces several versions of those instructions at once, so the second AI tries the migration multiple ways.\n\nEach attempt comes back with a score showing how many predicted errors it contains. The system picks the attempt with the fewest errors and delivers *that* version to the developer. It's a feedback loop, baked directly into the process, so the output you get has already been through a self-sorting round of quality checks.\n\n## How the two-model loop scores and picks the best migration\n\nThe patent describes a pipeline where a developer sends a request to migrate source code, say, converting a codebase from one language or API version to another. That request goes to a **first AI model** whose sole purpose is generating optimized instructions (prompts) for a **second AI model** that performs the actual code rewriting.\n\nThe first model doesn't produce just one set of instructions. It generates *multiple candidate prompts*, each a slightly different way of telling the second model how to approach the migration. The second model then runs the migration once per candidate prompt, producing a separate rewritten codebase for each.\n\nCritically, each migration attempt also produces a **predicted validation error count**: an estimate of how many things are likely broken or incorrect in that version of the rewritten code. The system compares those counts across all the candidates and selects the migrated version tied to the *lowest predicted error count*, labeling both that version and its corresponding prompt as \"optimized.\"\n\nThe winning rewrite goes back to the developer. The architecture is essentially a **meta-learning loop**: one AI learns to write better instructions for another AI, and the whole system is graded on how clean the output code turns out to be.\n\n## What this means for developers facing large legacy code rewrites\n\nLarge-scale code migration is one of the most expensive and error-prone tasks in software engineering. Moving a production system from one framework or language to another can take teams months, and subtle bugs introduced during conversion can be invisible until something fails in production. A system that automatically generates, tests, and ranks multiple migration attempts before handing anything to a developer could meaningfully shorten that process.\n\n[Google's consistent investment in AI-assisted developer tooling](https://patentlyze.com/google/) suggests this isn't an isolated experiment. If the predicted-error scoring is accurate enough to act as a reliable proxy for real test results, developers could stop treating AI-generated code migrations as drafts that need heavy manual review, and start treating them as auditable first passes.\n\nThis is the 18th Google filing we've tracked since May in our [AI models working in teams](https://patentlyze.com/watchlist/ai-models-that-work-in-teams/) watchlist, after [one on autonomous ad building](https://patentlyze.com/patent/google-ai-agents-auto-build-digital-ads/) and [AI grading its own image drafts](https://patentlyze.com/patent/google-ai-image-generator-built-quality-checker/).\n\nThe system bets everything on predicted error counts before anyone actually runs the code. That prediction has to be reliable, because if it misses the quieter failures, code that runs fine but does the wrong thing, the whole selection process optimizes for the appearance of quality rather than quality itself.\n\nThat gap between predicting problems and finding them is the real cost of the design. A developer receiving the \"optimized\" output still needs to treat it as a strong draft, not a finished answer.\n\nEven so, the trade reads as worth it. Moving large codebases between programming languages is slow and expensive work, and a system that generates multiple versions, scores them, and surfaces the best one reduces how much a human has to dig through on their own. The error prediction doesn't have to be perfect to earn its place; it just has to be better than no filter at all, and at scale, even a rough one usually is.\n\n### There are more where this came from\n\nWe read every patent application Big Tech publishes and send you the ones worth knowing. Plain English, free, every week.\n\n## The drawings\n\n3 drawing sheets from US 2026/0267636 A1 · click any drawing to enlarge\n\n    Want this weekly breakdown for a company we don't cover?\n    [Patentlyze Pro →](https://patentlyze.com/pro/?src=post)\n\n**Source.** Full patent text and figures from the\n\n[official USPTO publication PDF](https://image-ppubs.uspto.gov/dirsearch-public/print/downloadPdf/20260267636).", "url": "https://wpnews.pro/news/google-patents-a-two-ai-system-that-checks-its-own-code-translation-work", "canonical_source": "https://patentlyze.com/patent/google-ai-writes-better-ai-prompts-code-migration/", "published_at": "2026-09-11 03:42:03+00:00", "updated_at": "2026-09-11 03:56:20.034057+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "artificial-intelligence", "ai-products"], "entities": ["Google", "Patentlyze"], "alternates": {"html": "https://wpnews.pro/news/google-patents-a-two-ai-system-that-checks-its-own-code-translation-work", "markdown": "https://wpnews.pro/news/google-patents-a-two-ai-system-that-checks-its-own-code-translation-work.md", "text": "https://wpnews.pro/news/google-patents-a-two-ai-system-that-checks-its-own-code-translation-work.txt", "jsonld": "https://wpnews.pro/news/google-patents-a-two-ai-system-that-checks-its-own-code-translation-work.jsonld"}}