Skip to content

Refining Previous Tokens #150

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

Open
matt-bendel opened this issue Mar 29, 2025 · 3 comments
Open

Refining Previous Tokens #150

matt-bendel opened this issue Mar 29, 2025 · 3 comments
Labels
discussion This doesn't seem right

Comments

@matt-bendel
Copy link

Hello, very impressive work here!

I am trying to understand the inference process, and my understanding is that we can refine previous input tokens (since rk, the current prediction, attends to all ri for i =1,..,k-1). How can I modify the inference process to refine previous tokens? Do I need to disable caching and pass the entire context to the transformer at each iteration?

Thank you for your help!

@enjoyyi00
Copy link
Contributor

@matt-bendel
Thank you for your interest in our work and for this thoughtful question!

You're absolutely right about the attention mechanism - at step k, the model can attend to all previous tokens r₁ through rₖ₋₁. However, the model doesn't actually modify or "refine" previous tokens during inference. Instead, it uses the existing sequence (all previous scale tokens) purely as context to predict the next scale token in the sequence.

@matt-bendel
Copy link
Author

@enjoyyi00 I see, thank you for the response!

A quick follow-up question. Imagine that I had some GT sequence of rks, e.g., r_seq = [r1, r2, r3], and I wanted to use this sequence as an initial context for VAR. Is the appropriate approach to use logic like what is in the VAR forward function to construct the input to predict r4? Do I need to pass the full context to the model each iteration with this approach, or could I still use caching?

Thank you!

@enjoyyi00
Copy link
Contributor

@matt-bendel You can use kv cache, which is implemented in the code

@enjoyyi00 enjoyyi00 added the discussion This doesn't seem right label Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants