Skip to content

Conversation

@noooop
Copy link
Collaborator

@noooop noooop commented Jul 28, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Purpose

After #21470, LLM.encode pooling_task defaults to using "encode", meaning that reward models actually use LLM.encode. However, most libraries' encode corresponds to an embedding model, which can lead to potential errors.

  • Add LLM.reward specified to reward models
  • The pooling_task for LLM.encode defaults to None, and pooling_task needs to be specified

Test Plan

Test Result

(Optional) Documentation Update

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the frontend label Jul 28, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aims to improve the API for reward models by adding a dedicated LLM.reward method and making the pooling_task in LLM.encode explicit. The changes are in the right direction, but the implementation of the new reward method seems incorrect as it uses pooling_task="encode" and lacks necessary validation. I've left a critical comment with suggestions to align it with other task-specific methods like embed and classify. Additionally, I've suggested improving an error message for better user guidance. Addressing these points will significantly improve the correctness and consistency of the new API.

@noooop
Copy link
Collaborator Author

noooop commented Jul 28, 2025

@DarkLight1337

Quick review

Signed-off-by: wang.yuqi <noooop@126.com>
noooop added 2 commits July 28, 2025 14:13
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
@mergify mergify bot added the documentation Improvements or additions to documentation label Jul 28, 2025
@noooop noooop marked this pull request as ready for review July 28, 2025 07:29
Signed-off-by: wang.yuqi <noooop@126.com>
noooop added 2 commits July 28, 2025 16:13
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
@noooop noooop marked this pull request as draft July 28, 2025 09:22
noooop added 2 commits July 28, 2025 18:34
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
@noooop noooop marked this pull request as ready for review July 28, 2025 12:40
noooop added 3 commits July 29, 2025 08:57
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: wang.yuqi <noooop@126.com>
@DarkLight1337
Copy link
Member

Let's wait for #18321 to be merged first, then update this PR

@DarkLight1337 DarkLight1337 enabled auto-merge (squash) July 29, 2025 10:48
@noooop
Copy link
Collaborator Author

noooop commented Jul 30, 2025

buildkite/ci/pr/language-models-test-extended-pooling

The failed test can be fixed by #21747

@vllm-bot vllm-bot merged commit 65f311c into vllm-project:main Jul 30, 2025
66 of 69 checks passed
liuyumoye pushed a commit to liuyumoye/vllm that referenced this pull request Jul 31, 2025
@noooop noooop deleted the llm_reward branch August 5, 2025 11:37
vadiklyutiy pushed a commit to CentML/vllm that referenced this pull request Aug 5, 2025
x22x22 pushed a commit to x22x22/vllm that referenced this pull request Aug 5, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: x22x22 <wadeking@qq.com>
npanpaliya pushed a commit to odh-on-pz/vllm-upstream that referenced this pull request Aug 6, 2025
jinzhen-lin pushed a commit to jinzhen-lin/vllm that referenced this pull request Aug 9, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Jinzhen Lin <linjinzhen@hotmail.com>
noamgat pushed a commit to noamgat/vllm that referenced this pull request Aug 9, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Noam Gat <noamgat@gmail.com>
paulpak58 pushed a commit to paulpak58/vllm that referenced this pull request Aug 13, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Paul Pak <paulpak58@gmail.com>
diegocastanibm pushed a commit to diegocastanibm/vllm that referenced this pull request Aug 15, 2025
Signed-off-by: wang.yuqi <noooop@126.com>
Signed-off-by: Diego-Castan <diego.castan@ibm.com>
epwalsh pushed a commit to epwalsh/vllm that referenced this pull request Aug 28, 2025
zhewenl pushed a commit to zhewenl/vllm that referenced this pull request Aug 28, 2025
@xsank
Copy link
Contributor

xsank commented Sep 11, 2025

@noooop @DarkLight1337 For online server, which api is the best entrypoint for the reward model?

@noooop
Copy link
Collaborator Author

noooop commented Sep 11, 2025

@noooop @DarkLight1337 For online server, which api is the best entrypoint for the reward model?

https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/openai/serving_pooling.py

/pooling


I personally think that /pooling needs to be refactored to better support the reward models

PTAL #20538

@xsank
Copy link
Contributor

xsank commented Sep 16, 2025

@noooop @DarkLight1337 For online server, which api is the best entrypoint for the reward model?

https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/openai/serving_pooling.py

/pooling

I personally think that /pooling needs to be refactored to better support the reward models

PTAL #20538

Now i'm using embedding api and i have no scenario for pooling api yet

@noooop
Copy link
Collaborator Author

noooop commented Sep 16, 2025

@noooop @DarkLight1337 For online server, which api is the best entrypoint for the reward model?

https://github.com/vllm-project/vllm/blob/main/vllm/entrypoints/openai/serving_pooling.py
/pooling
I personally think that /pooling needs to be refactored to better support the reward models
PTAL #20538

Now i'm using embedding api and i have no scenario for pooling api yet

According to vllm's taxonomy

  • the reward model means using all pooling (and step pooling, let's temporarily not discuss it. ), meaning there is an output for each token.

  • the embedding model means using [CLS], LAST, MEAN pooling, which means there is only one output for a sequence

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

Labels

documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants