For years, digital advertisers have grappled with the rigid boundaries of keyword matching. A brand selling a niche high-end ergonomic chair might target the phrase luxury office seating, only to find that their reach is capped by the literal overlap of words. In the traditional world of search retargeting, if a user searched for a conceptually identical but linguistically different term, the system often failed to make the connection. This gap created a ceiling for growth, where high-intent users remained invisible to the brands they were actually looking for because the underlying math was too strict to see the meaning behind the text.
The Architecture of Semantic Expansion
Yahoo addressed this limitation in the first quarter of 2025 by overhauling the Search Retargeting (SRT) capabilities within the Yahoo DSP. The goal was to move beyond simple pattern matching and toward a system that understands search intent. To achieve this, Yahoo deployed a pipeline powered by Anthropic's Claude 3.5 Sonnet v2, hosted via Amazon Bedrock. By leveraging a serverless infrastructure, the engineering team bypassed the traditional burdens of cluster management and capacity planning, allowing them to move directly from hypothesis to production.
The transition was not immediate. Yahoo utilized Amazon SageMaker Studio to prototype and benchmark a variety of foundation models, including Amazon Titan, Meta Llama, and Amazon Nova. The evaluation focused on a critical trade-off: the ability to expand a seed keyword into a broad set of related terms without drifting away from the original intent. Claude 3.5 Sonnet v2 emerged as the winner, demonstrating the most consistent balance between expansion volume and semantic accuracy.
The results of this migration are stark. The median keyword expansion rate increased fivefold compared to the previous system, and the maximum expansion rate doubled. In previous iterations, rare or low-frequency keywords often resulted in zero expansions, leaving advertisers with no way to scale their reach. With the LLM-based approach, those same rare keywords now generate hundreds or even thousands of semantically related terms, effectively unlocking previously unreachable audience segments.
Solving the Hallucination Problem with Mathematical Guardrails
Integrating a generative model into a production advertising pipeline introduces a significant risk: hallucinations. If an LLM is asked to expand a keyword for organic skincare, it might creatively suggest luxury spas or holistic wellness retreats. While conceptually related, these terms can be too broad for a precise retargeting campaign, leading to wasted ad spend and poor user experience. Yahoo solved this by implementing a two-stage generate-and-verify pipeline that treats the LLM as a creative engine and a mathematical embedding model as the auditor.
In the first stage, Claude 3.5 Sonnet v2 takes a seed keyword provided by the advertiser and generates a massive pool of related candidates. This stage prioritizes recall, casting a wide net to capture every possible variation of user intent. However, these results are not sent directly to the targeting system. Instead, they enter a verification loop where every generated keyword is converted into a high-dimensional vector through an embedding process.
To ensure precision, the system calculates the cosine similarity between the vector of the original seed keyword and the vector of the generated candidate. Cosine similarity measures the angle between two vectors in a multi-dimensional space; the closer the value is to 1, the more similar the meanings of the two words. Yahoo established a strict similarity threshold. Any keyword falling below this numerical cutoff is automatically discarded, regardless of how confident the LLM was in its generation. This creates a technical safety net that strips away hallucinations while preserving the semantic richness of the expansion.
Following the similarity check, the keywords pass through a final sensitive-word filter to ensure compliance with advertising policies and brand safety guidelines. This entire loop was optimized within Amazon SageMaker Studio, where developers analyzed the correlation between filtering thresholds and the resulting precision and recall rates. By combining the creative fluidity of Claude 3.5 with the rigid precision of vector mathematics, Yahoo transformed a probabilistic AI output into a deterministic business asset.
From Statistical Hashing to Semantic Intelligence
To understand why this shift produced a 5x increase in reach, one must look at the legacy architecture. The previous SRT system relied on a combination of Word2Vec and Locality-Sensitive Hashing (LSH). LSH is designed to find similar items in massive datasets quickly by hashing them into buckets. While efficient, LSH is fundamentally a statistical tool. It identifies patterns based on how words co-occur in a dataset, but it does not understand the underlying concept. If a keyword was rare, the LSH bucket was often empty, resulting in the aforementioned zero-expansion failure.
The new architecture replaces this statistical guesswork with contextual understanding. Because Claude 3.5 is trained on vast amounts of human knowledge, it understands that a user searching for a specific technical specification is likely interested in a broader category of professional equipment, even if those words never appeared together in a training corpus. This shift from statistical matching to semantic expansion has not only increased the volume of keywords but has also improved the quality of the audience segments.
This intelligence is supported by a massive leap in operational efficiency. The system's throughput increased 10x, meaning Yahoo can now process and expand keyword sets at a scale that was previously impossible. These expanded keyword sets are stored in Amazon OpenSearch Service clusters, which serve as the reference data for batch scoring workflows. When a user's search history is analyzed, the system checks it against these semantically expanded segments to determine if the user matches an advertiser's intent.
Beyond the data, the move to a serverless architecture via Amazon Bedrock removed the operational friction of scaling. In a programmatic advertising environment, workloads are volatile. A sudden spike in campaign launches can create massive compute demands. By removing the need for manual instance scaling or OS patching, Yahoo's engineers shifted their focus from maintaining servers to optimizing prompts and refining the similarity thresholds. This agility allows the platform to respond to shifting market trends in real-time without requiring a physical redesign of the infrastructure.
For the advertiser, this technical evolution manifests as a higher conversion rate. By matching ads to the hidden intent of a search rather than the literal characters typed into a search bar, the ads become more relevant to the user. This precision reduces the cost of wasted impressions and allows budgets to be concentrated on high-probability conversions. The transition proves that the true value of LLMs in enterprise settings is not in the generation of content, but in the expansion of understanding.
This evolution from rigid hashing to fluid semantic expansion marks the end of the zero-result era in search retargeting.



