Introduction to Llama 3

Learn about LLMs, particularly the Llama 3 model, and how they work under the hood.

What are LLMs?

Large language models (LLMs) are deep learning models trained on large datasets like books and articles. They learn to understand the structure, pattern, and context of words in sentences and use this information to generate human-like text. Think of an LLM as a librarian who has read and understood millions of books and now uses that knowledge to write new content, such as stories or poems, or answer questions.

Press + to interact

LLMs are capable of performing a variety of natural language processing (NLP) tasks, such as text generation, text classification, language translation, and much more. They are groundbreaking advancements in the field of AI.

In recent years, there have been notable advancements in generative AI, resulting in the development of numerous accessible LLM models. Some of them are closed-source, for which the audience needs a paid subscription or license to use, and some of them are open-source, which are freely available to everyone. Some examples include:

Open-Source LLMs

Closed-Source LLMs

MetaAI Llama

OpenAI ChatGPT

Google BERT

Google Gemini

Google T5

Google PaLM

:

:

OpenAI introduced ChatGPT, a widely used LLM model, on November 30, 2022. With one million users in five days, it significantly boosted the AI industry, leading to rapid investments and advancements in GenAI. Like other LLM models, Meta AI also released an Autoregressive is a class of machine learning model, which predicts the future behaviour based on the past behaviours.open-source LLM model, Large Language Model Meta AI (LLaMA), in February 2023.

LLaMA

The first generation of the Llama model was released on February 24, 2023. It was available in four model sizes, i.e., 7, 13, 33, and 65 billion parametersThe parameters are the variables of the models that are adjusted during training to optimize their performance. For example, we can set parameter values to control how long or how creative the response will be., with the support of 2048 tokensA token is the smallest piece of text that can be processed by an LLM model. It can be a word, subword, or punctuation mark, depending on the tokenization technique used in the model.. According to the paper "LLaMA: Open and Efficient Foundation Language ModelsTouvron, Hugo, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière et al. "Llama: Open and efficient foundation language models." arXiv preprint arXiv:2302.13971 (2023). Harvard", the 13B model version performed better than the GPT-3 (175B) on most NLP benchmarks. They also claim that the 65B model version was competitive with the best state-of-the-art models like PaLM (540B) and Chinchilla (70B). Meta released this model only to the research community under a noncommercial license.

Llama 2

In collaboration with Microsoft, Meta released the next generation of Llama, Llama 2, on July 18, 2023. It was released in three model sizes, i.e., 7, 13, and 70 billion parameters. Llama 2 offered support for 4096 tokens, double that of the first generation. It was built on the same architecture as the LLaMA with pre-training on 40% more training data. Meta released Llama 2 for both research and commercial use.

Llama 3

Meta AI released one of the world's leading AI assistants, Llama 3, on April 18, 2024. It was released in two model sizes, i.e., 8 and 70 billion parameters. Llama 3 supports 128,000 tokens, substantially improving model performance and efficiency. It has been pre-trained on a huge dataset consisting of over 15 trillion tokens from public sources. This training dataset is seven times larger than that of Llama 2, with four times more code.

Prompt workflow in Llama 3

Let's go through the process of how Llama 3 responds to prompts:

  • User input: The user provides a prompt as input to the model.

  • Tokenization: Llama 3 uses a tokenizer to break down input into small pieces called tokens.

  • Context understanding: The tokens are further contextualized to understand the meaning and context of input.

  • Response generation: The contextualized tokens are passed through the Llama 3 model. The model generates a response, which can be text or an image, depending on the user's prompt.

  • Output: Finally, the generated response is returned to the user as an output.

Press + to interact
The user provides a prompt to the model
The user provides a prompt to the model
1 of 5

Use cases of Llama 3

Llama 3 is a powerful AI model that supports a broad range of use cases, including:

  • Generating ideas and suggestions

  • Creating content like stories and poems

  • Summarizing long pieces of text

  • Assisting with programming and coding tasks

  • Answering questions on a wide range of topics

  • Generating images and art

One of the signification new features of Llama 3 is its integration into Meta's applications. It allows direct interaction with the AI assistant through chat interfaces on Facebook Messenger, Instagram, and WhatsApp, eliminating the need to leave these applications.

Press + to interact
Use cases of Llama 3
Use cases of Llama 3

This integration marks a significant step forward in making AI technology more accessible and convenient than ever before.

Comparing LLM models

Let’s compare state-of-the-art LLM models and see how they are different from one another.


ChatGPT-4

Llama 3

Gemini 1.0 ultra

Developer

OpenAI

Meta AI

Google AI

Parameters

1.7 trillion

8 billion & 70 billion

175 billion

Context Window

8000 tokens & 32,000 tokens

128,000 tokens

1 million tokens

Access

API

Open-source

API

Input

  • Text
  • Image
  • Text
  • Text
  • Image
  • Audio

Output

  • Text-based output
  • Image-based output
  • Text-based output
  • Image-based output
  • Text-based output
  • Image-based output

Use Cases

NLP tasks:

  • Sentiment analysis
  • Question-answering
  • Text classification


Natural language generation (NLG) tasks:

  • Text generation
  • Creative writing
  • Text summarization etc.

NLP tasks:

  • Sentiment analysis
  • Question-answering
  • Text classification


Natural language generation (NLG) tasks:

  • Text generation
  • Creative writing
  • Text summarization etc.

NLP tasks:

  • Sentiment analysis
  • Question-answering
  • Text classification


Natural language generation (NLG) tasks:

  • Text generation
  • Creative writing
  • Text summarization etc.

Applications

  • Stripe
  • Be My Eyes
  • Morgan Stanley
  • ChatGPT
  • Meta apps such as Facebook, Instagram, Whatsapp, and Messenger
  • Meta AI chatbot
  • Google apps such as Docs, Slides, Sheets, and Gmail etc.
  • Gemini chatbot