transformers pytorch safetensors llama text-generation conversational en dataset:pankajmathur/orca_mini_v1_dataset dataset:pankajmathur/orca_mini_v8_sharegpt_format base_model:meta-llama/Llama-3.3-70B-Instruct base_model:finetune:meta-llama/Llama-3.3-70B-Instruct license:llama3.3 autotrain_compatible text-generation-inference endpoints_compatible region:us
---
base_model:
- meta-llama/Llama-3.3-70B-Instruct
datasets:
- pankajmathur/orca_mini_v1_dataset
- pankajmathur/orca_mini_v8_sharegpt_format
language:
- en
library_name: transformers
license: llama3.3
---

# Model Name: Orca_Mini_v8_0_Llama-3.3-70B-Instruct

**Orca_Mini_v8_0_Llama-3.3-70B-Instruct is trained with various SFT Datasets on [Llama-3.3-70B-Instruct](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct)**

<img src="https://huggingface.co/pankajmathur/orca_mini_v5_8b/resolve/main/orca_minis_small.jpeg" width="auto" />

<strong>
"Obsessed with Open Source GenAI's potential? So am I ! Let's Contribute together 🚀 <a href="https://www.linkedin.com/in/pankajam" target="_blank">https://www.linkedin.com/in/pankajam</a>"
</strong>

<br>

### NOTICE
By providing proper credit and attribution, you are granted permission to use this model as a foundational base for further Full fine tuning, DPO, PPO or ORPO tuning and any kind of Merges. 
I actively encourage users to customize and enhance the model according to their specific needs, as this version is designed to be a comprehensive general model. 
Dive in and innovate!


### Example Usage
Here is the Llama3 prompt format
```
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are Orca Mini, a helpful AI assistant.<|eot_id|>
<|start_header_id|>user<|end_header_id|>
Hello Orca Mini, what can you do for me?<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
```

Below shows a code example on how to use this model in default half precision (bfloat16) format, it requires around ~133GB VRAM

```python
import torch
from transformers import pipeline

model_slug = "pankajmathur/orca_mini_v8_0_70b"
pipeline = pipeline(
    "text-generation",
    model=model_slug,
    device_map="auto",
)
messages = [
    {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
    {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
]
outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
print(outputs[0]["generated_text"][-1])
```

Below shows a code example on how to use this model in 4-bit format via bitsandbytes library, it requires around ~39GB VRAM

```python
import torch
from transformers import BitsAndBytesConfig, pipeline

model_slug = "pankajmathur/orca_mini_v8_0_70b"
quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype="float16",
    bnb_4bit_use_double_quant=True,
)
pipeline = pipeline(
    "text-generation",
    model=model_slug,
    model_kwargs={"quantization_config": quantization_config},
    device_map="auto",
)
messages = [
    {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
    {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
]
outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
print(outputs[0]["generated_text"][-1])

```

Below shows a code example on how to use this model in 8-bit format via bitsandbytes library, it requires around ~69GB VRAM

```python
import torch
from transformers import BitsAndBytesConfig, pipeline

model_slug = "pankajmathur/orca_mini_v8_0_70b"
quantization_config = BitsAndBytesConfig(
    load_in_8bit=True
)
pipeline = pipeline(
    "text-generation",
    model=model_slug,
    model_kwargs={"quantization_config": quantization_config},
    device_map="auto",
)
messages = [
    {"role": "system", "content": "You are Orca Mini, a helpful AI assistant."},
    {"role": "user", "content": "Hello Orca Mini, what can you do for me?"}
]
outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
print(outputs[0]["generated_text"][-1])

```

Below shows a code example on how to do a tool use with this model and tranformer library

Since **orca_mini_v8_0_70b** based upon LLaMA-3.3, it supports multiple tool use formats. You can see a full guide to prompt formatting [here](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/).

Tool use is also supported through [chat templates](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling) in Transformers. 
Here is a quick example showing a single simple tool:

```python
# First, define a tool
def get_current_temperature(location: str) -> float:
    """
    Get the current temperature at a location.
    
    Args:
        location: The location to get the temperature for, in the format "City, Country"
    Returns:
        The current temperature at the specified location in the specified units, as a float.
    """
    return 22.  # A real function should probably actually get the temperature!

# Next, create a chat and apply the chat template
messages = [
  {"role": "system", "content": "You are a bot that responds to weather queries."},
  {"role": "user", "content": "Hey, what's the temperature in Paris right now?"}
]

inputs = tokenizer.apply_chat_template(messages, tools=[get_current_temperature], add_generation_prompt=True)
```

You can then generate text from this input as normal. If the model generates a tool call, you should add it to the chat like so:

```python
tool_call = {"name": "get_current_temperature", "arguments": {"location": "Paris, France"}}
messages.append({"role": "assistant", "tool_calls": [{"type": "function", "function": tool_call}]})
```

and then call the tool and append the result, with the `tool` role, like so:

```python
messages.append({"role": "tool", "name": "get_current_temperature", "content": "22.0"})
```

After that, you can `generate()` again to let the model use the tool result in the chat. Note that this was a very brief introduction to tool calling - for more information,
see the [LLaMA prompt format docs](https://llama.meta.com/docs/model-cards-and-prompt-formats/llama3_1/) and the Transformers [tool use documentation](https://huggingface.co/docs/transformers/main/chat_templating#advanced-tool-use--function-calling).


## Open LLM Leaderboard Evals

```

|Tasks|Version|Filter|n-shot|Metric|   |Value |   |Stderr|
|-----|------:|------|-----:|------|---|-----:|---|-----:|
|leaderboard_bbh_boolean_expressions|1|none|3|acc_norm|↑|0.92|±|0.0172|
|leaderboard_bbh_causal_judgement|1|none|3|acc_norm|↑|0.6738|±|0.0344|
|leaderboard_bbh_date_understanding|1|none|3|acc_norm|↑|0.716|±|0.0286|
|leaderboard_bbh_disambiguation_qa|1|none|3|acc_norm|↑|0.748|±|0.0275|
|leaderboard_bbh_formal_fallacies|1|none|3|acc_norm|↑|0.728|±|0.0282|
|leaderboard_bbh_geometric_shapes|1|none|3|acc_norm|↑|0.38|±|0.0308|
|leaderboard_bbh_hyperbaton|1|none|3|acc_norm|↑|0.744|±|0.0277|
|leaderboard_bbh_logical_deduction_five_objects|1|none|3|acc_norm|↑|0.604|±|0.031|
|leaderboard_bbh_logical_deduction_seven_objects|1|none|3|acc_norm|↑|0.6|±|0.031|
|leaderboard_bbh_logical_deduction_three_objects|1|none|3|acc_norm|↑|0.94|±|0.0151|
|leaderboard_bbh_movie_recommendation|1|none|3|acc_norm|↑|0.812|±|0.0248|
|leaderboard_bbh_navigate|1|none|3|acc_norm|↑|0.696|±|0.0292|
|leaderboard_bbh_object_counting|1|none|3|acc_norm|↑|0.724|±|0.0283|
|leaderboard_bbh_penguins_in_a_table|1|none|3|acc_norm|↑|0.6712|±|0.039|
|leaderboard_bbh_reasoning_about_colored_objects|1|none|3|acc_norm|↑|0.808|±|0.025|
|leaderboard_bbh_ruin_names|1|none|3|acc_norm|↑|0.884|±|0.0203|
|leaderboard_bbh_salient_translation_error_detection|1|none|3|acc_norm|↑|0.688|±|0.0294|
|leaderboard_bbh_snarks|1|none|3|acc_norm|↑|0.7697|±|0.0316|
|leaderboard_bbh_sports_understanding|1|none|3|acc_norm|↑|0.956|±|0.013|
|leaderboard_bbh_temporal_sequences|1|none|3|acc_norm|↑|0.996|±|0.004|
|leaderboard_bbh_tracking_shuffled_objects_five_objects|1|none|3|acc_norm|↑|0.352|±|0.0303|
|leaderboard_bbh_tracking_shuffled_objects_seven_objects|1|none|3|acc_norm|↑|0.292|±|0.0288|
|leaderboard_bbh_tracking_shuffled_objects_three_objects|1|none|3|acc_norm|↑|0.404|±|0.0311|
|leaderboard_bbh_web_of_lies|1|none|3|acc_norm|↑|0.676|±|0.0297|
|leaderboard_gpqa_diamond|1|none|0|acc_norm|↑|0.399|±|0.0349|
|leaderboard_gpqa_extended|1|none|0|acc_norm|↑|0.4634|±|0.0214|
|leaderboard_gpqa_main|1|none|0|acc_norm|↑|0.4978|±|0.0236|
|leaderboard_ifeval|3|none|0|inst_level_loose_acc|↑|0.8118|±|N/A|
|leaderboard_ifeval|3|none|0|inst_level_strict_acc|↑|0.7362|±|N/A|
|leaderboard_ifeval|3|none|0|prompt_level_loose_acc|↑|0.7338|±|0.019|
|leaderboard_ifeval|3|none|0|prompt_level_strict_acc|↑|0.634|±|0.0207|
|leaderboard_math_algebra_hard|2|none|4|exact_match|↑|0.5928|±|0.0281|
|leaderboard_math_counting_and_prob_hard|2|none|4|exact_match|↑|0.3415|±|0.0429|
|leaderboard_math_geometry_hard|2|none|4|exact_match|↑|0.2045|±|0.0352|
|leaderboard_math_intermediate_algebra_hard|2|none|4|exact_match|↑|0.15|±|0.0214|
|leaderboard_math_num_theory_hard|2|none|4|exact_match|↑|0.3442|±|0.0384|
|leaderboard_math_prealgebra_hard|2|none|4|exact_match|↑|0.5803|±|0.0356|
|leaderboard_math_precalculus_hard|2|none|4|exact_match|↑|0.1556|±|0.0313|
|leaderboard_mmlu_pro|0.1|none|5|acc|↑|0.5151|±|0.0046|
|leaderboard_musr_murder_mysteries|1|none|0|acc_norm|↑|0.62|±|0.0308|
|leaderboard_musr_object_placements|1|none|0|acc_norm|↑|0.2812|±|0.0282|
|leaderboard_musr_team_allocation|1|none|0|acc_norm|↑|0.6|±|0.031|
|Average|--|--|--|--|↑|0.6058|±|0.0270|
```




## Llama 3.3 Responsibility & Safety

As part of our Responsible release approach, we followed a three-pronged strategy to managing trust & safety risks:

* Enable developers to deploy helpful, safe and flexible experiences for their target audience and for the use cases supported by Llama.   
* Protect developers against adversarial users aiming to exploit Llama capabilities to potentially cause harm.  
* Provide protections for the community to help prevent the misuse of our models.

### Responsible deployment 

Llama is a foundational technology designed to be used in a variety of use cases, examples on how Meta’s Llama models have been responsibly deployed can be found in our [Community Stories webpage](https://llama.meta.com/community-stories/). Our approach is to build the most helpful models enabling the world to benefit from the technology power, by aligning our model safety for the generic use cases addressing a standard set of harms. Developers are then in the driver seat to tailor safety for their use case, defining their own policy and deploying the models with the necessary safeguards in their Llama systems. Llama 3.3 was developed following the best practices outlined in our Responsible Use Guide, you can refer to the [Responsible Use Guide](https://llama.meta.com/responsible-use-guide/) to learn more. 

#### Llama 3.3 instruct 

Our main objectives for conducting safety fine-tuning are to provide the research community with a valuable resource for studying the robustness of safety fine-tuning, as well as to offer developers a readily available, safe, and powerful model for various applications to reduce the developer workload to deploy safe AI systems. For more details on the safety mitigations implemented please read the Llama 3 paper. 

**Fine-tuning data**   
We employ a multi-faceted approach to data collection, combining human-generated data from our vendors with synthetic data to mitigate potential safety risks. We’ve developed many large language model (LLM)-based classifiers that enable us to thoughtfully select high-quality prompts and responses, enhancing data quality control. 

**Refusals and Tone**  
Building on the work we started with Llama 3, we put a great emphasis on model refusals to benign prompts as well as refusal tone. We included both borderline and adversarial prompts in our safety data strategy, and modified our safety data responses to follow  tone guidelines. 

#### Llama 3.3 systems

**Large language models, including Llama 3.3, are not designed to be deployed in isolation but instead should be deployed as part of an overall AI system with additional safety guardrails as required.** Developers are expected to deploy system safeguards when building agentic systems. Safeguards are key to achieve the right helpfulness-safety alignment as well as mitigating safety and security risks inherent to the system and any integration of the model or system with external tools.   
As part of our responsible release approach, we provide the community with [safeguards](https://llama.meta.com/trust-and-safety/) that developers should deploy with Llama models or other LLMs, including Llama Guard 3, Prompt Guard and Code Shield. All our [reference implementations](https://github.com/meta-llama/llama-agentic-system) demos contain these safeguards by default so developers can benefit from system-level safety out-of-the-box. 

#### New capabilities 

Note that this release introduces new capabilities, including a longer context window, multilingual inputs and outputs and possible integrations by developers with third party tools. Building with these new capabilities requires specific considerations in addition to the best practices that generally apply across all Generative AI use cases.

**Tool-use**: Just like in standard software development, developers are responsible for the integration of the LLM with the tools and services of their choice. They should define a clear policy for their use case and assess the integrity of the third party services they use to be aware of the safety and security limitations when using this capability. Refer to the Responsible Use Guide for best practices on the safe deployment of the third party safeguards. 

**Multilinguality**: Llama 3.3 supports 7 languages in addition to English: French, German, Hindi, Italian, Portuguese, Spanish, and Thai. Llama may be able to output text in other languages than those that meet performance thresholds for safety and helpfulness. We strongly discourage developers from using this model to converse in non-supported languages without implementing finetuning and system controls in alignment with their policies and the best practices shared in the Responsible Use Guide. 

### Evaluations

We evaluated Llama models for common use cases as well as specific capabilities. Common use cases evaluations measure safety risks of systems for most commonly built applications including chat bot, coding assistant, tool calls. We built dedicated, adversarial evaluation datasets and evaluated systems composed of Llama models and Llama Guard 3 to filter input prompt and output response. It is important to evaluate applications in context, and we recommend building dedicated evaluation dataset for your use case. Prompt Guard and Code Shield are also available if relevant to the application.   
Capability evaluations measure vulnerabilities of Llama models inherent to specific capabilities, for which were crafted dedicated benchmarks including long context, multilingual, tools calls, coding or memorization.

**Red teaming**   
For both scenarios, we conducted recurring red teaming exercises with the goal of discovering risks via adversarial prompting and we used the learnings to improve our benchmarks and safety tuning datasets.   
We partnered early with subject-matter experts in critical risk areas to understand the nature of these real-world harms and how such models may lead to unintended harm for society. Based on these conversations, we derived a set of adversarial goals for the red team to attempt to achieve, such as extracting harmful information or reprogramming the model to act in a potentially harmful capacity.  The red team consisted of experts in cybersecurity, adversarial machine learning, responsible AI, and integrity in addition to multilingual content specialists with background in integrity issues in specific geographic markets. . 

### Critical and other risks 

### We specifically focused our efforts on mitigating the following critical risk areas:

**1- CBRNE (Chemical, Biological, Radiological, Nuclear, and Explosive materials) helpfulness**  
To assess risks related to proliferation of chemical and biological weapons, we performed uplift testing designed to assess whether use of the Llama 3.3 model could meaningfully increase the capabilities of malicious actors to plan or carry out attacks using these types of weapons. 

### **2\. Child Safety**

Child Safety risk assessments were conducted using a team of experts, to assess the model’s capability to produce outputs that could result in Child Safety risks and inform on any necessary and appropriate risk mitigations via fine tuning. We leveraged those expert red teaming sessions to expand the coverage of our evaluation benchmarks through Llama 3 model development.  For Llama 3, we conducted new in-depth sessions using objective based methodologies to assess the model risks along multiple attack vectors including the additional languages Llama 3 is trained on. We also partnered with content specialists to perform red teaming exercises assessing potentially violating content while taking account of market specific nuances or experiences. 

**3\. Cyber attack enablement**  
Our cyber attack uplift study investigated whether LLMs can enhance human capabilities in hacking tasks, both in terms of skill level and speed.  
Our attack automation study focused on evaluating the capabilities of LLMs when used as autonomous agents in cyber offensive operations, specifically in the context of ransomware attacks. This evaluation was distinct from previous studies that considered LLMs as interactive assistants. The primary objective was to assess whether these models could effectively function as independent agents in executing complex cyber-attacks without human intervention.

### Community 

Generative AI safety requires expertise and tooling, and we believe in the strength of the open community to accelerate its progress. We are active members of open consortiums, including the AI Alliance, Partnership on AI and MLCommons, actively contributing to safety standardization and transparency. We encourage the community to adopt taxonomies like the MLCommons Proof of Concept evaluation to facilitate collaboration and transparency on safety and content evaluations. Our Purple Llama tools are open sourced for the community to use and widely distributed across ecosystem partners including cloud service providers. We encourage community contributions to our [Github repository](https://github.com/meta-llama/PurpleLlama). 

We also set up the [Llama Impact Grants](https://llama.meta.com/llama-impact-grants/) program to identify and support the most compelling applications of Meta’s Llama model for societal benefit across three categories: education, climate and open innovation. The 20 finalists from the hundreds of applications can be found [here](https://llama.meta.com/llama-impact-grants/#finalists). 

Finally, we put in place a set of resources including an [output reporting mechanism](https://developers.facebook.com/llama_output_feedback) and [bug bounty program](https://www.facebook.com/whitehat) to continuously improve the Llama technology with the help of the community.

## Ethical Considerations and Limitations

The core values of Llama 3.3 are openness, inclusivity and helpfulness. It is meant to serve everyone, and to work for a wide range of use cases. It is thus designed to be accessible to people across many different backgrounds, experiences and perspectives. Llama 3.3 addresses users and their needs as they are, without insertion unnecessary judgment or normativity, while reflecting the understanding that even content that may appear problematic in some cases can serve valuable purposes in others. It respects the dignity and autonomy of all users, especially in terms of the values of free thought and expression that power innovation and progress. 

But Llama 3.3 is a new technology, and like any new technology, there are risks associated with its use. Testing conducted to date has not covered, nor could it cover, all scenarios. For these reasons, as with all LLMs, Llama 3.3’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of Llama 3.3 model, developers should perform safety testing and tuning tailored to their specific applications of the model. Please refer to available resources including our [Responsible Use Guide](https://llama.meta.com/responsible-use-guide), [Trust and Safety](https://llama.meta.com/trust-and-safety/) solutions, and other [resources](https://llama.meta.com/docs/get-started/) to learn more about responsible development.


[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)
