Granite 7b Instruct
Granite 7b Instruct is a cutting-edge AI model that leverages the Large-scale Alignment for chatBots (LAB) methodology to achieve remarkable performance. By using a novel synthetic data-based alignment tuning method, this model can add new knowledge and skills to an already pre-trained model without suffering from catastrophic forgetting. What sets Granite 7b Instruct apart is its ability to use a smaller teacher model, Mixtral-8x7B-Instruct, while still competing with larger models like ORCA-2 and WizardLM. This model excels in tasks such as text generation, question-answering, and conversation, making it a valuable tool for a wide range of applications. With its efficient design and ability to learn from a diverse set of knowledge-domains and skills, Granite 7b Instruct is a powerful and versatile AI model.
Deploy Model in Dataloop Pipelines
Granite 7b Instruct fits right into a Dataloop Console pipeline, making it easy to process and manage data at scale. It runs smoothly as part of a larger workflow, handling tasks like annotation, filtering, and deployment without extra hassle. Whether it's a single step or a full pipeline, it connects with other nodes easily, keeping everything running without slowdowns or manual work.
Table of Contents
Model Overview
Meet the Granite-7b-lab model, a powerful language model developed by IBM Research. This model is designed to be a helpful and harmless assistant, carefully following instructions and promoting positive behavior.
Capabilities
The Granite-7b-lab model is designed to perform a variety of tasks, including answering questions, generating text, and completing tasks that require reasoning and creativity. It’s a large language model that uses a novel approach called Large-scale Alignment for chatBots (LAB) to learn from a vast amount of synthetic data.
Primary Tasks
- Answering questions on a wide range of topics
- Generating text based on a prompt or topic
- Completing tasks that require reasoning and creativity
Performance
The Granite-7b-lab model has shown competitive performance with other models, such as ==Orca-2==, WizardLM, and ==Zephyr Beta==, despite being trained on a smaller scale.
Speed
- The model is trained using a novel synthetic data-based alignment tuning method called Large-scale Alignment for chatBots (LAB). This approach enables the model to learn new knowledge and skills incrementally, without suffering from catastrophic forgetting.
Accuracy
- The model achieves impressive accuracy in various tasks, including knowledge tuning and skills tuning.
Limitations and Risks
While the Granite-7b-lab model is designed to be helpful and harmless, it’s essential to note that:
- It may produce problematic outputs without adequate safeguards and safety alignment.
- There is a risk of malicious utilization for generating disinformation or harmful content.
- Smaller models like this one may be more susceptible to hallucination in ungrounded generation scenarios.
Format
The Granite-7b-lab model uses a Large-scale Alignment for chatBots (LAB) approach, which is a novel synthetic data-based alignment tuning method for LLMs. This model is based on the Granite-7b-base model and was trained using the Mixtral-8x7B-Instruct model as a teacher.
Model Architecture
The LAB approach consists of three key components:
- Taxonomy-driven data curation process: This process uses a tree of seed examples to prompt a teacher model to generate synthetic data.
- Large-scale synthetic data generator: This generator uses the taxonomy to drive the sampling process and create a diverse set of tasks.
- Two-phased-training with replay buffers: This training process consists of two phases: knowledge tuning and skills tuning.
Data Formats
The Granite-7b-lab model accepts input in the form of text sequences, and it’s primarily designed for English language. The model uses a specific prompt template, which includes a system prompt and a user input prompt.
sys_prompt = "You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."
prompt = f'<|system|>\\n{sys_prompt}\\n<|user|>\\n{inputs}\\n<|assistant|>\\n'
stop_token = '<|endoftext|>'
Special Requirements
- It’s recommended to use the system prompt employed during the model’s training for optimal inference performance.
- The model has not undergone any safety alignment, so it may produce problematic outputs. Caution is urged against complete reliance on this model for crucial decisions or impactful information.
Handling Inputs and Outputs
Here’s an example of how to handle inputs and outputs for the Granite-7b-lab model:
# Import the necessary libraries
import torch
from transformers import Granite7bLabForCausalLM, Granite7bLabTokenizer
# Initialize the model and tokenizer
model = Granite7bLabForCausalLM.from_pretrained('ibm/granite-7b-lab')
tokenizer = Granite7bLabTokenizer.from_pretrained('ibm/granite-7b-lab')
# Define the input prompt
input_prompt = "What is the capital of France?"
# Tokenize the input prompt
inputs = tokenizer(input_prompt, return_tensors='pt')
# Generate the output
outputs = model.generate(inputs['input_ids'], max_length=50)
# Convert the output to text
output_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Print the output
print(output_text)
Note that this is just an example, and you may need to adjust the code to fit your specific use case.