deepspeedai / deepspeedai/DeepSpeedExamples

Question about `compute_rewards` in DeepSpeedChat

Open
#751 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
6.8k
Forks
1.1k
Avg merge
2d 16h
Merged PRs (30d)
1

Description

If I understood correctly, in DeepSpeedChat, the rewards for each token are calculated by adding KL penalties with the same reward_score on each sample (episode), as shown in this link.
However, the library trl and trlx handles this differently, they only add the reward_score to the last token, as shown here.

Are there any reasons why DeepSpeedChat adds reward_score to each token?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading applications/DeepSpeed-Chat/training/step3_rlhf_finetuning/ppo_trainer.py around the linked compute_rewards implementation. Compare its token-level reward handling with the linked trl and trlx implementations, then check related RLHF or PPO documentation. Done means the rationale for applying reward_score across tokens is documented or the behavior is clarified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.