DeepClue

Self-supervised semantic discovery adopted across Google Ads, Search, and Cloud.

December 2022

Discovering Semantic Structure Without Domain Knowledge

Many large-scale engineering problems depend on identifying groups of semantically related items: execution traces that exercise similar code paths, code examples relevant to the same task, and test configurations that exercise similar behavior.

Traditionally, these groupings require domain-specific taxonomies, manually designed features, or expert knowledge about which items should be considered similar. DeepClue was built around a different thesis: useful semantic structure could be learned directly from the data.

DeepClue combined an autoencoder with a contrastive learning objective to produce representations suitable for semantic clustering. The autoencoder learned to preserve the information needed to reconstruct each input, while the contrastive objective encouraged semantically related examples to move closer together in representation space and unrelated examples to move farther apart.

This improved clustering quality without requiring a predefined ontology for each application domain.

A Reusable Representation Across Businesses

In our initial application, DeepClue selected representative execution traces that increased code coverage from 70% to 85%—a 15-percentage-point improvement.

Its broader value, however, came from its transferability. The same representation-learning approach found distinct applications across Google Search, Google Cloud, and Google Ads.

Google Search: Reducing Integration-Test Combinatorics

In Google Search, integration testing had to account for a rapidly expanding number of feature combinations. The space of possible configurations grew combinatorially, making exhaustive testing increasingly expensive.

DeepClue clustered feature combinations according to their learned semantic similarity. This made it possible to select a smaller but more representative test suite, doubling test coverage while using 30% fewer test cases than a manually selected baseline.

At a time when much of the AI organization’s attention was shifting toward large language models, this work demonstrated that self-supervised representation learning could also create substantial leverage in traditional software and systems problems.

Google Cloud: Retrieving Better Context for Code Generation

In Google Cloud, DeepClue was applied to code-example selection for LLM-assisted code generation.

Rather than supplying the model with manually selected or lexically similar examples, the system used learned representations to retrieve the code samples most relevant to a developer’s task. During internal dogfooding, this automatic context-selection approach improved code-generation accuracy by approximately 6%.

In Google Ads, DeepClue was applied to end-to-end integration workflows containing large numbers of overlapping or redundant scenarios.

By identifying semantically similar execution paths and selecting representative cases, the approach was projected to reduce end-to-end integration compute costs by more than 50%.

Scaling the System

Making DeepClue useful across large production datasets required substantial systems optimization.

I improved its performance by approximately 50× through a combination of techniques, including rematerializing embeddings directly on the GPU, eliminating unnecessary checkpoints, stopping training early once the loss converged, and tuning key hyperparameters.

These improvements transformed DeepClue from a research prototype into a system capable of supporting production-scale workloads across multiple organizations.

My Role

I originated and developed DeepClue’s representation-learning approach, built and optimized the core system, and improved its performance by approximately 50×. I also worked with teams across Google Search, Cloud, and Ads to adapt the representation to distinct application problems.

What This Work Demonstrated

DeepClue showed that a single learned representation could support distinct applications across Google Search, Cloud, and Ads without relying on predefined domain taxonomies.

Its broader lesson was that a representation becomes valuable not only when it performs well on one task, but when it transfers to problems that were not anticipated when the system was first built.