Bge-m3 Embedding Model Now Available on Novita AI

BGE M3 ON NOVITA AI

Key Highlights

Embedding Models: Embedding models are crucial for transforming complex data into numerical representations, enabling AI to understand and process information efficiently.

BAAI/bge-m3: The bge-m3 model offers multi-functionality, supports over 100 languages, and handles both short texts and long documents (up to 8192 tokens). Its versatility and efficiency make it ideal for a wide range of AI tasks.

The powerful bge-m3 embedding model is available on Novita AI, only $0.01/M tokens. Start a free trail on Novita AI!

Embeddings are a cornerstone of modern machine learning, empowering AI systems to comprehend and process complex data with efficiency. This article delves into what embeddings are, why they are essential, how they are applied, and how advanced models like BAAI/bge-m3 elevate embedding capabilities to drive innovation.

Understanding Embeddings

Embeddings are sophisticated numerical representations that allow machine learning and AI systems to comprehend complex knowledge domains. They transform real-world objects into mathematical representations that capture intrinsic properties and relationships within data.

Vector Representations

At the core of these embeddings lies the concept of vectors. Machine learning models process information numerically. Vectors—sets of numerical values in multi-dimensional space—enable these models to identify similarities among dispersed data points. This numerical representation is crucial because embedding vectors specifically encode non-numerical information into value sequences that machine learning systems can process and relate.

vector embedding
From Qdrant

How Embeddings Are Created

Engineers leverage neural networks to generate embeddings through the following process:

  1. Input Preparation: Vectorized samples are fed into the neural network.
  2. Learning Patterns: The neural network identifies patterns in the data, learning from these to make accurate predictions on unseen data.
  3. Fine-Tuning: The model is fine-tuned to appropriately map input features into the desired dimensional space.
  4. Independent Operation: The embeddings function independently, enabling machine learning models to generate recommendations based on the vectorized representations.
  5. Continuous Optimization: The model is monitored and fine-tuned regularly with new data to maintain accuracy and adaptability.
HOW EMBEDDING MODELS WORK
From Linkedin

Metrics for Choosing Embeddings

Evaluation Dimension Description
Retrieval Performance Assessed using tasks that evaluate the model’s ability to retrieve relevant information.
Semantic Understanding Measures the model’s ability to capture semantic information at word, phrase, and sentence levels.
Task-Specific Performance Evaluates performance in NLP tasks like classification, clustering, and similarity computation.
Model Size Balances the trade-off between model size and performance for scalability.
Generalization Ability Tests the model’s performance on unseen data for adaptability in new scenarios.

Understanding BAAI/bge-m3 Embedding Model

Model Name baai/bge-m3
Input/Output Price (Novita) Input: $0.01/million tokens
Context Size 8192
Extra Parameters Embedding model: 1024 dimensions
Key Features Multi-Functionality: Supports dense retrieval, multi-vector retrieval, and sparse retrieval.
Multi-Linguality: Supports over 100 languages.
Multi-Granularity: Handles inputs ranging from short sentences to long documents (up to 8192 tokens).
Simultaneously generates token weights and dense embeddings.

The figure below shows a performance comparison with mE5 (Best Baseline) and OpenAI”s recently released vector model APIs. Overall, BGE-M3(ALL) using three combined retrieval methods achieves comprehensive leads across all three evaluations, while BGE-M3(Dense) for dense retrieval demonstrates significant advantages in multilingual and cross-lingual retrieval tasks.

bge m3 benchmark
MKQA OF BGEM3
Cross-lingual retrieval performance on MKQA (measured by Recall@ 100) from Hugging Face
MULTILINGUAL OF BGE M3
Multi-lingual retrieval performance on the MIRACL dev set (measured by nDCG@10) from Hugging Face
MLDR OF BGE M3
Evaluation of multilingual long-doc retrieval on the MLDR tesst set (measured by nDCG@10) from Hugging Face

Why Are Embeddings Important?

  • Enhanced Data Understanding: Embeddings allow deep-learning models to better comprehend real-world data by simplifying its representation while preserving semantic and syntactic relationships.
  • Dimensionality Reduction: They transform high-dimensional data into a low-dimensional space, significantly reducing the computational resources and time needed to process raw data.
  • Improved Data Quality: Embeddings enhance data quality during the training of large language models (LLMs).
  • Enabling Innovative Applications: They serve as a foundation for new deep learning and generative AI applications.
  • Optimized Machine Learning Tasks: Embeddings are widely used as features in tasks such as document classification, sentiment analysis, and machine translation. By providing a rich, condensed representation of data, they improve the performance of machine learning algorithms.

Usage of Embeddings

  • Search: Ranking results based on their relevance to a query.
  • Clustering: Grouping text strings by similarity.
  • Recommendations: Suggesting items with related text strings.
  • Anomaly Detection: Identifying outliers with minimal similarity to others.
  • Diversity Measurement: Analyzing similarity distributions to measure diversity.
  • Classification: Categorizing text strings by their most similar label.
  • Question Answering: Retrieving answers using embeddings-based search.
  • Code Search: Enabling efficient search within codebases using embeddings.
  • Data Visualization: Transforming and visualizing high-dimensional data.

How to Access the BAAI/bge-m3 Model on Novita AI

Novita AI is an AI cloud platform that offers developers an easy way to deploy AI models using our simple API, while also providing the affordable and reliable GPU cloud for building and scaling.

Step 1: Log In and Access the Model Library

Log in to your account and click on the Model Library button.

Log In and Access the Model Library

Step 2: Choose Your Model and Start a Free Trail

Browse through the available options and select the model that suits your needs.

choose your model

Step 3: Get Your API Key

To authenticate with the API, we will provide you with a new API key. Entering the “Settings“ page, you can copy the API key as indicated in the image.

get api key

Step 4: Install the API

Install API using the package manager specific to your programming language.

install api

After installation, import the necessary libraries into your development environment. Initialize the API with your API key to start interacting with Novita AI LLM. This is an example of using chat completions API for python users.

from openai import OpenAI
import json
client = OpenAI(
    base_url="https://api.novita.ai/v3/openai",
    api_key="<Your API Key>",
)
model = "baai/bge-m3"
def get_embeddings(text, model="baai/bge-m3", encoding_format="float"):
    response = client.embeddings.create(
        model=model,
        input=text,
        encoding_format=encoding_format
    )
    return response
# Example usage
text = "The quick brown fox jumped over the lazy dog"
result = get_embeddings(text)
print(json.dumps(result.model_dump(), indent=2))
  

Upon registration, Novita AI provides a $0.5 credit to get you started!

If the free credits is used up, you can pay to continue using it.

Embeddings play a critical role in machine learning, allowing models to effectively understand and process complex data. Advanced models like BAAI/bge-m3 elevate these capabilities through multi-functionality and extensive language support, making them indispensable tools for driving AI innovation.

Frequently Asked Questions

What is an embedding?

An embedding is a technique used to convert input data into a vector of numerical values in a lower-dimensional space.

Why are embeddings important?

Embeddings simplify data representation, retain semantic and syntactic relationships, and enable deep-learning models to understand real-world data more effectively.

What is hybrid retrieval, and how does BAAI/bge-m3 support it?

Hybrid retrieval combines embedding and sparse retrieval methods, and BAAI/bge-m3 supports this approach for enhanced retrieval performance. You can use it on Novita AI!

Novita AI is the All-in-one cloud platform that empowers your AI ambitions. Integrated APIs, serverless, GPU Instance — the cost-effective tools you need. Eliminate infrastructure, start free, and make your AI vision a reality.

Recommend Reading


Discover more from Novita

Subscribe to get the latest posts sent to your email.

Leave a Comment

Scroll to Top

Discover more from Novita

Subscribe now to keep reading and get access to the full archive.

Continue reading