正在加载视频...

视频加载失败

New course: Efficient Inference with SGLang: Text and Image Generation, built in partnership with LMSys LMSYS Org and RadixArk RadixArk, and taught by Richard Chen Richard Chen, a Member of Technical Staff at RadixArk. Running LLMs in production is expensive, and much of that cost comes from redundant computation....

102,628 次观看 • 5 个月前 •via X (Twitter)

33 条评论

Ying Sheng 的头像
Ying Sheng5 个月前

@lmsysorg @radixark @richardczl Thank you Andrew, Richard, and people worked behind, for the great course!

Richard Chen 的头像
Richard Chen5 个月前

@lmsysorg @radixark Wowowowowoow!

Mridul Goswami 的头像
Mridul Goswami5 个月前

@lmsysorg @radixark @richardczl Exactly what LLM deployment needs, cutting redundant compute with smart caching like SGLang can slash costs and boost speed. Great to see real-world efficiency in focus. Looking forward to this course!

Louis-François Bouchard 🎥🤖 的头像
Louis-François Bouchard 🎥🤖5 个月前

@lmsysorg @radixark @richardczl SGLang is so underrated for inference optimization. Will check this out, Andrew!

Henry Lu 的头像
Henry Lu5 个月前

@lmsysorg @radixark @richardczl This is great! Wondering how to add new courses? Would love to take one for Harness building and self-evolving agents.

ShiroLogic 的头像
ShiroLogic5 个月前

@lmsysorg @radixark @richardczl Great course on inference

Chaitanya Navale 的头像
Chaitanya Navale5 个月前

@lmsysorg @radixark @richardczl Most people focus on training LLMs, but the real leverage is in efficient inference. KV cache + RadixAttention in SGLang could significantly change how production GenAI systems are optimized. Excited to explore this.

Pierce Alexander Lilholt 的头像
Pierce Alexander Lilholt5 个月前

@lmsysorg @radixark @richardczl UNBE

Crescitaly 的头像
Crescitaly5 个月前

@lmsysorg @radixark @richardczl Inference cost is the quiet drag on every AI product's unit economics — compute per token compounds faster than most founders expect. SGLang's radix caching is one of the highest-leverage optimizations available right now, especially for multi-turn and batched workloads.

Daniel Rachlin 的头像
Daniel Rachlin5 个月前

@lmsysorg @radixark @richardczl The cost of running LLMs in production is a real bottleneck. So many founders are wrestling with this.

PawMe 的头像
PawMe5 个月前

Efficient inference is exactly what we're wrestling with building PawMe — an open-source AI robot for pets. Running vision + behavior models on embedded hardware at the edge is painful when compute is scarce. KV caching strategies like this are a game-changer for embodied AI at home.

Blue_Knight 的头像
Blue_Knight5 个月前

@lmsysorg @radixark @richardczl I just upgraded sglang to 0.5.10.post1 2 days ago for my local inference. Sglang is my favorite😛

Richard He 的头像
Richard He5 个月前

@lmsysorg @radixark @richardczl 🔥

Balvinder Kalon 的头像
Balvinder Kalon5 个月前

@lmsysorg @radixark @richardczl sglang has been quietly becoming the go-to for running inference at scale. the radix attention approach cuts costs significantly vs naive serving. glad someone's teaching this properly, most teams learn it the hard way after their first production bill.

saviour1691 的头像
saviour16915 个月前

@lmsysorg @radixark @richardczl Understanding SGLang's caching and multi-GPU parallelism I think it will help me a lot with my technical skills on LLM inference efficiency.

Josh Zhang ∣ 極客財務官 的头像
Josh Zhang ∣ 極客財務官5 个月前

@lmsysorg @radixark @richardczl SGLang sounds promising for optimizing LLM costs! I've seen inference expenses balloon quickly. Efficient text *and* image gen? Color me intrigued. #LLMs #AI #Efficiency

Altiam Kabir 的头像
Altiam Kabir5 个月前

@lmsysorg @radixark @richardczl Efficient inference starts with smart reuse.

Gagan | Claude + AWS 的头像
Gagan | Claude + AWS5 个月前

@lmsysorg @radixark @richardczl inference efficiency is becoming the real competitive moat. as models get smarter the question shifts from capability to cost per useful output. SGLang doing prefix caching and continuous batching right is huge for anyone running production workloads

NirD 的头像
NirD5 个月前

@lmsysorg @radixark @richardczl sglang's chunked prefill actually lets you squeeze way more throughput from the same hardware compared to naive batching

Pramod Reddy Pandiri 的头像
Pramod Reddy Pandiri5 个月前

@lmsysorg @radixark @richardczl Andrew Ng course on efficiency feels like we've come full circle from "throw more compute at it" back to actually caring about performance.

AIJyothi 的头像
AIJyothi5 个月前

@lmsysorg @radixark @richardczl This is a must-watch for anyone who loves getting their hands dirty with inference frameworks. Moving from theory to actually implementing RadixAttention is the best way to understand how to cut production costs and latency. Great move by the LMSys and RadixArk teams!

未知 的头像
未知4 个月前

@lmsysorg @radixark @richardczl Andrew Ng的可贵之处是把复杂的AI技术讲得任何人都能听懂。但听懂和理解之间,隔着一段工程实践。

Jimmy Ashcot 的头像
Jimmy Ashcot5 个月前

@lmsysorg @radixark @richardczl sglang handling the batching is the right move. inference cost is the bottleneck for most real apps, not the training

MagiCrew 的头像
MagiCrew5 个月前

@lmsysorg @radixark @richardczl Nice! Will need to have our team check it out

Crescitaly 的头像
Crescitaly5 个月前

@lmsysorg @radixark @richardczl Inference efficiency is the quiet bottleneck slowing AI deployment at scale. Most teams focus on model quality, but KV cache sharing and prefix reuse like SGLang does can cut costs dramatically - making previously impossible use cases suddenly viable. Solid course.

未知 的头像
未知3 个月前

@lmsysorg @radixark @richardczl Andrew Ng的可贵之处是把复杂的AI技术讲得任何人都能听懂。但听懂和理解之间,隔着一段工程实践。

Dom Lynch 的头像
Dom Lynch5 个月前

@lmsysorg @radixark @richardczl inference efficiency is the part that doesn't get enough attention. faster generation changes what you can do in an agentic loop. latency at p95 is a different constraint than throughput and i think most agent builders are optimizing for the wrong one

Zara Techie 的头像
Zara Techie5 个月前

@lmsysorg @radixark @richardczl Solid approach—scale and save on inference.

SKAIA_CA 的头像
SKAIA_CA5 个月前

@lmsysorg @radixark @richardczl Caching shared context like this is such a practical way to cut down on redundant compute. Always appreciate these hands-on courses.

AI PlanetX 的头像
AI PlanetX5 个月前

@lmsysorg @radixark @richardczl Smart caching could redefine LLM cost at scale.

David Moosmann 的头像
David Moosmann5 个月前

Inference costs are the thing nobody warns you about when you start building with LLMs. I use Gemini Flash for question generation in my app and even with a cheaper model, optimizing how you batch and cache requests makes a massive difference at scale. Curious if SGLang handles the structured output case well (JSON schemas etc). That's where I burn the most tokens.

Cyberzk⚡🐸💎 的头像
Cyberzk⚡🐸💎5 个月前

@lmsysorg @radixark @richardczl Significant update. Interesting implications for the future of work.

Utkarsh Singh 的头像
Utkarsh Singh5 个月前

@lmsysorg @radixark @richardczl running LLMs is a challenge. Cost management is key. What specific efficiencies will the course cover?

相关视频

The Cost of Intelligence is Heading to Zero | Hyperspace P2P Distributed Cache We present to you our breakthrough cross-domain work across AI, distributed systems, cryptography, game theory to solve the primary structural inefficiency at the heart of AI infrastructure: most inference is redundant. Google has reported that only 15% of daily searches are truly novel. The rest are repeats or close variants. LLM inference inherits this same power-law distribution. Enterprise chatbots see 70-80% of queries fall into a handful of intent categories. System prompts are identical across 100% of requests within an application. The KV attention state for "You are a helpful assistant" has been computed billions of times, on millions of GPUs, identically. And yet every AI lab, every startup, every self-hosted deployment - computes and caches these results independently. There is no shared layer. No global memory. Every provider pays the full compute cost for every query, even when the answer already exists somewhere in the network. This is the problem Hyperspace solves where distributed cache operates at three levels, each catching a different class of redundancy: 1. Response cache Same prompt, same model, same parameters - instant cached response from any node in the network. SHA-256 hash lookup via DHT, with cryptographic cache proofs linking every response to its original inference execution. No trust required. Fetchers re-announce as providers, so popular responses replicate naturally across more nodes. 2. KV prefix cache Same system prompt tokens - skip the most expensive part of inference entirely. Prefill (computing Key-Value attention states) is deterministic: same model plus same tokens always produces identical KV state. The network caches these states using erasure coding and distributes them via the routing network. New questions that share a common prefix resume generation from cached state instead of recomputing from scratch. 3. Routing to cached nodes Instead of transferring KV state across the network for every request, Hyperspace routes the request to the node that already has the state loaded in VRAM. The request goes to the cache, not the cache to the request. Together, these three layers mean that 70-90% of inference requests at network scale never require full GPU computation. This work doesn't exist in isolation. It builds on research from across the industry: SGLang's RadixAttention demonstrated that automatic prefix sharing can yield up to 5x speedup on structured LLM workloads. Moonshot AI's Mooncake built an entire KV-cache-centric disaggregated architecture for production serving at Kimi. Anthropic, OpenAI, and Google all launched prompt caching products in 2024 - priced at 50-90% discounts - because system prompt reuse is so pervasive that it changes the economics of inference. What all of these systems share is a common limitation: they operate within a single organization's infrastructure. SGLang caches prefixes within one server. Mooncake disaggregates KV cache within one datacenter. Anthropic's prompt caching works within one API provider's fleet. None of them can share cached state across organizational boundaries. Hyperspace removes this boundary. The cache is global. A response computed by a node in Tokyo is immediately available to a node in Berlin. A KV prefix state generated for Qwen-32B on one machine is verifiable and reusable by any other machine running the same model. The routing network provides the delivery guarantees, the erasure coding provides the redundancy, and the cache proofs provide the trust. What this means for the cost of intelligence Big AI labs scale linearly: twice the users means twice the GPU spend. Every query is a cost center. Their internal caching helps, but it's siloed - Lab A's cache can't serve Lab B's users, and neither can serve a self-hosted Llama deployment. Hyperspace scales sub-linearly. Every new node that joins the network adds to the global cache. Every inference result enriches the cache for all future requests. The cache hit rate rises with network size because query distributions follow a power law - the most common questions are asked exponentially more often than rare ones. The implication is simple: as the network grows, the effective cost per inference drops. Not linearly. Logarithmically. At 10 million nodes, we estimate 75-90% of all inference requests can be served from cache, eliminating 400,000+ MWh of energy consumption per year and avoiding over 200,000 tons of CO2 emissions. The first person to ask a question pays the compute cost. Everyone after them gets the answer for free, with cryptographic proof that it's authentic. Training is competitive. Inference is shared Open-weight models are converging on quality with closed models. Labs will continue to differentiate on training - data curation, architecture innovation, RLHF tuning. That's where the real intellectual property lives. But inference is a commodity. Two copies of Qwen-32B running the same prompt produce the same KV state and the same response, byte for byte, regardless of whose GPU runs the matrix multiplication. There is no moat in multiplying matrices. The moat is in training the weights. A global distributed cache makes this separation explicit. It doesn't matter who trained the model. Once the weights are open, the inference cost approaches zero at scale - because the network remembers every answer and can prove it's correct. No lab, no matter how well-funded, can match this. They cannot share caches across competitors. They scale linearly. The network scales logarithmically. The marginal cost of intelligence approaches zero. That's the endgame.

Varun

37,555 次观看 • 5 个月前

Researchers made LLM inference 14x faster and 90% cheaper. The video below depicts the speed up in action. Providers discount cached input tokens by as much as 90% because a cache hit skips prefill compute entirely. For stable system prompts and tool definitions, hit rates of 60 to 85% are achievable, which makes it the highest-leverage inference optimization. But the cost saving only works when the cached text is an exact, byte-for-byte prefix of the new request. If you change one character anywhere before it, the entire cached region is missed. Three common request patterns produce full cache misses: - A query that needs documents A and B together can't reuse B's standalone cache, because those KV entries were computed without A in front of them. - The same three documents retrieved in a different order produce a full cache miss, even though nothing about the documents changed. - In multi-turn conversations, every new turn invalidates whatever was cached beyond the stable prefix. Alibaba's production data did a study on this and found that just 10% of cached KV blocks serve 77% of all cache hits. So most of what gets cached sits in storage and is never used a single time. And the root cause is that KV entries are position-dependent. Each token's KV encodes attention to everything before it, so a cached block is only valid in the exact context it was computed in. There's a second, less discussed problem as well. Cache management runs inside the inference engine's process. Moving KV tensors between GPU, CPU, and disk competes with inference for the same resources. This is why Google's TurboQuant compresses KV caches to 3 bits with no accuracy loss and still causes a 20%+ slowdown when it runs in-process. Fixing both problems means restructuring where caching lives. Cache management moves into its own process, the engine only exchanges block IDs over shared GPU memory, and heavy data movement runs across GPU, CPU, disk, and remote storage in parallel. Non-prefix reuse gets handled by selectively recomputing only the small set of tokens that attend across document boundaries. LMCache is the open-source project (10k+ stars) that implements this exact architecture, and it plugs into vLLM, SGLang, and TensorRT-LLM. The selective recomputation part is implemented in its CacheBlend technique, which makes cached docs in any order and combination, with 2-4x faster multi-document processing. On H200s running Qwen3-235B with 50 concurrent users, LMCache's multiprocess mode delivers 14x faster time-to-first-token and 4x faster decoding compared to in-process caching. GitHub repo: (don't forget to star 🌟) My co-founder wrote a full breakdown of KV cache management. It covers the disaggregated architecture behind the 14x speed up, how CacheBlend preserves generation quality while skipping recomputation, and how to turn every document in a knowledge base into a reusable cached asset. Read it below.

Avi Chawla

30,692 次观看 • 2 个月前

Our first short course with Anthropic! Building Towards Computer Use with Anthropic. This teaches you to build an LLM-based agent that uses a computer interface by generating mouse clicks and keystrokes. Computer Use is an important, emerging capability for LLMs that will let AI agents do many more tasks than were possible before, since it lets them interact with interfaces designed for humans to use, rather than only tools that provide explicit API access. I hope you will enjoy learning about it! This course is taught by Anthropic's Head of Curriculum, Colt_Steele. You'll learn to apply image reasoning and tool use to "use" a computer as follows: a model processes an image of the screen, analyzes it to understand what's going on, and navigates the computer via mouse clicks and keystrokes. This course goes through the key building blocks, and culminates in a demo of an AI assistant that uses a web browser to search for a research paper, downloads the PDF, and finally summarizes the paper for you. In detail, you’ll: - Learn about Anthropic's family of models, when to use which one, and make API requests to Claude - Use multi-modal prompts that combine text and image content blocks, and also work with streaming responses - Improve your prompting by using prompt templates, using XML to structure prompts, and providing examples - Implement prompt caching to reduce cost and latency - Apply tool-use to build a chatbot that can call different tools to respond to queries - See all these building blocks come together in Computer Use demo Please sign up here:

Andrew Ng

170,541 次观看 • 1 年前

Redis built a cache that cuts LLM costs by 90%! Production LLM apps do not receive completely new questions every time. A customer-support assistant might receive all three of these: - "Can I get a refund after buying the monthly plan?" - "Is the monthly subscription refundable?" - "Can I cancel the plan and get my money back?" The wording is different, but the underlying question and its answer remain the same. Yet LLM apps process every version as a new request. They assemble the prompt, send it to the model, and generate an answer that may have already been generated. Prefix caching reduces part of these repeated calls. When requests begin with the same system prompt or context, the model can reuse the KV states already computed for that shared prefix. But the request still hits the LLM. The new tokens must be processed, and the complete answer must still be decoded. So even with a prefix-cache hit, there's another generation call involved. To solve this, instead of only caching computation inside the model, the application can cache the generated response outside it. When another question arrives, the system embeds it and compares it with previously answered questions. If it finds a sufficiently close match, it returns the stored response without invoking the LLM again. A cache hit removes the input tokens, output tokens, and decoding time associated with another LLM call. In practice, it is important to decide which questions can safely share an answer since a production setup needs well-tuned similarity thresholds, expiration policies, data isolation, and monitoring for incorrect matches. If you want to use this in practice, Redis already implements it as a managed service called Redis LangCache. Under the hood, it generates embeddings, searches previous responses, and returns a matching answer before another model call occurs. Redis also handles access scopes, custom filtering, TTL and eviction controls, and cache monitoring through Redis Cloud. I built an interface to compare it against direct LLM inference. The video below shows this in action, and I worked with Redis on this post to put this together. For the paraphrased question in my run, direct inference took 2.232 seconds and consumed 514 input tokens plus 250 output tokens. Redis returned the earlier response in 0.37 seconds with zero LLM input or output tokens. That was roughly 6x faster in this run. Redis reports API cost savings of up to 90% and cache-hit responses up to 15x faster. The actual result depends on how much safe repetition exists in the workload. You can try Redis LangCache here: If you want to dive deeper, I have already written a detailed breakdown of KV, prefix, prompt, and semantic caching in the article quoted below. This demo builds on the final technique and shows it running in practice. Read it below.

Avi Chawla

163,805 次观看 • 5 天前

New Course: ACP: Agent Communication Protocol Learn to build agents that communicate and collaborate across different frameworks using ACP in this short course built with IBM Research's BeeAI, and taught by Sandi Besen, AI Research Engineer & Ecosystem Lead at IBM, and Nicholas Renotte, Head of AI Developer Advocacy at IBM. Building a multi-agent system with agents built or used by different teams and organizations can become challenging. You may need to write custom integrations each time a team updates their agent design or changes their choice of agentic orchestration framework. The Agent Communication Protocol (ACP) is an open protocol that addresses this challenge by standardizing how agents communicate, using a unified RESTful interface that works across frameworks. In this protocol, you host an agent inside an ACP server, which handles requests from an ACP client and passes them to the appropriate agent. Using a standardized client-server interface allows multiple teams to reuse agents across projects. It also makes it easier to switch between frameworks, replace an agent with a new version, or update a multi-agent system without refactoring the entire system. In this course, you’ll learn to connect agents through ACP. You’ll understand the lifecycle of an ACP Agent and how it compares to other protocols, such as MCP (Model Context Protocol) and A2A (Agent-to-Agent). You’ll build ACP-compliant agents and implement both sequential and hierarchical workflows of multiple agents collaborating using ACP. Through hands-on exercises, you’ll build: - A RAG agent with CrewAI and wrap it inside an ACP server. - An ACP Client to make calls to the ACP server you created. - A sequential workflow that chains an ACP server, created with Smolagents, to the RAG agent. - A hierarchical workflow using a router agent that transforms user queries into tasks, delegated to agents available through ACP servers. - An agent that uses MCP to access tools and ACP to communicate with other agents. You’ll finish up by importing your ACP agents into the BeeAI platform, an open-source registry for discovering and sharing agents. ACP enables collaboration between agents across teams and organizations. By the end of this course, you’ll be able to build ACP agents and workflows that communicate and collaborate regardless of framework. Please sign up here:

Andrew Ng

105,343 次观看 • 1 年前

Announcing a new Coursera course: Retrieval Augmented Generation (RAG) You'll learn to build high performance, production-ready RAG systems in this hands-on, in-depth course created by and taught by , experienced AI and ML engineer, researcher, and educator. RAG is a critical component today of many LLM-based applications in customer support, internal company Q&A systems, even many of the leading chatbots that use web search to answer your questions. This course teaches you in-depth how to make RAG work well. LLMs can produce generic or outdated responses, especially when asked specialized questions not covered in its training data. RAG is the most widely used technique for addressing this. It brings in data from new data sources, such as internal documents or recent news, to give the LLM the relevant context to private, recent, or specialized information. This lets it generate more grounded and accurate responses. In this course, you’ll learn to design and implement every part of a RAG system, from retrievers to vector databases to generation to evals. You’ll learn about the fundamental principles behind RAG and how to optimize it at both the component and whole-system levels. As AI evolves, RAG is evolving too. New models can handle longer context windows, reason more effectively, and can be parts of complex agentic workflows. One exciting growth area is Agentic RAG, in which an AI agent at runtime (rather than it being hardcoded at development time) autonomously decides what data to retrieve, and when/how to go deeper. Even with this evolution, access to high-quality data at runtime is essential, which is why RAG is a key part of so many applications. You'll learn via hands-on experiences to: - Build a RAG system with retrieval and prompt augmentation - Compare retrieval methods like BM25, semantic search, and Reciprocal Rank Fusion - Chunk, index, and retrieve documents using a Weaviate vector database and a news dataset - Develop a chatbot, using open-source LLMs hosted by Together AI, for a fictional store that answers product and FAQ questions - Use evals to drive improving reliability, and incorporate multi-modal data RAG is an important foundational technique. Become good at it through this course! Please sign up here:

Andrew Ng

124,656 次观看 • 1 年前

New short course: LLMs as Operating Systems: Agent Memory, created with Letta, and taught by its founders Charles Packer and Sarah Wooders. An LLM's input context window has limited space. Using a longer input context also costs more and results in slower processing. So, managing what's stored in this context window is important. In the innovative paper MemGPT: Towards LLMs as Operating Systems, its authors (which include the instructors) proposed using an LLM agent to manage this context window. Their system uses a large persistent memory that stores everything that could be included in the input context, and an agent decides what is actually included. Take the example of building a chatbot that needs to remember what's been said earlier in a conversation (perhaps over many days of interaction with a user). As the conversation's length grows, the memory management agent will move information from the input context to a persistent searchable database; summarize information to keep relevant facts in the input context; and restore relevant conversation elements from further back in time. This allows a chatbot to keep what's currently most relevant in its input context memory to generate the next response. When I read the original MemGPT paper, I thought it was an innovative technique for handling memory for LLMs. The open-source Letta framework, which we'll use in this course, makes MemGPT easy to implement. It adds memory to your LLM agents and gives them transparent long-term memory. In detail, you’ll learn: - How to build an agent that can edit its own limited input context memory, using tools and multi-step reasoning - What is a memory hierarchy (an idea from computer operating systems, which use a cache to speed up memory access), and how these ideas apply to managing the LLM input context (where the input context window is a "cache" storing the most relevant information; and an agent decides what to move in and out of this to/from a larger persistent storage system) - How to implement multi-agent collaboration by letting different agents share blocks of memory This course will give you a sophisticated understanding of memory management for LLMs, which is important for chatbots having long conversations, and for complex agentic workflows. Please sign up here!

Andrew Ng

201,127 次观看 • 1 年前