Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support beam search #594

Open
borisdayma opened this issue Apr 15, 2024 · 0 comments
Open

Support beam search #594

borisdayma opened this issue Apr 15, 2024 · 0 comments

Comments

@borisdayma
Copy link

Hi,

It would be nice to support beam search.

There is the reference flax implementation in wmt example and the equivalent one from transformers.

I am guessing that we could:

  • duplicate inputs per num_beams initially
  • at each step we do:
    • decode_step
    • select top beams
    • overwrite entire past cache per selected beams
    • update cache with new selected tokens

So maybe the extra step here is to add the "overwrite entire past cache per selected beams"?
Curious if you have suggestions for implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants