Most Text Generation Models use beam search to select the optimal output candidate. How does one choose the optimal beam size? It would probably vary from task to task, dataset to dataset, and model to model. But given it all these parameters are fixed, how do we choose the optimal beam size? Theoretically scores(beam_size) > scores(beam_size -1) but practically that may not be the case when evaluating for metrics like ROUGE, or BLEU. So is it experimentally determined, for example, to run it for all beam sizes and report the one with the best beam size? I am particularly curious about two aspects:
- In research projects, do people tune the beam size parameter or do they just take the largest reasonable beam size that fits whatever GPU they have?
- When these models are deployed in the real world, how is the beam size determined given the incoming distribution of inputs may be wildly different from the training dataset such that the empirically validated beam size? Or is this not a significant enough concern for resources to be deployed for this optimization?