--- base_model: microsoft/Phi-4-mini-instruct library_name: peft tags: - phi-4-mini - LoRA - peft - adapter - intent-sequencing - DSL - robotics - robotic-arm - interactive-agents license: mit datasets: - a6188466/dia-intent-sequencer-robot-arm-dataset language: - en --- # 🤖 Model Card for `dia-intent-sequencer-robot-arm-adapter` ## 🧠 Model Details This model is a parameter-efficient fine-tuning (PEFT) LoRA adapter, designed as a **demonstration and testbed** to evaluate intent sequencing using the [DIA DSL module](https://github.com/gh9869827/fifo-dev-dsl/tree/main/fifo_dev_dsl/dia) with a custom robotic arm I built for experimentation. It fine-tunes `microsoft/Phi-4-mini-instruct` to act as an intent sequencer for controlling that arm as it manages an inventory of screws. Specifically, the adapter evaluates the model's capability to: - 🔄 Attempt to dynamically resolve missing or ambiguous parameters using runtime-accessible context - 🧠 Clarify intent through multi-turn interaction - 🛠 Map natural language instructions to executable tool calls for physical actions It is provided for demonstration and experimentation purposes only. - **Model type:** LoRA adapter (PEFT) - **Language(s):** English - **License:** MIT - **Finetuned from model:** `microsoft/Phi-4-mini-instruct` 📺 Here's a short demo video: [![Demo Video](https://img.youtube.com/vi/wbdLcn9Wizc/hqdefault.jpg)](https://www.youtube.com/watch?v=wbdLcn9Wizc) ## 🚀 Uses This adapter fine-tunes `Phi-4-mini-instruct` to convert user commands for controlling my custom robotic arm, which manages an inventory of screws, into structured tool calls using the DIA DSL. For an example of how this model can be used in a demo environment, see [`robot_arm.py`](https://github.com/gh9869827/fifo-dev-dsl/blob/main/fifo_dev_dsl/dia/demo/robot_arm.py). ## 🏗️ Training Details Trained on [a6188466/dia-intent-sequencer-robot-arm-dataset](https://huggingface.co/datasets/a6188466/dia-intent-sequencer-robot-arm-dataset) using the `dsl` adapter from [`fifo-tool-datasets`](https://github.com/gh9869827/fifo-tool-datasets) and [`fine_tune.py`](https://github.com/gh9869827/fifo-tool-airlock-model-env/blob/main/fifo_tool_airlock_model_env/fine_tuning/phi_4/fine_tune.py). - **Dataset:** 210 curated examples designed for my custom robotic arm handling an inventory of screws - **Epochs:** 42 - **Batch size:** 1 - **Precision:** bf16 - **Framework:** `transformers`, `peft`, `trl` (SFTTrainer) ### ⚙️ Training Hyperparameters ```json { "num_train_epochs": 42, "train_batch_size": 1, "learning_rate": 5e-06, "lr_scheduler_type": "cosine", "warmup_ratio": 0.2, "bf16": true, "seed": 0 } ``` ### 📈 Training Results ```json { "mean_token_accuracy": 0.9903121322393418, "total_flos": 5.500569475886285e+16, "train_loss": 0.2587171609439547, "train_runtime": 2130.5227, "train_samples_per_second": 4.14, "train_steps_per_second": 4.14, "final_learning_rate": 2.4779503893235247e-13 } ``` ## ✅ Evaluation - **Two types of evaluation were performed**: 1. **Live evaluation on the robot** Intent-to-action translation was tested directly on my robot. The goal was to verify that the generated DSL produced the expected behavior by comparing the robot's actual actions to expected outcomes. 2. **Held-out test set** Since DSL evaluation normally requires execution or simulation on the robot, the tool [`robot_arm_eval_performance.py`](https://github.com/gh9869827/fifo-dev-dsl/blob/main/fifo_dev_dsl/dia/demo/robot_arm_eval_performance.py) was used to process the [test set](https://huggingface.co/datasets/a6188466/dia-intent-sequencer-robot-arm-dataset) and compare DSL outputs. Manual review was conducted for mismatches to assess **functional equivalence**. - **Results**: - On the held-out test set (26 examples covering my robotic arm functions and inventory logic): - ✅ 20 were exactly as expected - 🔄 3 were functionally equivalent and resulted in the same execution path - ⚠️ 3 were functionally equivalent but used a **suboptimal execution path** - Live evaluation demonstrated **acceptable performance** These results suggest that the DIA DSL has potential for controlling my custom robotic arm that manages a screw inventory. ## ⚠️ Disclaimer & Limitations This adapter is intended solely as a **demonstration and testbed** for the [DIA DSL module](https://github.com/gh9869827/fifo-dev-dsl/tree/main/fifo_dev_dsl/dia), showcasing its potential for controlling my custom robotic arm that manages a screw inventory. It should not be used beyond that scope. This adapter is provided *as is*, without warranties or guarantees of any kind. It is intended for demonstration and experimentation only. ## 🪪 License This repository contains the weights and configuration for a LoRA adapter derived from `microsoft/Phi-4-mini-instruct` (the base model). - The base model was created by Microsoft Corporation and is licensed under the MIT License (see [LICENSE.microsoft](LICENSE.microsoft)). - The adapter weights, configuration, and documentation in this repository are licensed under the MIT License (see [LICENSE](LICENSE)). ## 📬 Contact For questions, feedback, or bug reports, please open an issue on GitHub or start a discussion on the Hugging Face Hub.