How OpenAI Built ChatGPT's Novel Ad Stack for User Trust and Relevance
Traditional advertising systems are designed to respond to discrete user events, such as a search query or page view. However, because user intent develops across multiple turns and sessions in a conversational AI like ChatGPT, OpenAI built a custom ads delivery system to support this new paradigm.
This novel ad stack is built around a custom, post-trained frontier LLM that acts as an orchestrator. This LLM manages the entire ad flow—from identifying potential options (retrieval) to predicting user engagement (ranking), evaluating usefulness (relevance), and running the final auction.
Architectural Design Decisions for Conversational Ads
To successfully integrate advertising into an agentic chat environment while maintaining user trust, the ad system implemented three critical design decisions.
1. Implementing Stateful Ad Sessions
The ads system maintains a stateful session, meaning it remembers and updates information across multiple turns and even across different conversations. This approach moves beyond the request-response architecture of conventional advertising. Instead of treating every message as a standalone event, the ads system adapts to the developing exchange, allowing it to track how a user's commercial goals evolve over time.
2. Utilizing a Custom LLM Orchestrator
A custom, post-trained LLM interprets the conversation’s context and underlying intent. This LLM uses a tool call architecture to orchestrate the entire ad flow, effectively selecting, ranking, and delivering ads based on both the user’s current turn and the full conversation history.
3. Separating Ads from Answer Generation
The ads selection process runs in a separate service alongside ChatGPT’s normal response generation. This architectural boundary ensures that the ads flow does not influence ChatGPT’s organic answers and maintains the model’s neutral voice. If the ads serving system fails or slows down, ChatGPT’s core response continues unaffected.
The LLM as the Ads Orchestrator
The core innovation is the LLM orchestrator, which manages the entire ad flow by iteratively calling specific tools within the ads system. The orchestrator’s primary goal is to balance high user value with high advertiser value, always prioritizing the user experience.
Interpreting Evolving User Intent
When a user conversation progresses, the intent can change significantly. For example, a conversation starting with a general question about running might later shift to specific questions about shoes for training. The orchestrator must interpret references to earlier messages and recognize when a user is speaking hypothetically, preventing the system from misreading the goal based on only the initial query.
To begin the process, the orchestrator prepares one or more queries that represent the relevant commercial intent. This involves distilling a multi-turn conversation into a summarized version and creating semantic embeddings. This allows the retrieval system to focus on the commercial possibilities (e.g., [shoes appropriate for hiking trip]) rather than compressing the entire conversation into a single literal string.
The Ad Selection Pipeline
The ads system functions as a multi-stage pipeline, with the orchestrator calling tools at each step:
- Retrieval: The orchestrator uses rewritten queries to create semantic embeddings. This feeds into multiple indices optimized for Approximate-Nearest-Neighbor (ANN) search, which quickly fetches a broad pool of potential ad candidates.
- Filtering: Candidates are eliminated if they do not meet eligibility criteria. Checks include creative and campaign availability, policy restrictions, budget availability, pacing, placement compatibility, and deduplication.
- Evaluation and Scoring: Candidates that pass filtering are scored by various systems. The orchestrator calls these systems to assess semantic relevance, predicted engagement (likelihood of click/conversion), and historical performance. This narrows the pool for the auction.
- Auction: The orchestrator nominates contextually appropriate candidates for the final auction tool. The auction applies final serving mechanics, including bid computation, quality-adjusted ranking, pricing, and final selection.
- Final Eligibility Checks: Before delivery, two checks occur: the ad must feel appropriate in the chat context (even if policy-compliant), and the ad request must arrive in time to be included in the current turn.
Ad Delivery and System Improvement
Server-Side Delivery and User Impression
Ad delivery is a server-side process, meaning the ad creative (title, description, link) and a model-generated preamble are sent to the frontend. The preamble is kept separate from the creative to preserve the advertiser’s message while keeping ChatGPT’s voice neutral. The ad is only displayed to the user as an impression if the creative arrives before ChatGPT’s response is fully generated and the frontend displays it, clearly labeled as sponsored.
Observability and Self-Improvement
The ad stack uses detailed logging and data pipelines to facilitate continuous improvement. Granular outcomes are recorded, such as when a turn was not eligible for advertising, or when retrieval returned no candidates. This detailed breakdown allows the team to isolate and improve specific parts of the system—whether it is opportunity detection, retrieval quality, or delivery reliability.
Furthermore, the system employs high-power models for model-based evaluation. These strongest models observe the system's results and train the smaller, more efficient orchestration and retrieval models to perform better, creating a powerful self-improving loop.
The Role of Human Feedback
While models can understand intent, human feedback is crucial for shaping taste and product direction. Feedback is gathered from user clicks and hides, user surveys, and direct input from advertisers through the Ads Manager, informing iteration and product decisions.