Introduction
In today’s corporate world, email has become an essential tool for communication. It's not only used by companies, it has become a part of everyone's life. However, it’s not easy to manage a large email inbox every day, either for individuals or for businesses.
In this blog post, we will explore AI assisted emailing with Large Language Models (LLMs), particularly Radiantloom Email Assist 7b. For there has been mounting evidence suggesting that smaller open access / open-source models are outperforming GPT-4 on specific tasks.
Radiantloom Email Assist 7b is the optimal email assistant. It’s a large language model which can help you summarize, organize, and manage your email. Just by its name, you can understand that this model contains 7 billion parameters. It is fine-tuned on Zephyr-7B Beta model, and it has been trained on a custom-curated dataset of 1,000 email-assistant summarization tasks.
Radiantloom is an AI-powered platform that helps businesses automate their workflows and improve their customer service. It offers a variety of services, like email assistance, customer support products and so on, powered by its proprietary large language models, which have been trained on a massive dataset of text and code.
Let's give a brief introduction to Zephyr-7B Beta as our email assistant LLM is fine-tuned over it.
Zephyr-7B Beta
Zephyr is a series of language models which have been trained to act as helpful assistants. Zephyr-7B-β is the second model in the series, and is a fine-tuned version of mistralai/Mistral-7B-v0.1 that was trained on a mix of publicly available, synthetic datasets using Direct Preference Optimization (DPO).
All of these are decoder type models of transformers. Unlike encoder-decoder models, which process both input and output sequences, decoder-only models process the output sequence only. This makes them well-suited for tasks such as text generation, translation, and question-answering. This requires only two different kinds of input:
An Initial Prompt
An initial prompt is a brief text that offers context for the task at hand. In a generation task, this prompt might describe the task itself, demonstrating how we can employ zero-shot learning, even when some input data is available. This approach allows us to utilize these models in a few-shot manner.
Let's have a look at the prompt template for Radiantloom email assist:
The notation ‘<s>’ usually indicates the start of a section or a tag used to signify a specific type of content or formatting. ‘[INST]’ stands for ‘instruction’, denoting a specific set of instructions or guidelines to follow. ‘<<SYS>>’ could indicate a system message or instruction within a structured conversation or script. These tags help organize and interpret different parts of a document or conversation for easier understanding or processing.
Previous Word/Getting Context
Generating the first word is the most difficult. This type of model first understands the prompt about the task and it already has access to a vast vocabulary, learned from the training data. It utilizes this vocabulary to generate a list of potential first words that align with the context and the overall tone of the text. Then it uses statistical methods to calculate the probability of each potential first word and pick the one with the highest probability.
Once it generates the first word, it only takes the prompt and the previous word.
Radiantloom Email Assist 7b Features
This LLM offers a vast number of features that can help you become efficient and increase your productivity. Just by using a proper prompt you can use these features, which include:
● Email Summarization: This LLM is trained on generating automated crisp summaries of your emails. With this, you can quickly grasp the nature of your emails and identify key action items, saving time and enhancing your productivity.
● Voice Memo Conversion: This model can convert your emails into voice memos, which allows you to catch up on relevant information in the middle of multi-tasking.
● Chat Message Conversion: This model is also capable of converting your emails into chat messages, which you can use to communicate with colleagues or customers.
Use Cases
Radiantloom Email Assist 7b can be used by a large number of individuals and organizations. Here I have given a few examples:
● Busy Professionals: These LLMs can help busy professionals save time and improve their productivity by summarizing emails and organizing inboxes, helping to find the gist of specific emails quickly.
● Salespeople: Radiantloom Email Assist 7b can help salespeople communicate more effectively with customers by providing solid summaries of emails and converting emails into voice memos or chat messages.
● Customer Service Representatives: This model can also help customer service representatives provide better service by helping them find specific emails quickly and providing summaries of customer inquiries.
Now, let’s do a deep dive into using the model and see how it performs with an example email.
AI Assisted Emailing
Launch a GPU node on E2E Networks.
Installing Dependencies
Import Required Libraries
Loading the Model
We are loading the model in 4 bit quantization for causal language modeling. bnb_config defines a BitsandBytesConfig with specific settings for quantization. Have a look at the comments in the above script of the function load_quantized_model for understanding more about bnb_config. This function essentially configures and loads a pre-trained model with specific quantization settings (4-bit quantization using bfloat16 data type) for efficient and optimized causal language modeling tasks.
Initializing the Tokenizer
Loading the Model and Tokenizer
Now, as our model is ready for generating some cool output, let's take an example email conversation and instruct the model to provide a clear and concise summary with action items in 50 words.
In the below prompt template you can observe that with <<SYS>> token, we are giving instruction to the model.
Specifying the Prompt
Inferencing the Model
The below code snippet performs text generation using a pre-trained language model based on the input prompt. Let's break down each step:
Radianloom Email Assist Output
Summary: Alex provides an update on the marketing campaign, highlighting the completion of market research and the need for content strategy refinement. He requests Emily's feedback on the social media content plan and suggests scheduling a meeting to finalize the strategy.
Action Items
- Review the proposed social media content plan.
- Suggest improvements or additions aligned with campaign objectives.
- Schedule a meeting with Alex to discuss the updates and finalize the strategy.
Wow, beautiful, right? Now let us compare this with the ChatGPT-3.5’s response and see whether a smaller fine-tuned model can outperform an LLM trained on a substantially large amount of data.
We can see the clear difference between the summarization and action item generation capability of Radiantloom and ChatGPT.
Now, let's integrate it with LangChain and build a ready-to-serve pipeline for the email assistant.
LangChain Integration
Importing LangChain Libraries
Configuring Hugging Face Pipeline
Running the Chain
<|assistant|>
"Alex here with a project update. We've completed initial market research and identified key demographics. Next, we're finalizing social media content and messaging for our product launch. Emily, your input on the content strategy is crucial. Please review the plan and suggest improvements. Let's schedule a meeting this week to finalize the strategy. Thanks, Alex."
Action Items:
- Review the social media content plan.
- Suggest improvements and additions.
- Schedule a meeting with Alex this week.
Evaluation
Evaluating large language model (LLM) based chat assistants is challenging due to their broad capabilities and the inadequacy of existing benchmarks in measuring human preferences. Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena - this paper established a method to address these issues and the Radiantloom Email Assist model received good results, according to initial assessments, with the utilization of GPT-4.
Conclusion
Radiantloom Email Assist 7b is a powerful tool that can help you to be efficient, improve your productivity, and communicate more effectively. If you are looking to manage your email inbox more effectively, I suggest you try Radiantloom Email Assist 7b.