Granite 7b Instruct

Chatbot language model

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.

Ibm Granite apache-2.0 Updated 8 months ago

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.
Examples
Explain the concept of Large-scale Alignment for chatBots (LAB) in simple terms. LAB is a method for training AI chatbots to learn new skills and knowledge in a way that doesn't forget what they already know. It uses a special process to create practice data for the chatbot to learn from, and it helps the chatbot to be more accurate and helpful.
What are the key components of the LAB approach? The LAB approach has three main parts: a taxonomy-driven data curation process, a large-scale synthetic data generator, and a two-phased training process with replay buffers.
How does the LAB approach handle adding new domain-specific knowledge? The LAB approach uses an external knowledge source, such as a document, and prompts the model to generate questions and answers based on that document. This helps the model to learn new knowledge in a way that is grounded and safe.

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:

  1. Taxonomy-driven data curation process: This process uses a tree of seed examples to prompt a teacher model to generate synthetic data.
  2. Large-scale synthetic data generator: This generator uses the taxonomy to drive the sampling process and create a diverse set of tasks.
  3. 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.

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.