KatInterview

Serving a Video Captioner on a Tight GPU Budget, Then Searching It

System DesignModel answer
MediumModel answerSystem Designml-system-designmultimodalmodel-serving

Last updated

Design a memory- and compute-efficient serving stack for a multimodal video captioning model, then a fast search-and-watermark pipeline for advertisers over existing captions and embeddings.

Context

You are on the ML platform team of a large short-video app. A multimodal model accepts a video (sampled frames, with optional audio) and produces a text caption. Your job is to make it a dependable production service and then build a product feature on top of its output.

Assumptions:

  • New uploads arrive continuously, and the existing catalog also has to be captioned (backfill).
  • The GPU pool is limited and shared with other teams. VRAM per replica and total GPU-hours are hard caps, so you cannot just add machines.
  • Videos range from a few seconds to many minutes, at varied resolutions.
  • The catalog holds hundreds of millions to billions of videos, each with at least one caption and at least one embedding.
  • Watermarking re-encodes or overlays media, so it costs far more than writing metadata.

Part A: Deploy the captioner within compute and VRAM limits

Design the modeling and serving system. Discuss:

  • How you shrink the cost of the multimodal input.
  • How you make the model fit in memory.
  • How the serving path is organized (online, offline/batch, or hybrid).
  • How outputs are stored and how the system is monitored.

Part B: Fast advertiser search and watermarking

Captions and embeddings already exist. A brand advertiser wants to find videos relevant to a query (text, an example creative, or both) and then watermark the matches. Design the pipeline so that both search and watermarking are fast at scale. Cover indexing, filtering and ranking, caching, the watermarking path, trade-offs and failure modes.

What to do first

State the clarifying questions you would ask (online vs. batch latency, caption format and languages, quality bar after compression, query types, watermark type, index freshness, brand-safety gating) and the assumptions you pick. Then give a structured design with justified trade-offs.

Hints

Hint 1

Treat cost as the primary constraint. For every choice, say what it saves (VRAM, FLOPs, GPU-hours) and what quality or complexity it costs.

Hint 2

For Part A, work through the pipeline in order: reduce what goes into the model (frames, resolution, audio), shrink the model (quantization, distillation), control runtime memory (KV cache, batching), then choose the serving mode.

Hint 3

For Part B, split search into cheap candidate generation and expensive re-ranking, and make the watermark step an asynchronous, idempotent job that only runs after matches are approved.

Hint 4

Mention versioning: a query embedding must be produced by the same model version as the index it searches.