compute argmax directly, but we can compactly represent all paths as a graph < 3 β, 1 β> < 5 β, 10 β> < 5 β, 6 β> < 4 β, 3 β> < 11 β> < 3 β> < 5 β, 8 β> < 2 β> < 10 β> < 8 β> < 8 β> < 9 β, 5 β> < 6 β, 5 β> < 6 β> < 6 β, 7 β> < 10 β, 11 β> < 7 β> < 4 β, 5 β> < 11 β> < 9 β> < 11 β, 5 β> < 2 β, 4 β> < 4 β, 6 β> < 5 β, 4 β> < 10 β> < 6 β> < 7 β, 4 β> < 7 β> < 5 β, 7 β> < 3 β> < 9 β> < 8 β, 9 β> Graph is linear in the size of the grammar β’ Green nodes represent leaving a word β’ Red nodes represent entering a word β’ Black nodes are intermediate paths