Skip to content

Logit Processor additional data #2142

Closed
@julien-piet

Description

@julien-piet

Hi,

Currently, logit processors are only aware of the previous generated tokens and the logits:

logits_row = logits_processor(token_ids, logits_row)

For some applications (like watermarking), additional context can be useful, such as the index of the generation in the original batch. It would be nice if these could be passed as optional parameters to logit processors. Passing the seq_id variable would be neat for instance.

Additionally, having a higher level interface (such as a LogitProcessor similar to the one in HuggingFace that handles batches instead of individual generations) could be useful (see the changes in main...julien-piet:vllm:main).

Happy to help out with this!
Julien

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions