DeepLLM Quiz
Statistics and Probability

Graphs of generative processes, naive Bayes and graphs as filters

10 questions on discriminative versus generative models, causal generation graphs, hidden variables without meaning, naive Bayes and graphs as filters.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    How can a trained generative model of this kind be used to create a synthetic image?

    • By inverting a labelled image
    • By choosing the object type, position and size from their priors, then sampling an image given those values
    • By copying a training image

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

A satellite photograph is the end product of a process. Someone decided what to build and where, the weather decided the light, the satellite decided the angle, and only then did a picture appear. A machine learning system that looks at the picture and tries to work out what is on the ground is running that process backwards. There are two broad ways to build such a system. You can train a network to go straight from picture to answer, or you can model the forward process and let the computer invert it. This quiz explains the second approach and how a graph describes it.

You will see why the direct approach, a discriminative model, is hungry for labelled examples while the generative approach can make use of unlabelled pictures too. You will see how the arrows of a graph of the forward process correspond to the order of generation, and why a model of this kind can be run in the forward direction to create new pictures. You will meet a revealing example of the rules of conditional independence: the object type, its position and its size are independent of each other until a picture is observed, and become dependent afterwards, because the picture is a collider. You will also see that hidden variables in modern generative models need not mean anything physical at all.

The quiz then returns to naive Bayes, a classifier whose graph is a single class variable pointing to many features. You will see why the features are conditionally independent given the class but not independent overall, and why a model with such a strong assumption can still classify well. Finally, you will think of a graph as a filter that lets some distributions through and blocks others, and see that the two ways of defining the filter, by factorisation and by independence statements, pass the same set.

Some points are often missed. A graph describes a whole family of distributions, not just one. The extreme graphs, fully connected and fully disconnected, mark the ends of a spectrum. And a distribution may satisfy more independence properties than its graph requires.

The quiz suits learners who know the three basic graphs and want to see them used, and practitioners interested in generative modelling. It needs no calculus. There are 10 questions, each with an explanation, and it takes about four minutes. The generative view of modelling has become central to modern machine learning. Models that create images, text and audio are built on the idea of describing how data arise, with a simple source of randomness at one end and a complex distribution over data at the other, and the graph is the language in which that description is written. Understanding how a graph encodes both a factorisation and a set of independence statements gives you a firm base for reading about any of these models, whatever the particular network architecture used inside them.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation follows every answer, so the ideas are reinforced as you go.

›Do I need to know the difference between generative and discriminative models?

It helps, and the quiz on three approaches to classification covers it. The questions here explain the difference again in the context of graphs, so you can follow them without that background.

›What is an inverse problem?

It is a problem in which an underlying process generates observed data, and the aim is to learn how to invert it, recovering the hidden causes from the data. Recognising what is in an image is an example, since the image is the output of a process that chose the objects, their positions and the camera view.

›How does a discriminative approach differ from a generative one?

A discriminative model maps the data directly to the quantities of interest, for instance a network that takes an image and outputs the type, position and size of an object. It needs many labelled examples and cannot directly use unlabelled data. A generative model describes how the data arise and then inverts the description, which allows unlabelled data to be used as well.

›What do the arrows in a generative graph mean?

They follow the order of the generative steps, so that the graph represents the causal process by which the data are produced. Object identity, position and scale are chosen first, from their priors, and the image is then drawn from a distribution that depends on all three. Running the graph forwards generates synthetic data.

›Why do hidden variables not need a physical meaning?

In many modern models, hidden variables are introduced simply to let a complicated distribution be built from simple parts. Normalising flows, variational autoencoders and diffusion models all transform hidden variables with a simple Gaussian distribution, using deep networks, to create complex distributions over data.

›What is special about the naive Bayes graph?

A single class variable has an arrow to each feature. Given the class, the path between any two features is blocked, so they are conditionally independent. If the class is not observed and is summed out, the path opens and the features are dependent, so the overall distribution of the features does not factorise, being a mixture.

›What does it mean to view a graph as a filter?

Imagine passing every possible distribution over the variables through the graph. One kind of filter lets a distribution through only if it factorises as the graph says. Another lets it through only if it satisfies every independence property implied by d-separation. The d-separation theorem says that both filters pass the same set of distributions.

More quizzes