You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

phi-3-M3-general: A Powerful, Generalized Language Model

License

phi-3-M3-general is a state-of-the-art causal language model featuring a proprietary architecture that enables advanced reasoning and self-correction. This model is an evolution of our highly specialized M3-V2 model, now enhanced for broader capabilities across math, coding, and general text generation.

This model is not open source and is available for commercial licensing.

While its predecessor was fine-tuned for a singular task, phi-3-M3-general demonstrates a significant accuracy increase across a diverse set of benchmarks. It achieves a 96.34% Pass@1 score on the HumanEval benchmark, making it a formidable tool for a wide range of AI-driven applications.


Benchmark Performance: Generalization vs. Specialization

The development of phi-3-M3-general focused on creating a more versatile and broadly applicable model. While its HumanEval score is slightly different from its predecessor, this reflects a strategic trade-off for enhanced performance in mathematics and general text, making it a more powerful all-around tool.

Performance Comparison

Model HumanEval Pass@1 Score Note
moelanoby/phi-3-M3-general (This Model) 96.34% Generalized Model: Strong performance in code, math, and text.
moelanoby/phi3-M3-Coder (Previous Model) 98.17% Highly specialized for code generation, less accurate in other domains.

License and Terms of Use

This model is proprietary and is governed by the following custom terms. By accessing or using this model, you agree to be bound by these rules.

  1. Architecture Non-Derivability: The underlying code and architectural design, including the architecture.py file, are proprietary and represent a trade secret. You are strictly prohibited from reverse-engineering, copying, or integrating this architecture or its components into any other model or software.

  2. Commercial License Required: Access to and use of this model require a paid commercial license. Unauthorized use, distribution, or access is strictly forbidden and will be subject to legal action.

  3. Ethical Use and Finetuning Restriction: You may not finetune, train, or adapt this model on any dataset intended to remove ethical safeguards, promote illegal acts, or generate uncensored content. The model must be used in accordance with safety and ethical best practices.


How to Get Access

This model is available for commercial use via a paid license.

To purchase a license and gain access to the model, please contact me:

Email: [email protected]

Payment: PAY WITH PAYPAL

REMEMBER: YOU MUST TELL ME YOUR USERNAME IN HUGGING FACE AND IN PAYPAL WHEN EMAILING ME (to prevent Scams)

You will be provided with access credentials and usage instructions upon completion of the licensing agreement.


Technical Usage (For Licensed Users)

Note: The following instructions are for licensed users only. Running this code without a valid commercial license is a violation of the terms of use.

Installation

First, ensure you have the necessary libraries installed:

pip install torch transformers accelerate

Python Implementation

After gaining access, you can integrate the model into your application. You must use trust_remote_code=True for the proprietary architecture to load correctly.

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

# Use the private model ID and token provided with your license
MODEL_ID = "moelanoby/phi-3-M3-general"
# AUTH_TOKEN = "YOUR_HF_ACCESS_TOKEN_HERE" # Required for private models

print("Loading tokenizer and model...")
tokenizer = AutoTokenizer.from_pretrained(
    MODEL_ID, 
    trust_remote_code=True, 
    # token=AUTH_TOKEN
)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    trust_remote_code=True,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    # token=AUTH_TOKEN
)
print("Model loaded successfully.")

# --- Controlling the model's proprietary reasoning feature ---
# This feature is a key part of your license.
# The default is 1 self-correction pass.
try:
    target_layer_path = "model.layers.15.mlp.gate_up_proj" 
    custom_layer = model
    for part in target_layer_path.split('.'):
        custom_layer = getattr(custom_layer, part)
        
    # We recommend 2 self-correction passes for the best balance of performance.
    custom_layer.num_correction_passes = 2 
    print(f"โœ… Number of reasoning passes set to: {custom_layer.num_correction_passes}")
except AttributeError:
    print("โš ๏ธ Could not access the custom layer. The model will run with its default settings.")

# (Example generation code would follow here)

Notes on Self-Correction

  • Recommendation: We recommend using 1 or 2 self-correction passes. The setting of 2 generally provides the best balance of accuracy and coherence.
  • Downside: As you increase the number of passes (e.g., to 3 or more), the model may become less coherent or accurate for certain tasks.

Acknowledgements

  • The base of this model utilizes the Phi-3 architecture developed by Microsoft.
  • The benchmark results were obtained using the HumanEval dataset from OpenAI.
Downloads last month
10
Safetensors
Model size
3.83B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for moelanoby/phi-3-M3-general

Finetuned
(310)
this model