x-transformers icon indicating copy to clipboard operation
x-transformers copied to clipboard

Feature request: generate top k sequences

Open yzhang-github-pub opened this issue 2 years ago • 4 comments

Instead of generate the best (top 1) sequence from autoregressive generate function, it is useful to generate >1 best sequences. For example, in language translation, human users can have choices from more than 1 best translations.

Thanks for your consideration.

yzhang-github-pub avatar Mar 20 '23 22:03 yzhang-github-pub

@yzhang-github-pub do you mean beam search?

lucidrains avatar Mar 21 '23 16:03 lucidrains

@lucidrains Not exactly. Using language translation as an example. The model generates one best target sentence, either greedily or by beam search. What I ask is to generate top k target sentences.

yzhang-github-pub avatar Mar 21 '23 23:03 yzhang-github-pub