Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

Reasoning from scratch round 2: In this video, I cover the text generation process in LLMs and KV caching (to prepare the base model before adding reasoning techniques in the upcoming ones). 00:00 Introduction and reasoning model demo 01:55 How to work through the book 05:00 Chapter 2 overview...

64,093 Aufrufe • vor 5 Tagen •via X (Twitter)

47 Kommentare

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

And here's the YouTube version:

Profilbild von Aethir
Aethirvor 5 Tagen

Best public walkthrough of the week. This is how you turn GPUs into tokens people can actually use.

Profilbild von ByteCrafter
ByteCraftervor 5 Tagen

compile plus kv cache at 1:30 is where most reimplementations lose the win. a cache that grows one token per step changes tensor shapes every step, so torch compile recompiles or goes dynamic and the speedup evaporates. preallocate to max length, write by index.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

Yes, I have another version with pre-allocated tensors in the bonus materials. Downside is it uses more memory on short queries, or users would have to commit to a max-length manually when instantiating.

Profilbild von Gabi ∞
Gabi ∞vor 5 Tagen

qwen3 showing up in local demos keeps catching me off guard

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

compact and resource efficient

Profilbild von Vishal Singh 🥑
Vishal Singh 🥑vor 5 Tagen

so good, thanks for sharing 🔥

Profilbild von Promptyx
Promptyxvor 5 Tagen

Thankss for sharing, this seems so useful

Profilbild von Ryan ang (bio/acc)
Ryan ang (bio/acc)vor 5 Tagen

the torch compile plus kv cache combo is exactly what i needed to see

Profilbild von Lars Gross
Lars Grossvor 5 Tagen

Worth stating early for anyone following along: the KV cache is the memory budget, not the weights. 7B in 4-bit is 3.9 GB. Whether 8 GB then holds 7k tokens or 28k comes down to KV head count, and there's no parameter count in that equation.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

On that note, I have an interactive memory calculator here:

Profilbild von Lars Gross
Lars Grossvor 5 Tagen

That's the calculator I'd point people to. What it makes obvious once you move the sliders: the weight term is fixed and the cache term isn't. It scales with context and batch together, so the config that fits at batch 1 is exactly the one that OOMs in production.

Profilbild von First Sauce Labs
First Sauce Labsvor 5 Tagen

KV caching setup is the less glamorous but essential part. Good to see that covered.

Profilbild von Victor Akinode
Victor Akinodevor 1 Tag

The chapter timestamps are such a thoughtful touch. It gives people learning around work or school a way to return to one idea without starting over. Thank you for making space for that kind of learning, Sebastian.

Profilbild von Afnan
Afnanvor 5 Tagen

Yaaaaay , Raschka again🥳👏🏻

Profilbild von The Whizz AI
The Whizz AIvor 5 Tagen

benchmarking KV caching next_

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

benchmarks are included :)

Profilbild von The Whizz AI
The Whizz AIvor 5 Tagen

yeah_

Profilbild von dhinna ship .ico
dhinna ship .icovor 5 Tagen

KV caching first so later reasoning videos build on a working generator

Profilbild von Krishna
Krishnavor 5 Tagen

Amazing work! Would love to see the next series explore reasoning with looped Transformers. I’m experimenting with this too, but with limited compute I’m looping only the middle layers. Interestingly, cos θ barely moves there, may hint that much of the reasoning happens there.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

Thanks for suggesting. I think this wouldn't really change the reasoning methods (RLVR, inference scaling) in any way though; it's just an architecture tweak.

Profilbild von Somi
Somivor 5 Tagen

KV caching before reasoning is the right order, a reasoning model is mostly just a much longer decode loop

Profilbild von Samuel Minouri
Samuel Minourivor 5 Tagen

This was super helpful, thanks for putting it together. The KV caching part finally clicked for me. Looking forward to the next videos.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

Nice, glad you found it helpful. In addition, I also have a from-scratch KV Cache article here if useful:

Profilbild von Samuel Minouri
Samuel Minourivor 5 Tagen

Hi Sebastian, thanks for sharing the KV cache article and the videos. They were really clear and helpful. I was wondering if you’re currently looking for anyone to help with from-scratch LLM or inference work, whether that’s implementation, tutorials, or related projects. I’d be happy to contribute if there’s an opportunity.

Profilbild von Pz
Pzvor 5 Tagen

This is going to be quite busy.🤣

Profilbild von Praveen Koka
Praveen Kokavor 5 Tagen

Round 2 of explaining KV caching while the actual reasoning techniques stay in 'upcoming.' Can't wait for Round 3 where we finally show the reasoning.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

Lots of groundwork to be laid when doing things from scratch 😅

Profilbild von Flextor
Flextorvor 5 Tagen

KV caching before reasoning is the bit I want to see. does the speedup hold once the reasoning loop gets long?

Profilbild von Ibrahim Rasheed
Ibrahim Rasheedvor 5 Tagen

Thank you for all you do to spread LLM education. We love you 😘

Profilbild von icosaedro
icosaedrovor 5 Tagen

KV caching + compile combo is the quiet win. Cuts my agent loops in half when I test locally.

Profilbild von Kashif Imteyaz
Kashif Imteyazvor 5 Tagen

Thank you for getting me hooked on reading and learning about the technical details of LLMs. I discovered your writing through threads in which you explained BERT models.

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

Oh BERT, good old times 😊

Profilbild von Arash Rahimi
Arash Rahimivor 5 Tagen

does the KV section cover what breaks over a long context?

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

KV caching shouldn't break over long context, the results are indistinguishable with and without KV caching; it's just a (big) performance improvement

Profilbild von Arash Rahimi
Arash Rahimivor 5 Tagen

right, I was putting KV caching in the wrong pile

Profilbild von Suman Das 👨🏽‍💻 ⚽
Suman Das 👨🏽‍💻 ⚽vor 5 Tagen

🙌

Profilbild von IpezyGJ
IpezyGJvor 4 Tagen

KV caching is the part most from-scratch series skip, so this is the useful half. One check worth putting on camera: run the same prompt cached and uncached, then diff the token ids. When they disagree, the cache is where the numerics moved. Do yours agree?

Profilbild von Josh
Joshvor 5 Tagen

KV cache is the part people skip until generation feels broken. Right order: make the base fast, then add reasoning.

Profilbild von Anjana
Anjanavor 4 Tagen

Will this Qwen3 base model handle the KV cache memory growth better than the older versions? The speedup from KV caching is great but the memory pressure on consumer GPUs is the real headache for long context.

Profilbild von VastPlan
VastPlanvor 5 Tagen

先把生成和 KV cache 讲透再上推理技巧,顺序很对。很多人一上来堆技巧,底座其实还没稳住。

Profilbild von Allen Lu
Allen Luvor 5 Tagen

Maybe speech recognition for the next video?

Profilbild von Jeremiah Adebayo
Jeremiah Adebayovor 2 Tagen

Thank you so much

Profilbild von Artiment Index
Artiment Indexvor 5 Tagen

KV cache before the reasoning tricks the unsexy chapter that actually decides if your “reasoner” ships or OOMs.

Profilbild von Artiment Index
Artiment Indexvor 5 Tagen

KV cache before the reasoning tricks — the unsexy chapter that decides if your “reasoner” ships or OOMs.

Profilbild von Rimas
Rimasvor 5 Tagen

when the reasoning techniques land in the next videos, does the kv caching setup still hold or does it need rework

Profilbild von Sebastian Raschka
Sebastian Raschkavor 5 Tagen

The exact same KV cache will be used in all future contents in this series. However, note that KV caching is not used for training portions of course (due to the nature of autoregressive training) but then again for inferencing with the trained model

Ähnliche Videos

Cursor Complete Guide for AI Coding... 1. The Basics, Composer, Cursor 2.0, Why use Cursor? 2. Multiple Agent Testing, Adding Database, Deploying to Vercel 3. Comparing the big 4: v0, Replit, Lovable, Cursor And more... with Senior Software Engineer Kehan Zhang TIME STAMPS --------------- 1. BASICS: 00:00 Introduction 01:01 Overview of Cursor and Its Features 01:47 Getting Started with Cursor 02:39 Understanding IDE and Vibe Coding 06:00 Cursor For Mobile Apps 10:26 Downloading and Installing Cursor 11:17 Creating and Managing Projects in Cursor 15:14 Building a Simple Game with Cursor 19:10 Advanced Features and Customization 40:28 Fixing Styling Rules 40:53 Redesigning the App 42:17 Exploring Cursor 2.0 Features 43:22 Setting Up the Project Structure 44:17 Adding and Testing Meme Templates 46:08 Debugging Text Issues 2. ADVANCED 49:46 Using Multiple Agents 01:10:40 Creating Custom Commands 01:14:15 Creating Commands in Settings Tab 01:15:11 Introduction to Instant DB 01:16:04 Setting Up Instant DB in Your Project 01:18:24 Building a Full Stack Application 01:19:04 Using the Agent to Plan and Build 01:26:06 Testing and Debugging the Application 01:53:02 Deploying the Application with Vercel 01:55:35 Setting Up the CLI 01:56:15 Understanding Command Line Interfaces (CLI) 01:57:32 Deploying Code to Vercel 01:58:07 Handling Environment Variables 01:58:44 Interacting with the Vercel Deployment 02:00:34 Exploring Cursor's Capabilities 3. COMPARING VIBE CODING TOOLS 02:09:48 Comparing Vibe Coding Tools 02:31:04 Final Thoughts and Recommendations

Riley Brown

65,392 Aufrufe • vor 10 Monaten

A Physics That Could Finally Unify Reality (Part 2/2) - James Ellias, DemystifySci #385 A quiet tremor sounds beneath the floorboards of physics, the still-living heartbeat of the forgotten search for the hidden substance that carries every wave and whisper of the universe. We walk through the fog of equations and theories of fundamental physics with James Ellias of James Ellias, and ask if there is a material truth lies beneath the symbols, or if we have to be satisfied with the short-sighted vision of mathematics alone. 00:00 Go! 00:04:37 Central Equations in Physics 00:08:20 The Importance of a Medium in Physics 00:10:00 Empowerment Through Understanding Physics 00:12:36 Rationality and Truth in Society 00:16:31 Existence vs Consciousness 00:20:30 Discussion on Existence and Consciousness 00:24:25 Role of Imagination in Existence 00:28:10 Properties and Entities in Physics 00:30:15 The Nature of Aether and Physical Mediums 00:36:08 Clarity and Understanding in Physics 00:40:26 Discussion on Force and Aether 00:44:57 Relationship of Entities and Actions 00:49:30 Theoretical Framework for Aether 00:58:04 Exploration of Aether Theories 01:00:40 Importance of Conciseness in Communication 01:02:00 Understanding Physics Before Proposing Hypotheses 01:05:15 Reevaluation of Flawed Theories 01:09:35 The Evolution of Key Physics Concepts 01:15:19 Context-Specific Nature of Constants 01:19:43 Historical Context in Physics 01:21:36 The Nature of Electrons 01:25:53 J.J. Thomson’s Evolving Perspective 01:29:24 Upcoming Work and Philosophical Frameworks 01:32:11 Collaborations

Anastasia

13,618 Aufrufe • vor 9 Monaten

Here's an edit of the Elon Musk interview hosted by Katherine Brodsky discussing a myriad of topics. This version boosts audio quality and reduces pauses and dead space by 33%. Thank you David Carbutt for the work! Timestamps: (00:00) The Journey of SpaceX and Tesla (01:06) Misunderstandings and Misinformation (03:42) The Role of Social Media in Free Speech (04:12) The Impact of Government Control on Media (06:32) The Evolution of Twitter and the Need for a Fresh Start (07:17) The Challenges of Moderation on Social Media Platforms (12:12) The Role of Citizen Journalism in Modern Media (17:45) The Future of Legacy Media (28:08) The Power of Amplifying Ideas and People (36:35) The Importance of Open-Mindedness and Self-Criticism (38:49) Community Notes and Open Source Data (39:58) The Role of Accuracy and Opinions in Posting (40:22) The Idea of a Sarcasm Detector (41:01) The Potential of AI in Enhancing Accuracy (42:39) The Future of AI and Deepfakes (44:59) The Vision for X as an All-in-One App (46:38) The Concept of Trust in Institutions (51:24) The Impact of Gene Editing on Humanity (55:42) The Challenge of Censorship and Free Speech (01:02:24) The Unusual Case of a Voice Doppelganger (01:07:35) Starting a Conversation: Texting and Simulations (01:08:43) Discussing Starship Launch and Future Plans (01:10:32) Engaging in Casual Conversations and Sharing Photos (01:11:55) Exploring the Idea of Expanding the Scope of Reality (01:13:27) Exploring the Concept of Simulation Theory (01:13:52) Discussing the Concept of AI in the Simulation (01:20:42) Addressing Questions about Ad Demonetization (01:23:11) Addressing Concerns about Doxxing and Harassment (01:30:47) Discussing the Monetization of Spaces (01:31:34) Discussing the Future of AI and OpenAI (01:35:17) Discussion on National Debt and AI (01:36:06) Involvement of Family Members (01:36:45) Questions and Answers (01:37:31) Impersonations and Voice Modulations (01:38:47) Discussion on Accents and Language Learning (01:41:14) Discussion on AI and Voice Imitation (01:46:45) Serious Discussion on AI and Social Media (01:51:27) Discussion on Physics and AI (01:58:18) Closing Remarks and Final Questions

Farzad 🇺🇸 🇮🇷

2,033,237 Aufrufe • vor 2 Jahren

My dear friend, Vlad Tenev, changed the landscape of investing forever! The rise of the retail investor is largely due to Robinhood's success... and in this new Journey Man, we discuss it all... Enjoy! 00:00 - Intro 00:53 - Introducing Vlad Tenev of Robinhood 01:27 - Why Take on Wall Street? 01:54 - Robinhood’s Zero-Fee Origin Story 02:53 - Inspiration from Instagram and Uber 04:24 - Reimagining Trading for Mobile 05:05 - The Challenge of Disrupting Finance 05:42 - Why Everything Is Hard 06:34 - Early Wrong Assumptions 07:42 - Raising Capital with a Small Vision 08:48 - Funding Robinhood on AngelList 09:50 - Early Investors Changed Their Lives 10:38 - The Crypto Explosion Begins 11:07 - Considering a Bitcoin Exchange First 12:17 - Bitcoin’s Early Skepticism and Growth 13:08 - Robinhood Launches Crypto in 2018 14:03 - 2020: Crypto Revenue Surges Overnight 15:04 - The Challenge of Crypto Cyclicality 16:11 - Staffing a Volatile Business 17:10 - Building Robinhood’s Lean Crypto Team 18:46 - Robinhood’s First Crypto Event Coming 19:38 - Where TradFi Meets DeFi 20:34 - Tokenizing Everything 21:09 - Robinhood’s Vision for Crypto + Finance 21:47 - Thoughts on Crypto Options Demand 23:04 - Why Crypto Options Haven’t Taken Off 24:09 - Millennials and the Speculative Economy 25:22 - Democratizing Trading for Everyone 26:08 - Why Buy-and-Hold Doesn’t Work for All 27:15 - Trading vs Investing: A Matter of Wealth 28:01 - Trading as a Skill Anyone Can Build 29:13 - Robinhood’s Role in Onboarding Millions 30:06 - The Fed's Role and Retail Insight 31:03 - The Rise of the Retail Macro Trader 32:17 - Helping Users Succeed with Robinhood Strategies 33:35 - Power of Community and the Hive Mind 34:55 - Will AI Disrupt Community Too? 36:14 - Technological Waves and Investor Opportunity 37:10 - Human Purpose in an AI World 37:52 - Tokenizing Human Connection 38:28 - Creators, Platforms, and Future-Proofing 39:26 - Vlad’s Long-Term View of the Future 40:05 - Financial Services at the Heart of Disruption 41:14 - If AI Replaces Jobs, What Happens to Investing? 42:25 - Entering the Economic Singularity 43:31 - What Happens When AIs Win the Markets? 44:16 - AI's Role in Capital and Markets 45:07 - Will AI Eliminate Human Emotion from Markets? 46:06 - HFT: The Original AI Traders 47:20 - AI and Long-Term Probabilistic Forecasting 48:48 - GPUs, Gaming, and the Origins of AI 50:01 - Nvidia, CUDA, and Wall Street Arms Races 51:04 - Flash Boys and Microwave Trading 51:54 - Will AI Costs Go to Zero? 52:52 - Lower Cost, Higher Usage 53:41 - Robinhood’s UX Won’t Be Just a Chatbox 55:16 - Cortex: AI-Powered Features at Robinhood 56:54 - Tokenization and the Future of Asset Management 57:44 - Crowdsourced, Tokenized Hedge Funds 58:48 - Portability of Tokenized Assets 59:39 - Blockchain as the New Rails of Finance 01:00:09 - The Trump Token and Capital Formation 01:01:00 - Capital Access Unlocks Innovation 01:01:49 - Why Crypto Needs Regulatory Clarity 01:03:17 - From Meme Coins to Real Assets 01:04:17 - Crypto's Path to $100 Trillion? 01:05:15 - The Financial System Will Run on Blockchains 01:06:00 - Platform Layer vs Application Layer Wealth 01:06:29 - AI Raises Money and Launches Tokens 01:07:39 - AIs Creating Software and Capital Formation 01:08:00 - Final Thoughts: A Wild Future Ahead 01:08:20 - When Will Vlad Buy a CryptoPunk? 01:08:51 - Wrapping Up: AI, Crypto, and the Road Ahead

Raoul Pal

172,640 Aufrufe • vor 1 Jahr

In episode 25 of Launch Pad, I talk to Charles Allen, Charles Allen (charlesallen.eth) 🐢🦄, CEO of BTCS - an Ether treasury company. Charles talks about: - working in the early days of Bitcoin - pivoting to Ethereum - staking with Rocket Pool - what sets BTCS apart from DATs and much more! Check Linktree in the bio for links to watch/listen elsewhere. Chapters 00:00 Introduction to Charles Allen and BTCS 03:02 Charles Allen's Engineering Background and Early Career 05:26 Transition to Crypto and BTCS's Origins 11:10 Challenges and Strategies in Early BTCS 13:02 Pivoting to Bitcoin Mining 18:58 Developing a Digital Asset Strategy 21:07 Exploring Ethereum and Its Potential 25:08 Public Perception of Bitcoin and Crypto 29:48 The Boom of 2017 and M&A Deals 33:03 Navigating the Staking Landscape 36:50 Communicating Risks to Investors 38:06 Exploring Revenue Strategies 41:11 Regulatory Challenges in Staking 43:41 The SEC's Impact on Operations 50:07 Innovations with Rocket Pool 59:01 The Evolution of Digital Asset Treasury Strategies 01:04:32 Navigating Market Dynamics and Shareholder Interests 01:07:07 Investor Focus: Beyond Stock Prices 01:08:58 Leveraging DeFi: The Aave Strategy Explained 01:14:39 SEC Ruling Impact: Opportunities for Liquid Staking Tokens 01:18:53 The Future of Rocket Pool and Ethereum 01:22:56 The Evolution of Blockchain and Institutional Adoption 01:27:00 Ethereum's Role in the Future of Finance 01:32:37 Looking Ahead: BTCS's Strategic Vision 01:34:11 Personal Reflections: The Journey and Future Aspirations

waqwaqattack.eth

31,335 Aufrufe • vor 1 Jahr