Learn Before
Example

Example of Greedy Search Sequence Generation

Consider a sequence generation model with an output dictionary of "A", "B", "C", and "". A greedy search strategy selects the token with the highest conditional probability at each time step. For instance, at step 1, it might choose "A" (probability 0.5). At step 2, conditioned on "A", it chooses "B" (probability 0.4). At step 3, conditioned on "A" and "B", it chooses "C" (probability 0.4). Finally, it selects "" (probability 0.6). The conditional probability of this entire output sequence is the product of these individual probabilities: 0.5 \times 0.4 \times 0.4 \times 0.6 = 0.048.

Image 0

0

1

Updated 2026-05-14

Contributors are:

Who are from:

Tags

D2L

Dive into Deep Learning @ D2L

Related