Skip to content

Rework logprobs multiple choice solvers#47

Open
ianbulovic wants to merge 5 commits intomainfrom
rework-logprobs
Open

Rework logprobs multiple choice solvers#47
ianbulovic wants to merge 5 commits intomainfrom
rework-logprobs

Conversation

@ianbulovic
Copy link
Collaborator

Previously, our logprobs multiple choice solvers worked by concatenating each choice with all previous input, and getting the log probability for the entire sequence for each choice. This has two disadvantages: we are processing the (sometimes lengthy) prefix multiple times, and the log probabilities that we get include the probability of the prefix.

This PR reworks the generation code so it happens in two stages: we first process the prefix by itself and save the resulting KV cache, then we separately process the choices (in a single batch) using that cache. This should be more performant and gives us logprobs for the choices independent of the prefix.

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

Successfully merging this pull request may close these issues.

1 participant