Guia de entrevista · AI / LLM Engineering

What is Thompson Sampling?

do caderno de estudos · atualizado em 2 de outubro de 2026
Para quem vai encarar entrevista de AI / LLM Engineering2 min

Não decore palavra por palavra: entenda a estrutura da resposta e refaça com as suas palavras, em inglês.

A resposta, como você fala na entrevista

A Bayesian method for sequential decisions that balances exploration and exploitation. Maintain a posterior over uncertain reward parameters, sample from it, and choose the action with the highest expected reward under that sample. Update the posterior from observed outcomes.
For a simple binary-success bandit, each variant can use a Beta distribution updated by successes and failures. This is one model, not a requirement for all rewards.

Trap: optimizing cumulative reward is different from identifying the best variant or estimating a causal effect. Thompson Sampling does not universally converge faster than a fixed A/B split. Define the reward, horizon, delayed-feedback handling, and assumptions about changing traffic. Best-arm identification may need a different exploration policy.

Say: "I would choose the experiment objective before choosing a bandit algorithm."

Source: A Tutorial on Thompson Sampling, including its limitations.

Pegadinha clássica

Essa pergunta tem uma armadilha que derruba muita gente em entrevista. Ela está marcada na resposta acima: vale reler antes de treinar.

Ler é o primeiro passo. No app, essa pergunta vira flashcard com repetição espaçada, e o módulo tem quiz e simulado para testar o que ficou.

Treinar essa pergunta no app