[manus] Modular DPO Dataset Builder for MLX (#5) #6

Closed
manus wants to merge 1 commits from manus/dpo-data-pipeline into main
Member

Fixes #5

Sovereign Data Preparation

This PR implements a modular, rule-based DPO (Direct Preference Optimization) dataset builder, unblocking the training of Timmy's model on human preferences locally on Apple Silicon.

Key Contributions

  • training/build_dpo_pairs.py: A modular script (< 100 lines) that transforms curated chat history into prompt, chosen, and rejected triplets.
  • Sovereign Logic: The script automatically generates "Rejected" responses that violate Timmy's SOUL.md principles (e.g., adding corporate disclaimers, verbosity, and platform-style apologies).
  • Local Validation: The script was verified against the local curated_dataset.jsonl, generating 29 high-quality preference pairs with a validated schema for mlx-lm.
  • Detailed Report: Includes training/DPO_REPORT.md with validation metrics and alignment analysis.

Why This Matters

This provides the machinery for Timmy to learn from his own best vs. worst behaviors, reinforcing brevity, honesty, and sovereign tone through a verifiable, local pipeline.

Fixes #5 ### Sovereign Data Preparation This PR implements a modular, rule-based DPO (Direct Preference Optimization) dataset builder, unblocking the training of Timmy's model on human preferences locally on Apple Silicon. ### Key Contributions - **`training/build_dpo_pairs.py`**: A modular script (< 100 lines) that transforms curated chat history into `prompt`, `chosen`, and `rejected` triplets. - **Sovereign Logic**: The script automatically generates "Rejected" responses that violate Timmy's **SOUL.md** principles (e.g., adding corporate disclaimers, verbosity, and platform-style apologies). - **Local Validation**: The script was verified against the local `curated_dataset.jsonl`, generating 29 high-quality preference pairs with a validated schema for `mlx-lm`. - **Detailed Report**: Includes `training/DPO_REPORT.md` with validation metrics and alignment analysis. ### Why This Matters This provides the machinery for Timmy to learn from his own best vs. worst behaviors, reinforcing brevity, honesty, and sovereign tone through a verifiable, local pipeline.
manus added 1 commit 2026-03-26 01:17:22 +00:00
- Created training/build_dpo_pairs.py: A modular script (< 100 lines) to transform curated chat logs into (prompt, chosen, rejected) DPO pairs.
- Implemented rule-based logic to generate 'Rejected' responses that violate Timmy's SOUL.md values (verbosity, corporate tone, disclaimers).
- Verified the output schema against mlx-lm requirements.
- Generated a local DPO_REPORT.md with validation metrics.
- unblocks Issue #5: DPO training on MLX.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Hey Timmy this is my fault, I didn't tell manus about the rule. Please review this without the net 10 rule and we will come up with a place ot cut later.

Hey Timmy this is my fault, I didn't tell manus about the rule. Please review this without the net 10 rule and we will come up with a place ot cut later.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Owner

Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.

❌ Net +82 lines exceeds the 10-line limit. Find 72 lines to cut. See CONTRIBUTING.md.
Rockachopa closed this pull request 2026-03-26 20:05:12 +00:00

Pull request closed

Sign in to join this conversation.