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
-
Wave 21: Stage-0 dataset pipeline — swesmith engine, rollout harness, gates, contract
Baladithya Balamurugan +1: Claude Fable 5Implements research/deepread/13-synthesis-architecture.md (ADR-016): the "point at a repo -> dataset" pipeline the critical review architected, closing every verified P0 from research/deepread/12-verified-findings.md. New modules (+96 tests, full suite 511 passed / 66 skipped): - datagen/repo_gate.py: SPDX-ish license detection -> 3 tiers (fail-closed) + benchmark DECONTAMINATION vs the SWE-bench eval-repo list (closes V3 — zero decontamination existed anywhere). - datagen/swesmith_adapter.py + [swesmith] extra: SWE-smith as the synthesis engine (closes V4 buy-vs-build). Handles the patch-semantics INVERSION (SWE-smith's patch INTRODUCES the bug; golden_diff = reverse_unified_diff) + strategy provenance sidecar + difficulty priors. - datagen/trajectory.py: canonical trajectory IR (closes D-11). ToolCall canonical_form = v1 divergence-gate action algebra (replaces the whitespace stub, D-3); to_policy_row = THE policy-visible serializer, sentinel-tested to never leak gol…9a2ce20 -
Wave 21: deep-read critical review — 8 source clusters re-read, findings verified
Baladithya Balamurugan +1: Claude Fable 58 Sonnet readers re-fetched every primary source (Composer 2.5 blog verbatim, Composer 2 techreport 2603.24477 full HTML, SWE-smith/SWE-Gym/R2E-Gym/SWE-bench, SDPO/OPSD, GRPO family + Comedy-of-Estimators, DiLoCo line, world-model cluster + anti-evidence, LATS/ToT/rStar/Tree-GRPO/SWE-Search/Symphony/Socratic-SWE, TRL/verl/SkyRL live docs, SWE-MiniSandbox) and cross-checked the repo's research notes + vision docs against them. 2 adversarial critics (fidelity, design); every P0/P1 finding independently verified against code + source quotes — 0 refuted. (Feasibility critic stalled on capacity; flagged unreviewed.) Top verified findings: - SDPO "mathematically the same" claim is WRONG (Cursor cites it as background; ours is a third, blog-inspired design) — to be corrected. - Envisioned tree pipeline had 4 structural breaks: seed-trace/oracle disjointness, NO rollout harness (SFT corpus had no producer), divergence gate uncomputable (whitespace-stub normalizer), no Sandbox.fork(). - …2a16b30
-
Wave 20: Tier-0 fidelity fixes — k1-in-reward KL + Composer-2 behavior rewards
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)Closes the two cheapest "next-level" gaps from the F5 fidelity audit (Rubric A items c2, h, i). Both reproduce Composer-2 §4.1/§4.2 exactly, without the hint mystery. 33 new tests; full suite 415 passed / 66 skipped. (1) k1-in-reward KL (F5 #1, the highest-fidelity-leverage single change). Composer-2 §4.1 chooses the k1 estimator IN THE REWARD (-log r); TRL uses k3 IN THE LOSS. The 2025/26 evidence (arXiv:2512.21852, verl k1-only, TRL #4967) says k1-in-reward improves OOD generalization where k3-in-reward can collapse — exactly the "take any model to the next level" axis. - trainer/kl_in_reward.py: pure, tested math. k1/k3 per-sequence estimators + apply_kl_in_reward, which adjusts GRPO advantages by -coef·(KL - group_mean(KL)). test_kl_in_reward.py PROVES this exactly equals folding -coef·KL into the reward then re-running GRPO's group-mean baseline (9 group/gen combos) — the justification for not forking TRL's scoring code. Exact only without std-norm (Dr.GRPO …41289bf -
Wave 20: 5-facet AWS-native architecture design (F1-F5)
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)Answers the dataset-gen+SFT-vs-RL-vs-BOTH question with 5 grounded facet designs from the aws-native-architecture-design workflow: - F1 systems-framing: BOTH = two loops at two timescales, not two phases; component->loop mapping table; SFT-first ordering; S3 dataset contract (6 typed prefixes); repo delta (tree_controller, s3_layout, sft_floor). - F2 aws-datagen: per-stage native verdict (Glue 5.0 Spark ingest -> Bedrock batch replay -> AWS Batch array on Spot test-exec -> EMR Serverless normalize), Step Functions orchestration. - F3 rl-sagemaker: runnable-now g5.2xlarge GSM8K GRPO smoke (<$1), colocated vLLM, BYO container from PyTorch DLC; live-verified quota. - F4 decoupled-diloco-s3: N single-instance jobs, ObjectStoreAllReduce PUT-poll-mean over S3, strong-consistency correctness, IAM gotcha, cheapest validating-run ladder. - F5 fidelity-audit: rubric vs Composer 2.5/Composer-2 + load-bearing papers; 5 FULLY-REPLICATED, k3-vs-k1 KL documented infidelity, missing…50e3f0e -
R14: harden live-Docker tests against transient daemon contention
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)The Phase-8 verifiers flagged 2 live-Docker DockerSandbox tests as flaky under concurrent container resource pressure (full suite + review agents spawning containers) — passing in isolation. Added _retry_docker(): bounded retry (3x, backoff) on transient daemon errors (timeout/resource/conflict/500/connection), re-raising genuine repeatable failures. Wired into the 4-gate inversion test and the network-disabled test. 27 passed / 1 skipped, lint-clean. Closes the last addressable Phase-8 verification finding; backlog now fully resolved on this host (remainder is user-gated GPU/token only). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c647fe9 -
docs: commit the Wave-2/3 review + Phase-8 verification audit trail (JSON findings)
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>b1adfc9 -
Wave 2: 4 new modules (kill-switch, EKS/SageMaker executors, DockerSandbox) + B4/B7 completion
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)Built by the parallel execution team (worktree-isolated), integrated + tested here. New modules (all CPU-testable via mock/lazy-import; optional deps gated): - composer_replication/safety/ — HeldOutGuard run-level collapse kill-switch (held-out-declines-while-reward-rises streak + KL-to-init hard-stop 0.08 + proxy-real hacking-gap; EMA-denoised, latched-fire, CollapseStopError). The documented #2 safeguard for the self-evolving flywheel. 23 tests. - composer_replication/diloco/serverless/eks.py — EKSExecutor satisfying the ServerlessExecutor Protocol via a SINGLE Kubernetes Indexed Job → N rank-ordered ReplicaHandles, gang-cancel (Background propagation), REPLICA_RANK via the downward API, S3 rendezvous (IRSA). 28 tests (mock BatchV1/CoreV1). - composer_replication/diloco/serverless/sagemaker.py — SageMakerExecutor (boto3 create_training_job, same S3 rendezvous, status mapping). +13-test module written during integration (the build agent shipped it test-less). - compos…7a55e1e -
Wave 1: fix 8 failing tests + unblock Docker E2E + dep/doc debt
Baladithya Balamurugan +1: Claude Opus 4.8 (1M context)Backlog-resolution Wave 1 (branch backlog/goal-resolution-2026-06). Bugs fixed: - B1 (P0): generate spikes/007 synthetic_session_with_error.jsonl fixture (never committed — .gitignore *.jsonl whitelisted the sibling but not this one) → the 8 failing test_trace_examples_adapter tests now pass. Added the missing .gitignore whitelist line. - B2 (P2): [dev] extra was un-installable on Apple Silicon (pulled Linux-only torchft-nightly). Dropped diloco from base [dev]; added [dev-full] for Linux. - B3 (P2): [serverless] extra now includes s3fs/boto3/kubernetes (needed for real S3 rendezvous + the EKSExecutor/SageMakerExecutor adapters). Newly unblocked: - D1 (…-245d): Docker substrate E2E — Docker now available on host; both gates (4-gate substrate inversion + cache-scrub-in-container) PASS. Long-standing "hardware-blocked" item closed. Doc/API debt: - B4: reconciled divergent test counts (115/176/210/232) to one canonical figure measured this session: 266 passed / 62 skipp…c11cf49
-
architect: ADR-011/012/013 + research (alignment-index fix, review-findings closure, LMA channel-ladder)
b4a584a -
research: Composer 2.5 data-gen + targeted-textual-feedback deep-research wave
Phase-3 of the deep-work-loop bringing Composer 2.5's dataset-generation and targeted-RL-with-textual-feedback methods into the framework. 5 new research docs (130KB), all with primary-source citations: - 06-feature-deletion-datagen.md: Feature Deletion env design (online pass-rate difficulty gate, reward-hacking safeguards, 5 OSS substrates w/ HF ids + licenses, deletion mechanics, FeatureDeletionEnv + TRL reward_fn adapter). - 07-sdpo-hint-generator.md: layered HintGenerator (template -> raw-error -> LLM-judge -> introspection -> learned -> SDPO sibling-bootstrap), actual template strings, judge prompt, slots into existing CollatorConfig hook. - 08-sdpo-grpo-integration.md: ComposerGRPOTrainer(GRPOTrainer) design adding SDPO KL at error turns on top of Dr. GRPO; PRIME-RL recipe blocked (log-probs only), TRL subclass is the host; CPU smoke plan. - 09-composer-blog-delta-2026.md: blog re-extraction delta; found the Composer 2 arXiv tech report; SDPO successful-rollout-as…6049d00
-
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