We need b forward and backward passes to compute derivatives at each step of the path, leading to O(br) queries.
a naive loss-based approach requires computing the exact loss for every possible change at every stage of the beam search, leading to O(brL|V |) queries.