--- library_name: pytorch license: other tags: - llm - generative_ai - android pipeline_tag: text-generation --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/phi_3_5_mini_instruct/web-assets/model_demo.png) # Phi-3.5-Mini-Instruct: Optimized for Qualcomm Devices Phi-3.5-mini is a lightweight, state-of-the-art open model built upon datasets used for Phi-3 - synthetic data and filtered publicly available websites - with a focus on very high-quality, reasoning dense data. The model belongs to the Phi-3 model family and supports 128K token context length. The model underwent a rigorous enhancement process, incorporating both supervised fine-tuning, proximal policy optimization, and direct preference optimization to ensure precise instruction adherence and robust safety measures. This is based on the implementation of Phi-3.5-Mini-Instruct found [here](https://huggingface.co/microsoft/Phi-3.5-mini-instruct). This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/phi_3_5_mini_instruct) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary). Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device. ## Deploying Phi-3.5-mini-instruct on-device Please follow the [LLM on-device deployment](https://github.com/quic/ai-hub-apps/tree/main/tutorials/llm_on_genie) tutorial. ## Getting Started Download pre-exported model assets from **[Phi-3.5-Mini-Instruct on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/phi_3_5_mini_instruct)**. ## Model Details **Model Type:** Model_use_case.text_generation **Model Stats:** - Input sequence length for Prompt Processor: 128 - Context length: 4096 - Number of parameters: 3.8B - Precision: w4a16 + w8a16 (few layers) - TTFT: Time To First Token is the time it takes to generate the first response token. This is expressed as a range because it varies based on the length of the prompt. The lower bound is for a short prompt (up to 128 tokens, i.e., one iteration of the prompt processor) and the upper bound is for a prompt using the full context length (4096 tokens). - Response Rate: Rate of response generation after the first response token. ## Performance Summary | Model | Runtime | Precision | Chipset | Context Length | Response Rate (tokens per second) | Time To First Token (range, seconds) |---|---|---|---|---|---|--- | Phi-3.5-Mini-Instruct | QNN_CONTEXT_BINARY | w4a16 | Snapdragon® 8 Elite Mobile | 4096 | 14.73 | 0.1195948 - 3.8270336 | Phi-3.5-Mini-Instruct | QNN_CONTEXT_BINARY | w4a16 | Snapdragon® X Elite | 4096 | 6.2 | 0.185833 - 5.946656 | Phi-3.5-Mini-Instruct | QNN_CONTEXT_BINARY | w4a16 | Snapdragon® 8 Gen 3 Mobile | 4096 | 13.01 | 0.1469056 - 4.7009792 ## License * The license for the original implementation of Phi-3.5-Mini-Instruct can be found [here](https://huggingface.co/microsoft/Phi-3.5-mini-instruct/blob/main/LICENSE). ## References * [Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone](https://arxiv.org/abs/2404.14219) * [Source Model Implementation](https://huggingface.co/microsoft/Phi-3.5-mini-instruct) ## Community * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI. * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com). ## Usage and Limitations This model may not be used for or in connection with any of the following applications: - Accessing essential private and public services and benefits; - Administration of justice and democratic processes; - Assessing or recognizing the emotional state of a person; - Biometric and biometrics-based systems, including categorization of persons based on sensitive characteristics; - Education and vocational training; - Employment and workers management; - Exploitation of the vulnerabilities of persons resulting in harmful behavior; - General purpose social scoring; - Law enforcement; - Management and operation of critical infrastructure; - Migration, asylum and border control management; - Predictive policing; - Real-time remote biometric identification in public spaces; - Recommender systems of social media platforms; - Scraping of facial images (from the internet or otherwise); and/or - Subliminal manipulation