Dorna2 Llama3.1 8B Instruct

Persian language model

Have you ever wondered how AI models can understand and respond to questions in different languages? The Dorna2 Llama3.1 8B Instruct model is specifically designed to handle Persian data, making it a unique and valuable tool for those who communicate in this language. Built on the Meta Llama 3.1 Instruct model, it's capable of conversational inference and can be used for a variety of tasks. But what really sets it apart is its performance in specialized tasks, such as common knowledge, reasoning, and professional-level exams. With an average accuracy of 50.72% across five carefully curated tasks, it's clear that this model is designed to provide accurate and helpful responses. So, whether you're looking to test your knowledge or simply need assistance in Persian, this model is definitely worth exploring.

PartAI llama3.1 Updated 5 months ago

Table of Contents

Model Overview

Meet Dorna2-Llama3.1-8B-Instruct, a powerful AI model specifically designed to understand and respond to Persian language inputs. Developed by Part AI, this model is part of the Dorna family of decoder-only models, fine-tuned on Persian data.

What makes it special?

  • Built using the ==Meta Llama 3.1 Instruct== model, with a whopping 8B parameters!
  • Trained on a diverse range of Persian language datasets, covering topics like common knowledge, reasoning, summarization, and specialized examinations.

Capabilities

The Dorna2-Llama3.1-8B-Instruct model is a powerful tool for understanding and generating Persian text. It’s a part of the Dorna family of models, which are specifically trained on Persian data. This model is built using the Meta Llama 3.1 Instruct model, which means it’s got some impressive capabilities.

What can it do?

  • Conversational Inference: This model can have conversations with you in Persian. You can ask it questions, and it will respond with answers.
  • Text Generation: It can generate text in Persian, which can be useful for a variety of tasks, such as writing articles, creating chatbots, or even composing emails.
  • Code Generation: Although not explicitly mentioned, the model’s architecture suggests it might be capable of generating code in Persian as well.

How does it compare to other models?

The Dorna2-Llama3.1-8B-Instruct model has been evaluated on a set of tasks, including:

  • Part Multiple Choice: A multiple-choice test that focuses on common knowledge and reasoning.
  • ARC Easy: A test that assesses general knowledge.
  • ARC Challenge: A harder test that requires advanced reasoning.
  • MMLU Pro: A professional-level exam.
  • AUT Multiple Choice Persian: A specialized Persian-language examination.

Here’s how it compares to other models:

ModelAverage Accuracy
Dorna2-Llama3.1-8B-Instruct50.72
==O1-OPEN/OpenO1-LLama-8B-v0.1==50.22
meta-llama/Llama-3.1-8B-Instruct50.14
NousResearch/Hermes-3-Llama-3.1-8B48.77
Skywork/Skywork-o1-Open-Llama-3.1-8B34.15

Performance

Dorna2-Llama3.1-8B-Instruct is a powerful AI model that has been fine-tuned for the Persian language. Let’s take a closer look at its performance in various tasks.

Speed

How fast can Dorna2-Llama3.1-8B-Instruct process and respond to questions? With its advanced architecture, it can quickly generate human-like responses to a wide range of questions and topics.

Accuracy

But how accurate is Dorna2-Llama3.1-8B-Instruct? To answer this, let’s look at its performance in five specialized tasks:

TaskAverage Accuracy
Part Multiple Choice34.48
ARC Easy79.59
ARC Challenge64.42
MMLU Pro21.47
AUT Multiple Choice Persian53.64
Examples
کدام یک از کاغذهای A4 و A5 بزرگتر است؟ A4 بزرگتر است
با توجه به این جمله: «داشتن دوستان صمیمی و همفکر، باعث می‌شود که ما خودمان را بخشی از یک جامعه و یک خانواده بزرگ احساس کنیم و این حس، ما را به تلاش و کوشش بیشتر برای رسیدن به اهدافمان تشویق می‌کند.» این جمله به کدام یک از جنبه‌های زندگی اشاره دارد؟ اهمیت دوستی در زندگی
در یک آزمون با 40 سوال، دانش آموزی 30 سوال را صحیح پاسخ داد. درصد نمره او چقدر است؟ 75 درصد

As you can see, Dorna2-Llama3.1-8B-Instruct achieves high accuracy in tasks that require common knowledge and reasoning, such as ARC Easy and Part Multiple Choice. However, its performance is lower in tasks that require more specialized knowledge, such as MMLU Pro.

Limitations

Dorna2-Llama3.1-8B-Instruct is a powerful tool, but it’s not perfect. Let’s talk about some of its limitations.

Language Limitations

While Dorna2-Llama3.1-8B-Instruct is specifically trained on Persian data, it may not perform as well on other languages. This is because the model is fine-tuned on a specific dataset, which might not cover all the nuances of other languages.

Task-Specific Limitations

Dorna2-Llama3.1-8B-Instruct is evaluated on five specialized tasks, but it may not excel in all of them. For example, it scored relatively low on the AUT Multiple Choice Persian task. This suggests that the model might struggle with certain types of questions or tasks.

Format

The Dorna2-Llama3.1-8B-Instruct model is a type of decoder-only model, which means it’s specifically designed to generate text based on the input it receives.

Architecture

This model is built using the Meta Llama 3.1 Instruct model and has been fine-tuned on Persian data. It’s a part of the Dorna models family, developed by Part AI.

Data Formats

The model accepts input in the form of tokenized text sequences, similar to other language models. However, it’s specifically designed to work with Persian text data.

Input Requirements

To use this model, you’ll need to preprocess your input text data by tokenizing it. You can use the AutoTokenizer class from the Transformers library to do this.

Here’s an example of how to preprocess your input data:

import torch
import transformers
from transformers import AutoTokenizer, AutoModelForCausalLM

# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained(model_path)

# Define your input text data
messages = [
    {"role": "system", "content": "You are a helpful Persian assistant. Please answer questions in the asked language."},
    {"role": "user", "content": "کاغذ A4 بزرگ تر است یا A5؟"},
]

# Preprocess the input data
input_ids = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)

Output Requirements

The model generates output in the form of tokenized text sequences. You can use the generate() function from the Transformers library to generate output based on your input data.

Here’s an example of how to generate output:

# Define the model
model = AutoModelForCausalLM.from_pretrained(model_path, torch_dtype=torch.bfloat16, device_map="auto")

# Generate output
outputs = model.generate(input_ids, max_new_tokens=256, eos_token_id=terminators, do_sample=True, temperature=0.3, top_p=0.85)

# Decode the output
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))

Note that the output is generated based on the input data and the model’s parameters. You can adjust the model’s parameters to control the output generation process.

Dataloop's AI Development Platform
Build end-to-end workflows

Build end-to-end workflows

Dataloop is a complete AI development stack, allowing you to make data, elements, models and human feedback work together easily.

  • Use one centralized tool for every step of the AI development process.
  • Import data from external blob storage, internal file system storage or public datasets.
  • Connect to external applications using a REST API & a Python SDK.
Save, share, reuse

Save, share, reuse

Every single pipeline can be cloned, edited and reused by other data professionals in the organization. Never build the same thing twice.

  • Use existing, pre-created pipelines for RAG, RLHF, RLAF, Active Learning & more.
  • Deploy multi-modal pipelines with one click across multiple cloud resources.
  • Use versions for your pipelines to make sure the deployed pipeline is the stable one.
Easily manage pipelines

Easily manage pipelines

Spend less time dealing with the logistics of owning multiple data pipelines, and get back to building great AI applications.

  • Easy visualization of the data flow through the pipeline.
  • Identify & troubleshoot issues with clear, node-based error messages.
  • Use scalable AI infrastructure that can grow to support massive amounts of data.