# ml-mebp **Repository Path**: mirrors_apple/ml-mebp ## Basic Information - **Project Name**: ml-mebp - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-10-31 - **Last Updated**: 2026-03-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Memory-Efficient Backpropagation for Fine-Tuning LLMs on Resource-Constrained Mobile Devices This is a demo implementation for [Memory-Efficient Backpropagation for Fine-Tuning LLMs on Resource-Constrained Mobile Devices ](https://arxiv.org/abs/2510.03425). The implementation is based on [MLX](https://github.com/ml-explore/mlx) and includes: 1. Exporting Qwen3 model to MLX graphs for fine-tuning with QLoRA. 2. On-device Memory-Efficient Backpropagation (MeBP) runtime implementation. 3. Example iOS App for running MeBP on Qwen3. ## Getting Started: End-to-End Example of Fine-tuning Qwen3 ### Step 1: Export Qwen3 model 1. Run notebook in [examples/export_qwen3.ipynb](examples/export_qwen3.ipynb) to export Qwen3 model. 2. The notebook will generate model assets at output directory specified (default to data/qwen3) ### Step 2: Build MLXMeBPExample App in Xcode on the iPhone 1. Connect your iPhone to your MacBook 2. Open MLXMeBPExample/MLXMeBPExample.xcodeproj in Xcode 3. Build the App on your iPhone ### Step 3: Copy Qwen3 Assets to MLXMeBPExample's Directory on the iPhone 1. Open Finder App on your MacBook and find your connected iPhone on the left 2. Click Files in Finder which shows a list of Apps installed on your iPhone 3. Find MLXMeBPExample App and drag the Qwen3 directory to the Apps' directory ### Step 4: Run Training on iPhone 1. Open MLXMeBPExample App on your iPhone 2. Click Initialize Model 3. Click Start Training
Alt text Alt text Alt text