[Feature] Self-Distillation Policy Optimization (SDPO) for Megatron GRPO
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- ai, backend, machine-learning
Research direction
Start by reading the existing Megatron GRPO rollout, reward, advantage, and loss paths, then compare the proposed behavior with the linked SDPO paper and reference implementation. The request spans a fused Triton loss, EMA teacher checkpointing, reward feedback and generation APIs, backend handling, docs, an example, and tests. Done means those pieces work together with the listed parallelism modes and unsupported cases fail clearly.
Written by the indexing model from the issue text.
Description
Checklist / 检查清单
- I have searched existing issues, and this is a new feature request. / 我已经搜索过现有的 issues,确认这是一个新的 Feature Request。
Feature Request Description / Feature Request 描述
SDPO (Hübotter et al., 2026, "Reinforcement Learning via Self-Distillation") is a GRPO variant for tasks where the environment returns rich textual feedback (runtime errors, judge comments, ...) besides a scalar reward. The same policy, reprompted with a successful sibling rollout and/or the feedback of its own attempt, acts as its own teacher: its next-token distributions are distilled into the policy on the policy's own sampled responses. No external teacher or reward model is needed, and the advantage term is replaced by a distillation loss (generalized JSD over the student's top-K tokens plus a tail bucket). The authors' reference implementation (https://github.com/lasgroup/SDPO) is verl-based research code; this would be an independent implementation on the Megatron backend.
I would like to add it to the Megatron GRPO backend, reusing the existing GRPO rollout/reward/advantage code:
--loss_type sdpoformegatron rlhf --rlhf_type grpo, with a fused Triton LM-head loss (no full logits materialised), supporting DP / TP (sequence parallel, padding-free) / PP / EP and full fine-tuning; an EMA teacher that reuses the reference-model slot (fp32 master in host RAM, saved with checkpoints).- Reward functions may return
{'rewards': [...], 'feedback': [...]}(plain lists keep working for every GRPO variant). --reward_rollout_generator: reward functions receive a handle to generate text with the policy's own vLLM (colocated or server), e.g. to write the feedback.--sdpo_grpo_weight: the SDPO + GRPO mix of the paper (Section 4.5).- English and Chinese docs (translated using Claude Sonnet 5.5), an example plugin and script, unit tests.
The HF/transformers backend would raise a clear NotImplementedError for now; context parallel, LoRA with the EMA teacher and the trust-region teacher of the paper are not part of the first version.
Pull Request / Pull Request 信息
I plan to submit one pull request with the above (I will link this issue). It is developed with AI assistance and I reviewed every changed line myself.
- Dominant language
- Python
- Stars
- 16.2k
- Forks
- 1.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 68
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelscope/ms-swift
-
get_multimodal_target_regex(..., exclude_router=True) does not exclude shared_expert_gatePossibly taken @KonnyakuMatcha claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10696 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss crashes with beta>0 and kl_in_reward=True (NoneType * Tensor)Possibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
modelscope/ms-swift#10690 ·
Maintainers usually reply within 1 day
-
[BUG] GRPO REAL loss divides by all groups instead of valid groups, silently scaling gradientsPossibly taken @newcloud123 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelscope/ms-swift#10688 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 Half a day Newbie friendliness 62/100
modelscope/ms-swift#10621 ·
Maintainers usually reply within 1 day
-
[Bug] `get_seed` consumes a draw from the shared RandomState even when decision augmentation is disabled, changing the train/val split and dataset shufflePossibly taken @ryznren claimed this 38 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelscope/ms-swift#10466 · 1 comment ·
Maintainers usually reply within 1 day
All issues in modelscope/ms-swift
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day