Skip to content

Question on Initial guess tokens #8

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

Closed
DaehanKim opened this issue Nov 23, 2023 · 1 comment
Closed

Question on Initial guess tokens #8

DaehanKim opened this issue Nov 23, 2023 · 1 comment

Comments

@DaehanKim
Copy link

Hi! Thank you for sharing a good initial implementation of lookahead decoding!

I'm just curious on how to set initial W tokens when starting lookahead decoding.
(I tried to find a code related to it but couldn't.)

It seems like this initial setup can impact decoding speed somehow since if those words are chosen randomly, no real match might be retrieved from the n-gram pools.

@Viol2000
Copy link
Collaborator

Hello, the W tokens initialization is here:
https://github.com/hao-ai-lab/LookaheadDecoding/blob/main/lade/decoding.py#L223

Actually, our method includes a multi-level lookahead window, and we only set one level at the beginning. It will run several warmup steps to fill the whole 2-D window.

The set_token function defines the token initialization method. You can change it by changing the code here:
https://github.com/hao-ai-lab/LookaheadDecoding/blob/main/lade/decoding.py#L221C5-L221C26

Currently, we are copying the init tokens from the prompt. Actually, althrough tokens are randomly selected from the vocabulary, lookahead decoding can still converge and achieve speedup, thanks to the magic Jacobi iteration.

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

No branches or pull requests

2 participants