LLaMA explained: KV-Cache, Rotary Positional Embedding, RMS Norm, Grouped Query Attention, SwiGLU

Umar Jamil August 24, 2023
Video Thumbnail

About

No channel description available.

Video Description

Full explanation of the LLaMA 1 and LLaMA 2 model from Meta, including Rotary Positional Embeddings, RMS Normalization, Multi-Query Attention, KV-Cache, Grouped Multi-Query Attention (GQA), the SwiGLU Activation function and more! I also review the Transformer concepts that are needed to understand LLaMA and everything is visually explained! As always, the PDF slides are freely available on GitHub: https://github.com/hkproj/pytorch-llama-notes/ Chapters 00:00:00 - Introduction 00:02:20 - Transformer vs LLaMA 00:05:20 - LLaMA 1 00:06:22 - LLaMA 2 00:06:59 - Input Embeddings 00:08:52 - Normalization & RMSNorm 00:24:31 - Rotary Positional Embeddings 00:37:19 - Review of Self-Attention 00:40:22 - KV Cache 00:54:00 - Grouped Multi-Query Attention 01:04:07 - SwiGLU Activation function

You May Also Like

Essential AI Training Tools

AI-recommended products based on this video

Loading...
Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

(31)
$2,657.01$2,656.90
FREE delivery Feb 24 - Mar 3
Loading...
Skytech Blaze 3.0 Gaming PC Desktop – Intel Core i5 12400F 2.5 GHz, NVIDIA RTX 3060, 500GB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

Skytech Blaze 3.0 Gaming PC Desktop – Intel Core i5 12400F 2.5 GHz, NVIDIA RTX 3060, 500GB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

(786)
$1,414.11
FREE delivery Thu, Feb 19Only 4 left in stock.
Loading...
MSI NVIDIA GeForce RTX 3050 Ventus 2X XS 8G OC Graphics Card - 8 GB GDDR6, 1807 MHz, PCI Express Gen 4, 128 Bits, DP v 1.4a, DL DVI-D, HDMI 2.1 (Supports 4K at 120Hz)

MSI NVIDIA GeForce RTX 3050 Ventus 2X XS 8G OC Graphics Card - 8 GB GDDR6, 1807 MHz, PCI Express Gen 4, 128 Bits, DP v 1.4a, DL DVI-D, HDMI 2.1 (Supports 4K at 120Hz)

(760)
$1,020.45
Loading...
Asus Dual NVIDIA GeForce RTX 3050 6GB OC Edition Gaming Graphics Card - PCIe 4.0, 6GB GDDR6 Memory, HDMI 2.1, DisplayPort 1.4a, 2-Slot Design, Axial-tech Fan Design, 0dB Technology, Steel Bracket

Asus Dual NVIDIA GeForce RTX 3050 6GB OC Edition Gaming Graphics Card - PCIe 4.0, 6GB GDDR6 Memory, HDMI 2.1, DisplayPort 1.4a, 2-Slot Design, Axial-tech Fan Design, 0dB Technology, Steel Bracket

(903)
$248.98
FREE delivery Sat, Jan 3
300+ bought in past month
Loading...
AtomMan G7 Pt Mini PC AMD Ryzen 9 7945HX(16C/32T, up to 5.4GHz) 32GB DDR5 1TB PCIe4.0 SSD Micro Computer, HDMI+DP+USB-C Output, 2.5G LAN, WiFi7, BT5.4, 4xUSB AMD Radeon RX 7600M XT Graphics Gaming PC

AtomMan G7 Pt Mini PC AMD Ryzen 9 7945HX(16C/32T, up to 5.4GHz) 32GB DDR5 1TB PCIe4.0 SSD Micro Computer, HDMI+DP+USB-C Output, 2.5G LAN, WiFi7, BT5.4, 4xUSB AMD Radeon RX 7600M XT Graphics Gaming PC

(14)
$1,999.90
Loading...
STGAubron Gaming Desktop PC, AMD Athlon 3000G 3.5G, Radeon RX 580 16G GDDR5, 16G RAM, 512G SSD, 600M WiFi, BT 5.0, RGB Fan x4, Windows 11 Home

STGAubron Gaming Desktop PC, AMD Athlon 3000G 3.5G, Radeon RX 580 16G GDDR5, 16G RAM, 512G SSD, 600M WiFi, BT 5.0, RGB Fan x4, Windows 11 Home

(52)
$593.99
FREE delivery Wed, Jun 18
Loading...
Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

Corsair RM1000e Fully Modular Low-Noise ATX Power Supply - Dual EPS12V Connectors - 105°C-Rated Capacitors - 80 Plus Gold Efficiency - Modern Standby Support - Black

(41)
$219.19$204.66
FREE delivery Oct 15 - 22
Loading...
CORSAIR iCUE Link XD5 RGB Elite LCD Pump-Reservoir Unit - D5 PWM Pump - 480x480 IPS LCD Screen - 22 Addressable RGB LEDs - 440ml Nylon Reservoir - White

CORSAIR iCUE Link XD5 RGB Elite LCD Pump-Reservoir Unit - D5 PWM Pump - 480x480 IPS LCD Screen - 22 Addressable RGB LEDs - 440ml Nylon Reservoir - White

(17)
$379.99
FREE delivery Sun, Aug 24
Loading...
CORSAIR iCUE Link XC7 RGB Elite CPU Water Block - Transparent Flow Chamber - 24 RGB LEDs - Fits Intel® LGA 1700, AMD® AM5 and Older - White

CORSAIR iCUE Link XC7 RGB Elite CPU Water Block - Transparent Flow Chamber - 24 RGB LEDs - Fits Intel® LGA 1700, AMD® AM5 and Older - White

(56)
$149.99$125.33
FREE delivery Sun, Aug 24
Loading...
CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

(235)
$879.99
FREE delivery Sun, Aug 24
Loading...
Corsair MP600 Elite 4TB M.2 PCIe Gen4 x4 NVMe SSD for PS5 – Included Heatsink – M.2 2280 – Up to 7,000MB/sec Sequential Read – High-Density 3D TLC NAND – White

Corsair MP600 Elite 4TB M.2 PCIe Gen4 x4 NVMe SSD for PS5 – Included Heatsink – M.2 2280 – Up to 7,000MB/sec Sequential Read – High-Density 3D TLC NAND – White

(313)
$439.99
FREE delivery Tue, Jun 17
Loading...
New SteelSeries Arctis Nova Pro for Xbox Multi-System Gaming Headset - Premium Hi-Fi Drivers - Hi-Res Audio - 360° Spatial - GameDAC Gen 2 - Quad-DAC - ClearCast Gen 2 Mic - Xbox, PC, PS5/PS4, Switch

New SteelSeries Arctis Nova Pro for Xbox Multi-System Gaming Headset - Premium Hi-Fi Drivers - Hi-Res Audio - 360° Spatial - GameDAC Gen 2 - Quad-DAC - ClearCast Gen 2 Mic - Xbox, PC, PS5/PS4, Switch

(517)
$209.41$122.65
PrimeFREE delivery Sat, Jun 14
Loading...
NEW SteelSeries Arctis Nova 3 Multi-Platform Gaming Headset - Signature Arctis Sound - ClearCast Gen 2 Mic - PC, PS5/PS4, Xbox Series X|S, Switch, Mobile

NEW SteelSeries Arctis Nova 3 Multi-Platform Gaming Headset - Signature Arctis Sound - ClearCast Gen 2 Mic - PC, PS5/PS4, Xbox Series X|S, Switch, Mobile

(9,500)
$99.98$67.37
PrimeFREE delivery Sat, Jun 14
100+ bought in past month