Learning - 2023-02-16
An Introduction to Embeddings
Machine learning embeddings are capable of some seriously awesome things. Ever wonder how computers can translate language, magically recommend products or recognize the contents of an image?
There's a lot to unpack, so let's start with the basics and dive in!
What are embeddings?
In order for computers to understand real-world information, it has to be translated into the language they can understand – numbers.
An embedding is just that: a representation of real-world information in computer-readable numbers. These representations are called vectors - a list of numbers corresponding to real-world information.
Let’s say you want to represent the price of some items at a store:
- Guitar: $250
- Drums: $400
- Amplifier: $800
As a vector, the price for each item would be listed as:
[250, 400, 800]
Easy enough! But what if you want to represent the quantity of each item? Simply add it to the vector like so:
[[250, 4], [400, 6], [800, 9]]
By including the item quantity, we have added a second dimension to the vector (with item price being the first dimension). And this is where things start to get fun. Because we can add many more dimensions to the vector, thereby representing a lot of real-world information. The item’s color, if it has strings or not, electric or acoustic, and so on. Computers can track it all so we don’t have to.
Better still, we’re not limited by the type of information that can be turned into a vector – images, sounds, videos – it can all be vectorized.
But haven’t computers always understood information as numbers? What makes embeddings so special?
Embeddings are special because by reducing many different kinds of information into numbers, computers can compare how related these numbers are to each other. And computers can make a lot of comparisons.
This is how chatbots like GPT-3 came to exist. Enormous bodies of text from the internet were fed into machine learning models, which ran so many comparisons that they began to learn the semantics of language – or the intent of the words in the context with which they were used.
So what are some examples of embeddings in the real world?
It turns out that when you ask a computer to make certain comparisons you can do some pretty amazing things. A few examples:
- Using text to search a video library, down to the frame in each video
- Suggesting job candidates to a recruiter based on the combined text of a person’s Linkedin page, tweets, and blog posts
- Visualizing similar reviews of a restaurant to find the most satisfied customers
- Grouping users by in-app behaviors that lead to the highest retention
These are just a few examples, but you will be amazed by the innovative use cases that are created every day.
Metal – Embeddings as a Service
We hope this has helped you understand embeddings at a basic level – there's a lot more to learn! But the good news is that with Metal, you don't have to.
Our mission is to get this technology into the hands of anyone who wants to use it. We're calling this embeddings as a service. Metal handles the complexity, you get to build an awesome application.
If you would like to get started, sign up today and we will get in touch!