Reinforcement Learning
Transformers
English
post-training
distillation
agentic-coding
composer-2.5
cursor
kimi-k2
grpo
dapo
diloco
openenv
trl
verl
research
methodology
Instructions to use Codeseys/composer-replication-framework with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Codeseys/composer-replication-framework with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Codeseys/composer-replication-framework", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit History
-
docs(wave1): correctness pass — channel-3 provenance, gap honesty, dead links
Propagate ADR-014 ground truth into the living docs and fix every dead relative link. Docs-only; no source files touched. Provenance (Fact A) — stop blurring the additive trace-replay-DPO channel into Cursor's recipe: - README v0.1 roadmap cell, HF_REPO_LAYOUT v0/v1 variant rows: reframe "Composer recipe" = channels 1 (Dr.GRPO) + 2 (SDPO) only; trace-replay is the framework's own addition (link ADR-014). Gap honesty (Fact D) — do not imply the full A1-A4 LMA ladder is runnable: - VISION_VALIDATION status banner + ALTERED_MINDS_TIE_IN Phase-3: only A1 (GRPO-only) has a real Modal runner; A2/A3/A4 are scaffold + plan-builder only, blocked on dataset construction. Real 8B run is additionally budget-gated. PO menu / strip_thinking / main-lag (Facts B, E, F): - VISION_VALIDATION: base RL objective is a selectable menu (default Dr.GRPO) per ADR-014, not hardcoded. - ALTERED_MINDS_TIE_IN: note SDPO requires strip_thinking=False on real traces (~67% of error-recovery turns are…20e3bd9
-
Wave 4: data collator + loss composition smoke (38/38 tests pass)
baladithyabSpike 005's biggest engineering gap was: composer_trainer.py described the inputs it expected (ctx_teacher_input_ids, sdpo_loss_mask, dpo_chosen_input_ids, etc.) but nothing constructed them from raw traces. This wave fills that gap and adds an end-to-end gradient-step smoke test on a real model. Added: 1. trl_path/data_collator.py - ComposerDataCollator turns raw TraceExample into the exact dict shape ComposerReplicationTrainer._compute_loss expects. Channel 1: input_ids, attention_mask, response_mask, rewards. Channel 2: ctx_teacher_input_ids, sdpo_loss_mask (post-hint = 1, else -100). Channel 3: dpo_chosen_input_ids, dpo_rejected_input_ids, response_masks. Hint injection, error-site detection, multi-turn DPO tokenization, padding. 2. tests/test_data_collator.py (15 tests, all pass): verifies SDPO is skipped when no error sites or no hint generator, post-hint mask correctly marks 1 vs ignore_index, DPO response masks zero prompt tokens, padding handles mixe…157cdba -
Wave 3: integration architecture + spike-005 trainer skeleton (16 tests pass)
baladithyabUser asked: can RLVR + Composer-SDPO + N-teacher-replay all integrate complementarily with the PyTorch agentic-RL stack (Monarch / TorchForge / OpenEnv / VeRL / TRL)? Answer (verified, not extrapolated): YES, with concrete extension points: 1. Verified ground-truth integration surfaces via DeepWiki audits: - TRL: subclass GRPOTrainer, override _compute_loss(model, inputs); plug OpenEnv via environment_factory= kwarg. - VeRL: register a new advantage estimator via @register_adv_est(name); attach extra fields to DataProto.batch / non_tensor_batch (precedent exists — distillation already uses 'teacher_log_probs' the same way). - OPSD: generalized_jsd_loss is a self-contained static method, MIT, directly liftable. FlashAttention-2 compatible, standard PyTorch. 2. NEW docs/INTEGRATION_ARCHITECTURE.md (30KB): - Per-framework integration matrix (TRL / VeRL / TorchForge / Monarch / OpenEnv) × per-channel (RLVR / SDPO / N-teacher-replay). - Sequence di…fd77f74 -
Integrate Cursor blog directly + audit research note + add SDPO/OPSD link
baladithyabUser flagged a real gap: I had dispatched a subagent to research Composer 2.5 but never personally read the Cursor blog. Audit findings: 1. The targeted-textual-feedback method = published SDPO (Hubotter et al., arXiv:2601.20802, ICLR 2026 Workshop) + OPSD (Zhao et al., arXiv:2601.18734, code at github.com/siyan-zhao/OPSD, MIT). Cursor cites these directly in footnote 1 of the blog. The subagent's research note never mentioned them. This is huge: there's published, MIT-licensed code for Composer's secret sauce. 2. Several claims in research/01-composer-2.5.md are NOT in the Cursor blog and were extrapolated from secondary sources ("85% post-training compute", "Anyrun" environment name, specific benchmark scores, "PPO or GRPO variant"). Likely correct via community consensus but not blog-verified. 3. Composer hint-distill (single model, hint-conditioned context) and trace-replay-distill (N external teachers) are TWO genuinely different mechanisms, not compe…1cede23 -
Initial commit: Composer 2.5 Replication Framework — research synthesis
Methodology repo (model type) for an open replication of Cursor's Composer 2.5 (post-trained Kimi K2.5) on any HuggingFace base model. Contents: - README.md (HF model card with frontmatter) - framework/composer-replication-framework.md (master synthesis, 18KB) - research/ (5 deep-dives by 5 different LLM families, ~107KB total) - 01-composer-2.5.md (Gemini 3.1 Pro) - 02-diloco-family.md (DeepSeek V4 Pro) - 03-monarch-torchforge-openenv.md (GPT-5) - 04-verl-trl.md (Sonnet 4.6) - 05-trace-replay-distillation.md (Kimi K2-Thinking) - docs/METHODOLOGY.md (how the synthesis was produced) - docs/HF_REPO_LAYOUT.md (planned multi-repo split) - LICENSE (MIT) Status: pre-spike. No code, no weights, no datasets yet. Trained variants and trace datasets will live in separate repos linked via HF Collection.7165832