# GFlowNets bring discrete stochastic computation into neural nets

Markdown copy of https://realalpha.app/s/gflownets-bring-discrete-stochastic-computation-into-neural/ on Real Alpha, the best minutes from long interviews with the people building AI. Cite and link the page, not this copy.

- Speaker: [Yoshua Bengio](https://realalpha.app/builders/yoshua-bengio/) · Yoshua Bengio is a professor and Turing Award winner. · Pioneered deep learning and founded LawZero to develop safe, non-agentic AI systems for the benefit of all.
- Host: [Tim Scarfe](https://realalpha.app/people/tim-scarfe/) · Host, Machine Learning Street Talk
- Show: Machine Learning Street Talk
- Episode: [MIGHT THE ROBOTS TAKE OVER? Prof. Yoshua Bengio](https://realalpha.app/v/G1ARvwQntAU/), Jan 15, 2025
- Moment: 1:28:49 to 1:34:47 of the episode (6 min), playing on https://realalpha.app/s/gflownets-bring-discrete-stochastic-computation-into-neural/; the episode from there: https://realalpha.app/v/G1ARvwQntAU/?t=5329

## Quote

> “these uh g-flow nets and generative flow networks were in general like **probabilistic inference machines**”
> — [Yoshua Bengio](https://realalpha.app/builders/yoshua-bengio/) at [1:28:52](https://realalpha.app/v/G1ARvwQntAU/?t=5332) · Machine Learning Street Talk

## Takeaways

1. They sample across computation, not only at the final step.
2. Discrete steps can represent symbolic operations.
3. The framework aims to train neural nets for deliberate reasoning.

## About this segment

Yoshua Bengio describes GFlowNets as inference systems with discrete and continuous computation steps. The goal is to learn what calculation or deliberation to do next, including symbolic steps.

From “MIGHT THE ROBOTS TAKE OVER? [Prof. Yoshua Bengio]”, Jan 15, 2025. [Watch the full episode](https://realalpha.app/v/G1ARvwQntAU/)

## Transcript

Transcribed by machine (Whisper) from the episode’s audio, so a word may be off here and there.

[1:29:02](https://realalpha.app/v/G1ARvwQntAU/?t=5342) in the middle of the computation of neural nets so these uh g-flow nets and generative flow networks were in general like probabilistic inference machines so think of neural nets that have uh stochastic computation so it's not deterministic and some of that could be continuous and some of that could be discrete so that's where symbols live in the discrete realm the problem with these of course is that we don't know anymore how to train them like with backprop the usual way it doesn't work and so we've come up with probabilistic inference amortized inference you know chief law nets like variational inference a bunch of like uh principles and ideas that actually allow to train these kinds of machineries um and in a way they are closer to reinforcement learning where in your enforcement learning you usually think of

[1:30:05](https://realalpha.app/v/G1ARvwQntAU/?t=5405) a sequence of actions that the agent takes and they can be discrete and yet you are able to get gradients but now think of the same sort of principles or something related where the actions are not in the world but in your mind the actions are about computation what computation should I do next what deliberation should I do next in my mind in order to deliver an answer or prove something or come up with an explanation these are the sort of things we'd like to have in neural nets that we don't have to really have the system two capabilities yeah i remember we interviewed that uh interviewed you about that last time and um my co-host dr daga he likened it to a galton board oh yeah i know those things where you put the little um balls through and you kind of like you can tweak you can control

[1:31:01](https://realalpha.app/v/G1ARvwQntAU/?t=5461) the probabilities at each step exactly yes exactly very very good and um but that was an alternative to something like markup chain monte carlo if i remember correctly yes because what these is because they're stochastic really you can think of them as jointed models they're sampling but but they're not sampling only like at the last step they're sampling all the way like in diffusion yes uh neural nets uh diffusion neural nets you've got neural nets that compute something and then we add noise and then again and again and again so it's a stochastic process you can also have discrete versions of this and GFlowNets are discrete versions of the fusion process and then you can mix continuous and discrete so that's actually closer to how the brain works the brain is stochastic and also has discreteness.

[1:32:02](https://realalpha.app/v/G1ARvwQntAU/?t=5522) So the discreteness is not obvious. The discreteness comes about because the dynamics of the brain when you're becoming conscious of something has contractive properties which is just a mathematical property which mean that the number of places where you could lend this dynamics is now a discrete set right so instead of just a continuous trajectory you can have arbitrary continuous right no it's not arbitrary it's a bunch of trajectories which go to one place a bunch of other trajectories we do another place and so these places they're like symbolic because they um you know they create a partition of the total set of possible uh states and so you're either this group or in that group or in that group and the number of these groups is exponentially large but you get discreteness so the brain has

[1:33:07](https://realalpha.app/v/G1ARvwQntAU/?t=5587) both it's like it has a dual nature from one angle it seems to be just one big vector of activations but from the other you can read off like oh in which region am I oh that's like this thought this symbolic compositional object why do we need discreteness that's a good question well clearly we use it a lot all of math is basically symbolic yes I mean even if you manipulate symbols that are about continuous quantities you get these symbols so So discreteness allows us to construct abstractions.

[1:33:59](https://realalpha.app/v/G1ARvwQntAU/?t=5639) You can think of what we do when we go from a continuous vector space to a sentence, getting rid of a lot of detail that maybe doesn't matter that much so that we can generalize better. So in particular, you get a lot of this compositionality coming out naturally in discrete spaces, like in language. And that is very powerful. That allows us to generalize in ways that may not be as obvious otherwise.
