How Prompt Compression Can Make You a Better Prompt Engineer

Mark Kashef November 8, 2024
Video Thumbnail
Mark Kashef Logo

Mark Kashef

@mark_kashef

About

I'm an AI expert (and mad scientist) with over 10 years in Data Science & NLP I've been running my AI Automation Agency, Prompt Advisers, for the past 2 years

Video Description

🚀 Gumroad Link to Assets in Video: https://bit.ly/3YYhPo2 👉🏼Join the Early AI-dopters Community: https://bit.ly/3ZMWJIb 📅 Book a Meeting with Our Team: https://bit.ly/3Ml5AKW 🌐 Visit My Agency Website: https://bit.ly/4cD9jhG In this video, I’m breaking down the art and science of prompt compression, a technique that can transform verbose prompts into concise, high-performing instructions for language models. By focusing on only the essential tokens and eliminating the superfluous, we can reduce costs and optimize the performance of AI systems, especially in applications where large numbers of requests are run frequently. Discover how to: - Understand the concept of prompt compression and why it matters for prompt engineering - Use both lazy and technical methods to streamline prompts effectively - Implement a custom GPT for natural language compression of prompts - Use a version of Microsoft’s LLM Lingua framework to technically refine prompts - Save on operational costs by compressing prompts without losing essential detail Whether you’re a prompt engineer, developer, or just diving into generative AI, this video equips you with practical tools to make your AI systems leaner and more cost-efficient. By the end, you’ll be able to compress prompts with precision and maximize output without compromising quality. --- 👋 About Me: I'm Mark, owner of Prompt Advisers. With years of experience helping businesses streamline workflows through AI, I specialize in creating secure and effective automation solutions. This video explores how prompt compression can help make AI usage more efficient and budget-friendly. #PromptEngineering #PromptCompression #GenerativeAI #AIOptimization #CostSavingAI #LLMCosts #AIAutomation #DataScienceTips #AIforBusiness #EfficientAI TIMESTAMPS ⏳ 0:00 - Importance of prompt compression 0:07 - Concept of making prompts concise 0:17 - Applications in constrained contexts 0:43 - Reducing unneeded tokens 1:13 - Retain high-value words only 1:27 - Probability-driven word choices 1:57 - Redundant words removed 2:27 - Microsoft compression diagram 3:13 - Lazy vs. technical methods 3:50 - Custom GPT prompt compression demo 5:03 - Token savings demonstration 5:24 - Explanation of changes made 6:03 - Command structures aid compression 6:50 - Technical method with Microsoft LLM Lingua 7:54 - Code demo for token removal 9:03 - Comparison of compression results 9:50 - Bolt tool simplifies process 11:01 - Bolt for token comparison 12:00 - Cost impact with savings 12:43 - Combine with caching 13:03 - Benefits and conclusion

Boost Your Prompt Engineering Skills

AI-recommended products based on this video

Loading...
Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

Seasonic Focus V4 GX-1000 (ATX3) - 1000W - 80+ Gold - ATX 3.0 & PCIe 5.1 Ready -Full-Modular -ATX Form Factor -Premium Japanese Capacitor -10 Year Warranty -Nvidia RTX 30/40 Super & AMD GPU Compatible

(22)
$423.35
FREE delivery Oct 8 - 10
Loading...
PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

PNY NVIDIA Quadro RTX 4000 - The World’S First Ray Tracing GPU

(203)
$670.57$399.99
FREE delivery Feb 23 - 27
Loading...
Graphics Card Fan 95MM PLD10010S12H DC12V RTX 3060 RTX 3060 Ti Eagle for RTX 3060 RTX 3060 Ti Eagle GPU Fan Computer Cooling Components(BA)

Graphics Card Fan 95MM PLD10010S12H DC12V RTX 3060 RTX 3060 Ti Eagle for RTX 3060 RTX 3060 Ti Eagle GPU Fan Computer Cooling Components(BA)

(0)
$61.64
Loading...
Laptop Parts 3Pcs/Set GA82S2H DIY GPU Fan Graphics Card Cooling for ZOTAC RTX 3060 12GD for GE PRO 2060 6G 3060Ti 8G GTX 1660 Super

Laptop Parts 3Pcs/Set GA82S2H DIY GPU Fan Graphics Card Cooling for ZOTAC RTX 3060 12GD for GE PRO 2060 6G 3060Ti 8G GTX 1660 Super

(0)
$56.61
FREE delivery Mar 19 - Apr 10
Loading...
Desktop Graphics Card, RTX2060 Super 8GB GDDR6 256bit, 1650MHz GPU 14000MHz Memory Clock, Dual Cooling Fan, for Gaming Video, DVI DisplayPort HD PCI Express 3.0

Desktop Graphics Card, RTX2060 Super 8GB GDDR6 256bit, 1650MHz GPU 14000MHz Memory Clock, Dual Cooling Fan, for Gaming Video, DVI DisplayPort HD PCI Express 3.0

(0)
$431.14
FREE delivery Feb 27 - Mar 11
Loading...
Cooling Fan 4PIN 85MM RTX 2060 2070 GPU for SOYO RTX2060 GTX1660 S Video Card Fans

Cooling Fan 4PIN 85MM RTX 2060 2070 GPU for SOYO RTX2060 GTX1660 S Video Card Fans

(0)
$159.83
FREE delivery Mar 19 - Apr 10
Loading...
Beelink EQR5 Mini PC, AMD Ryzen 5 5650U(7nm, 6C/12T) up to 4.2GHz, Mini Computer 32GB DDR4 RAM 1TB PCIe3.0x4 SSD, Micro PC 4K@60Hz Dual HDMI Display/WiFi6/BT5.2/Office/Home/HTPC/W-11 Pro

Beelink EQR5 Mini PC, AMD Ryzen 5 5650U(7nm, 6C/12T) up to 4.2GHz, Mini Computer 32GB DDR4 RAM 1TB PCIe3.0x4 SSD, Micro PC 4K@60Hz Dual HDMI Display/WiFi6/BT5.2/Office/Home/HTPC/W-11 Pro

(425)
$419.00
FREE delivery Sun, Aug 10
Loading...
BOSGAME Mini PC Intel Core i5 12600H(12C/16T, up 4.5GHz), 32GB DDR4 RAM 512GB PCIe SSD, Mini Desktop Computers Dual LAN/4x USB3.2/WiFi6E/BT5.2/HDMI+DP+USB-C/4K Triple Display

BOSGAME Mini PC Intel Core i5 12600H(12C/16T, up 4.5GHz), 32GB DDR4 RAM 512GB PCIe SSD, Mini Desktop Computers Dual LAN/4x USB3.2/WiFi6E/BT5.2/HDMI+DP+USB-C/4K Triple Display

(35)
$413.10
FREE delivery Sun, Aug 10
Loading...
Beelink Mini PC, AMD Ryzen 7 5825U(6nm, 8C/16T) up to 4.5GHz, Mini Computer 32GB DDR4 RAM 500GB PCIe3.0x4 SSD, Micro PC 4K@60Hz Dual HDMI Display/WiFi6/BT5.2/Office/Home/HTPC/W-11 Pro

Beelink Mini PC, AMD Ryzen 7 5825U(6nm, 8C/16T) up to 4.5GHz, Mini Computer 32GB DDR4 RAM 500GB PCIe3.0x4 SSD, Micro PC 4K@60Hz Dual HDMI Display/WiFi6/BT5.2/Office/Home/HTPC/W-11 Pro

(790)
$426.54
Prime
Loading...
M9 Plus Mini PC with 2.1" Display, Intel Core i9-12900HK (14C/20T 5.0GHz), 32GB DDR4 RAM + 1TB NVMe SSD, Mini Desktop Computer, Compact Desktop Triple 4K Display, WiFi6, BT5.2, USB-C

M9 Plus Mini PC with 2.1" Display, Intel Core i9-12900HK (14C/20T 5.0GHz), 32GB DDR4 RAM + 1TB NVMe SSD, Mini Desktop Computer, Compact Desktop Triple 4K Display, WiFi6, BT5.2, USB-C

(23)
$799.99
FREE delivery Wed, Jun 18
Loading...
Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

Freenove Ultimate Starter Kit for BBC micro bit (V2 Included), 316-Page Detailed Tutorial, 225 Items, 44 Projects, Blocks and Python Code

(382)
$94.95
PrimeFREE delivery Sat, Jun 14