---
title: "How we built ChatGPT’s novel ad stack for user trust and relevance"
description: "ChatGPT's ad stack replaces the event-driven request/response ads pipeline with stateful ads sessions that track evolving intent across turns and conversations, orchestrated by a post-trained LLM that calls tools for query rewriting, ANN retrieval over multiple embedding indices, eligibility filtering (budget, pacing, targeting, policy, dedup), relevance and engagement scoring, and a separate auction tool that handles pricing and final selection."
url: "https://swe.quest/articles/how-we-built-chatgpt-s-novel-ad-stack-for-user-trust-and-relevance-d3146d4ee40db504"
canonical: "https://openai.com/index/building-chatgpt-ad-stack"
source: "OpenAI"
published: "2026-10-21"
difficulty: "medium"
kind: "Case study"
reading_minutes: 14
tags: ["ads","ai-agents","llms","system-design","vector-search"]
---

# How we built ChatGPT’s novel ad stack for user trust and relevance

A post on [OpenAI](https://swe.quest/sources/openai.md), published 2026-10-21, 14 min read, Case study. Original: [https://openai.com/index/building-chatgpt-ad-stack](https://openai.com/index/building-chatgpt-ad-stack)

## Summary

ChatGPT's ad stack replaces the event-driven request/response ads pipeline with stateful ads sessions that track evolving intent across turns and conversations, orchestrated by a post-trained LLM that calls tools for query rewriting, ANN retrieval over multiple embedding indices, eligibility filtering (budget, pacing, targeting, policy, dedup), relevance and engagement scoring, and a separate auction tool that handles pricing and final selection. The ads service runs alongside, and fully separate from, answer generation, with separate models and code, so it cannot influence or delay ChatGPT responses. Returning no ad, or timing out before the response is ready, counts as a normal outcome. A model-generated neutral preamble is kept separate from the advertiser creative, and the system reportedly reached a $1B annualized run rate within 200 days.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Ads](https://swe.quest/tags/ads.md) (Domains)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)

## Prerequisites

- ad auctions basics
- semantic embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- LLM tool calling ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))

## Keywords

ChatGPT, ChatGPT Ads, approximate nearest neighbor, OpenAI

## Related posts

- [Let AI Entertain You: Increasing User Engagement with Generative AI and Rejection Sampling](https://swe.quest/articles/let-ai-entertain-you-increasing-user-engagement-with-generative-ai-and-6a4a5ebea825e273.md): Nextdoor Engineering · 2023-10-16 · Medium · 12 min read · LLMs, Model training, Evaluation, Communications, Product engineering
  Nextdoor improved notification email subject lines by having ChatGPT extract (not rewrite) the most interesting phrase from a post, then using a fine-tuned OpenAI ada reward model to accept the generated subject only when it predicts more clicks than the user-written one, a form of rejection sampling.
- [From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart](https://swe.quest/articles/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-1eba18ee15c15a7e.md): Instacart Tech · 2026-06-02 · Hard · 13 min read · Recommendations & ranking, Ads, Inference & serving, ML platforms
  Instacart replaced its BERT-based ads retrieval model, which scored every atomic product ID in a fixed vocabulary, with a generative model that autoregressively decodes Semantic IDs (RQ-VAE codeword sequences) via beam search.
- [Part 2: Generative bidders for ads at Grab](https://swe.quest/articles/part-2-generative-bidders-for-ads-at-grab-c23bf975df8e9eb8.md): Grab Engineering · 2026-11-25 · Hard · 12 min read · Ads, Machine learning, Model training, Evaluation
  Grab Ads replaces reactive PID budget pacing with a generative bidder that plans 30-minute sequences of per-minute pacing actions.
- [GenRecs Tokenization: Transforming Ads Recommendation at Meta with Stable Model Vocabulary](https://swe.quest/articles/genrecs-tokenization-transforming-ads-recommendation-at-meta-with-stable-model-e3f3b6ea2626a2c2.md): Meta Engineering · 2026-10-19 · Hard · 6 min read · Recommendations & ranking, Ads, LLMs, Machine learning
  Meta's ads recommender replaces per-item IDs with GenRecs Tokenization, a stable semantic vocabulary.
- [Part 1: Simulation-first AI experimentation for ads at Grab](https://swe.quest/articles/part-1-simulation-first-ai-experimentation-for-ads-at-grab-b9e77470bd59260e.md): Grab Engineering · 2026-11-23 · Medium · 11 min read · Ads, Evaluation, Testing, System design
  Grab built an offline ads simulator that sequentially replays historical ad opportunities, applies candidate bidding, ranking and pacing logic, and probabilistically generates user responses from calibrated engagement models.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
