{"id":23713,"date":"2026-09-01T23:47:31","date_gmt":"2026-09-01T23:47:31","guid":{"rendered":"https:\/\/scannn.com\/the-efficient-frontier-of-llm-inference\/"},"modified":"2026-09-01T23:47:31","modified_gmt":"2026-09-01T23:47:31","slug":"the-efficient-frontier-of-llm-inference","status":"publish","type":"post","link":"https:\/\/scannn.com\/lv\/the-efficient-frontier-of-llm-inference\/","title":{"rendered":"The efficient frontier of LLM inference"},"content":{"rendered":"\n<div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">In the AI industry, we borrowed the term \u201cefficient frontier\u201d from economists. We use it to talk about managing tradeoffs, most often the tradeoff between cost and capabilities for models. A model is a \u201cfrontier model\u201d if it offers the highest degree of intelligence at a given cost or size.<\/p>\n<div class=\"cursor-pointer my-7 flex flex-col justify-center items-center\">\n<p>\u2715<\/p>\n<p><span class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue font-mono text-r-label-mobile-m md:text-r-label-l font-mono mt-4 text-b-fills-800 [&amp;_*]:!text-sm italic flex items-center\"><span class=\"\">An efficient frontier shows the range of optimal combinations when trading off between two valuable outcomes in a resource-constrained environment.<\/span><\/span><\/div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">We also have efficient frontiers in inference engineering. Most often, this is expressed as a tradeoff between latency and throughput (which determines cost), though we can also exchange quality for throughput (via quantization, distillation, and pruning) or intelligence for speed (in the form of reasoning level).<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">There are two types of techniques available to inference engineers:<\/p>\n<ol>\n<li>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Techniques which make a tradeoff between two factors to move a deployment along an efficient frontier.<\/p>\n<\/li>\n<li>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Techniques which push out the entire frontier for a given deployment, creating more overall efficiency which can be allocated to whatever outcome is most beneficial.<\/p>\n<\/li>\n<\/ol>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Both types of techniques are valuable.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">It\u2019s useful to be able to target any point along an efficient frontier by making tradeoffs. Giving up per-user speed makes it possible to build high-throughput, low-cost pipelines for batch workloads. Sacrificing throughput to improve speed makes sense when latency-sensitive users have a high willingness to pay.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">And of course, it\u2019s incredibly useful to push out the entire frontier. Unlocking more efficiency creates gains that can be allocated to lower latency, higher throughput, or a combination of the two.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">This article details which inference engineering techniques let you target a point on the frontier, and which techniques push the entire frontier out. For this article, we\u2019ll assume we\u2019re running an LLM like <a class=\"group text-b-fills-800 transition-colors duration-100 hover:text-b-dgreen-500 underline underline-offset-4\" href=\"https:\/\/www.baseten.co\/library\/glm-53\/\">GLM-5.3<\/a> or <a class=\"group text-b-fills-800 transition-colors duration-100 hover:text-b-dgreen-500 underline underline-offset-4\" href=\"https:\/\/www.baseten.co\/library\/kimi-k3\/\">Kimi K3<\/a> for agentic coding with KV cache reuse enabled and optimal KV-aware routing.<\/p>\n<h2 class=\"!text-pretty font-neue md:text-r-h3-semi relative scroll-mt-24 w-fit text-balance\" id=\"techniques-that-manage-tradeoffs\">Techniques that manage tradeoffs<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#techniques-that-manage-tradeoffs\"\/><\/h2>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Hitting a certain target in production is often less about discovering some novel approach and more about finding the right set of configurations given the nature of the traffic.<\/p>\n<div class=\"cursor-pointer my-7 flex flex-col justify-center items-center\">\n<p>\u2715<\/p>\n<p><img loading=\"lazy\" alt=\"Techniques for managing tradeoffs let you target an outcome along an efficient frontier.\" draggable=\"false\" loading=\"lazy\" width=\"1200\" height=\"1211\" decoding=\"async\" data-nimg=\"1\" class=\"max-h-[500px] object-contain max-w-[90vw] lg:max-w-none !m-0 rounded-md\" style=\"color:transparent;width:100%;height:auto;background-size:cover;background-position:50% 50%;background-repeat:no-repeat;background-image:url(&quot;data:image\/svg+xml;charset=utf-8,%3Csvg xmlns='http:\/\/www.w3.org\/2000\/svg' viewBox='0 0 1200 1211'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'\/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'\/%3E%3CfeComposite operator='out' in='s'\/%3E%3CfeComposite in2='SourceGraphic'\/%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3C\/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='none' style='filter: url(%23b);' href='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAZAQMAAAAR5XweAAAAA1BMVEX6\/vgmcH3BAAAAD0lEQVR42mNhYGBgoTEGABS0AGXCtPFGAAAAAElFTkSuQmCC'\/%3E%3C\/svg%3E&quot;)\" sizes=\"auto, 100vw\" srcset=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=640&amp;q=75 640w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=750&amp;q=75 750w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=828&amp;q=75 828w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=1080&amp;q=75 1080w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=1200&amp;q=75 1200w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=1920&amp;q=75 1920w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=2048&amp;q=75 2048w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75 3840w\" src=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302085-efficient-frontier-image5.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75\"\/><span class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue font-mono text-r-label-mobile-m md:text-r-label-l font-mono mt-4 text-b-fills-800 [&amp;_*]:!text-sm italic flex items-center\"><span class=\"\">Techniques for managing tradeoffs let you target an outcome along an efficient frontier.<\/span><\/span><\/div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">In practice, the efficient frontier is very jagged. Rather than a smooth, continuous line between outcomes, small changes can have big impacts. These cutoff points are often unintuitive and must be discovered empirically through sweeps.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"batch-sizing\">Batch sizing<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#batch-sizing\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">The most obvious tradeoff between latency and throughput comes from batch sizing. A batch is the number of requests that are processed concurrently. While token-level continuous batching means that there isn\u2019t any latency from waiting for batches to start, the configured batch size determines the per-user latency and the overall throughput.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">With small batch sizes, per-user latency is excellent, but few total tokens are generated per GPU. This means the cost per token is quite high. Increasing batch size has the opposite effect: worse per-user latencies, better overall throughput for lower cost.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"parallelism-strategy\">Parallelism strategy<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#parallelism-strategy\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Today\u2019s LLMs measure in the hundreds of billions or trillions of parameters and must be spread across multiple GPUs. The way in which they are shared, or parallelized, across GPUs can boost either latency or throughput.<\/p>\n<div class=\"cursor-pointer my-7 flex flex-col justify-center items-center\">\n<p>\u2715<\/p>\n<p><img loading=\"lazy\" alt=\"Parallelism splits large models across multiple GPUs.\" draggable=\"false\" loading=\"lazy\" width=\"1200\" height=\"991\" decoding=\"async\" data-nimg=\"1\" class=\"max-h-[500px] object-contain max-w-[90vw] lg:max-w-none !m-0 rounded-md\" style=\"color:transparent;width:100%;height:auto;background-size:cover;background-position:50% 50%;background-repeat:no-repeat;background-image:url(&quot;data:image\/svg+xml;charset=utf-8,%3Csvg xmlns='http:\/\/www.w3.org\/2000\/svg' viewBox='0 0 1200 991'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'\/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'\/%3E%3CfeComposite operator='out' in='s'\/%3E%3CfeComposite in2='SourceGraphic'\/%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3C\/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='none' style='filter: url(%23b);' href='data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD\/2wCEAAoHBw8KDAcNBwgNBwYGDREOBwYNBxEJDQcOFxUZGBYVFhUaHysjGh0oHSEWJDUlKC0vMjIyGSI4PTcwPCsxMi8BCgsLDg0OHBANFS8cFhwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL\/\/AABEIABQAGAMBIgACEQEDEQH\/xAAXAAEBAQEAAAAAAAAAAAAAAAAAAgEH\/8QAFhABAQEAAAAAAAAAAAAAAAAAAAER\/8QAFwEAAwEAAAAAAAAAAAAAAAAAAQIEA\/\/EABgRAQADAQAAAAAAAAAAAAAAAAABAjEh\/9oADAMBAAIRAxEAPwDrEUyRWFC1upo2wE8TxsaBU9tTQBaRj\/\/Z'\/%3E%3C\/svg%3E&quot;)\" sizes=\"auto, 100vw\" srcset=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=640&amp;q=75 640w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=750&amp;q=75 750w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=828&amp;q=75 828w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=1080&amp;q=75 1080w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=1200&amp;q=75 1200w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=1920&amp;q=75 1920w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=2048&amp;q=75 2048w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75 3840w\" src=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302093-efficient-frontier-image6.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75\"\/><span class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue font-mono text-r-label-mobile-m md:text-r-label-l font-mono mt-4 text-b-fills-800 [&amp;_*]:!text-sm italic flex items-center\"><span class=\"\">Parallelism splits large models across multiple GPUs.<\/span><\/span><\/div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">For latency-sensitive deployments, focus on increasing Tensor Parallelism (TP). While TP has expensive all-to-all communication, it is effective for lowering latencies as these operations are fast over high-bandwidth NVLink interconnects.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Expert Parallelism (EP) can help with both latency and throughput. A lower degree of EP is often associated with better latencies, while wide EP, including EP across a full rack of GPUs, generally supports higher throughput.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Another parallelism technique for improving throughput is Attention Data Parallelism (ADP). This technique replicates attention layers for parallel computation, which boosts system throughput at the expense of per-request speed.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"quantization\">Quantization<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#quantization\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Quantization, or running a model with a lower level of precision in weights, activations, and\/or KV cache values, improves both latency and throughput. A quantized model pushes out the efficient frontier on serving tradeoffs.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">However, quantization introduces a new set of tradeoffs between quality and serving efficiency. This is a particularly jagged frontier, where a large degree of improvement to serving efficiency is possible with little-to-no reduction in model quality, especially when using microscaling floating-point number formats like MXFP4 and NVFP4.<\/p>\n<h2 class=\"!text-pretty font-neue md:text-r-h3-semi relative scroll-mt-24 w-fit text-balance\" id=\"techniques-that-move-the-frontier\">Techniques that move the frontier<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#techniques-that-move-the-frontier\"\/><\/h2>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">These techniques are the ones that make the headlines. Improving overall performance is the most fun part of inference engineering.<\/p>\n<div class=\"cursor-pointer my-7 flex flex-col justify-center items-center\">\n<p>\u2715<\/p>\n<p><img loading=\"lazy\" alt=\"Techniques for pushing out the frontier create universal gains.\" draggable=\"false\" loading=\"lazy\" width=\"1200\" height=\"1211\" decoding=\"async\" data-nimg=\"1\" class=\"max-h-[500px] object-contain max-w-[90vw] lg:max-w-none !m-0 rounded-md\" style=\"color:transparent;width:100%;height:auto;background-size:cover;background-position:50% 50%;background-repeat:no-repeat;background-image:url(&quot;data:image\/svg+xml;charset=utf-8,%3Csvg xmlns='http:\/\/www.w3.org\/2000\/svg' viewBox='0 0 1200 1211'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'\/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'\/%3E%3CfeComposite operator='out' in='s'\/%3E%3CfeComposite in2='SourceGraphic'\/%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3C\/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='none' style='filter: url(%23b);' href='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAZAQMAAAAR5XweAAAAA1BMVEX6\/vgmcH3BAAAAD0lEQVR42mNhYGBgoTEGABS0AGXCtPFGAAAAAElFTkSuQmCC'\/%3E%3C\/svg%3E&quot;)\" sizes=\"auto, 100vw\" srcset=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=640&amp;q=75 640w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=750&amp;q=75 750w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=828&amp;q=75 828w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=1080&amp;q=75 1080w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=1200&amp;q=75 1200w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=1920&amp;q=75 1920w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=2048&amp;q=75 2048w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75 3840w\" src=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302101-efficient-frontier-image1.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75\"\/><span class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue font-mono text-r-label-mobile-m md:text-r-label-l font-mono mt-4 text-b-fills-800 [&amp;_*]:!text-sm italic flex items-center\"><span class=\"\">Techniques for pushing out the frontier create universal gains.<\/span><\/span><\/div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">The best part is that these techniques often compound. For example, doubling performance from better hardware while also doubling performance from better software means a four times improvement in overall serving, which can be allocated across latency and throughput.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"kernel-optimization-and-runtime-improvements\">Kernel optimization and runtime improvements<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#kernel-optimization-and-runtime-improvements\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">A CUDA kernel is a low-level function that executes a single piece of the inference process, like a matrix multiplication. Improving the performance of individual kernels, as well as the end-to-end performance of a forward pass in the inference engine, means fewer resources are needed to generate each token. These efficiency gains compound throughout the stack and push the frontier of performance.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">For more on kernel-level performance, read this <a class=\"group text-b-fills-800 transition-colors duration-100 hover:text-b-dgreen-500 underline underline-offset-4\" href=\"https:\/\/www.baseten.co\/blog\/agentic-kernels-in-production\/\">excellent writeup by Baseten intern Brian Li<\/a>.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"speculative-decoding\">Speculative decoding<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#speculative-decoding\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Speculative decoding is the process of guessing which tokens a model might generate, then validating those guesses. When speculative decoding was new, this posed a tradeoff between latency and throughput: speculation was expensive, sequence lengths were short, and acceptance rates were low, meaning speculative decoding was only feasible at small batch sizes.<\/p>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">Today, techniques like <a class=\"group text-b-fills-800 transition-colors duration-100 hover:text-b-dgreen-500 underline underline-offset-4\" href=\"https:\/\/www.baseten.co\/blog\/how-to-train-custom-eagle-3-heads-for-speculative-decoding\/\">EAGLE-3<\/a>, DSpark, and <a class=\"group text-b-fills-800 transition-colors duration-100 hover:text-b-dgreen-500 underline underline-offset-4\" href=\"https:\/\/www.baseten.co\/blog\/dflash-faster-llm-inference\/\">DFlash<\/a> still compete with the main model loop for resources, somewhat limiting maximum batch sizes. However, thanks to the strong performance of these techniques, especially on code generation where output token sequences are relatively predictable, they yield efficiency gains from skipped forward passes in addition to the raw reduction in latency in the form of more tokens per second per user.<\/p>\n<h3 class=\"!text-pretty font-neue font-semibold md:text-r-h4-semi relative scroll-mt-24 w-fit text-balance\" id=\"disaggregation\">Disaggregation<a aria-hidden=\"true\" class=\"absolute top-0 left-0 w-full h-full\" href=\"#disaggregation\"\/><\/h3>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">P\/D disaggregation, or separating prefill and decode onto dedicated workers, is a strategy for optimizing high-volume deployments of LLMs. Running prefill and decode independently means that workers can be optimized for the unique characteristics of each phase of inference, and that the ratio between prefill and decode workers can be adjusted to match the input and output sequence lengths and cache hit rates from incoming traffic.<\/p>\n<div class=\"cursor-pointer my-7 flex flex-col justify-center items-center\">\n<p>\u2715<\/p>\n<p><img loading=\"lazy\" alt=\"In practice, disaggregation is often most useful for increasing throughput while keeping latencies the same or slightly better.\" draggable=\"false\" loading=\"lazy\" width=\"1200\" height=\"708\" decoding=\"async\" data-nimg=\"1\" class=\"max-h-[500px] object-contain max-w-[90vw] lg:max-w-none !m-0 rounded-md\" style=\"color:transparent;width:100%;height:auto;background-size:cover;background-position:50% 50%;background-repeat:no-repeat;background-image:url(&quot;data:image\/svg+xml;charset=utf-8,%3Csvg xmlns='http:\/\/www.w3.org\/2000\/svg' viewBox='0 0 1200 708'%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'\/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'\/%3E%3CfeComposite operator='out' in='s'\/%3E%3CfeComposite in2='SourceGraphic'\/%3E%3CfeGaussianBlur stdDeviation='20'\/%3E%3C\/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='none' style='filter: url(%23b);' href='data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAPCAMAAADJev\/pAAAATlBMVEXs\/\/Tt\/\/Tu\/\/Tv\/\/Tw\/\/Tx\/vTx\/\/Ty\/fTy\/vTz\/PTz\/fT0+\/T0\/PT1+vT1+\/T2+fT2+vT3+PT3+fT49\/T4+PT59vT59\/T69fT69vT79fTVkTqwAAAAjUlEQVR42nWP2w7DMAhDzaX\/\/8XgGZpVU6URJQ+2jk0y4TvmHnSgYWUFJICiFNP5HRktpXz19j6+JWEaUV4M9gTIso1q8pLlSuMCNVE0LnDNG3arNh1yOscio0L6ltQSC2xnPc8Qg6rB7LUuiLNjBb963FHt85NHrEMAeH2bdjrequ4hThAx+04WE3\/mA3eLQkVvCxZ9AAAAAElFTkSuQmCC'\/%3E%3C\/svg%3E&quot;)\" sizes=\"auto, 100vw\" srcset=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=640&amp;q=75 640w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=750&amp;q=75 750w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=828&amp;q=75 828w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=1080&amp;q=75 1080w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=1200&amp;q=75 1200w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=1920&amp;q=75 1920w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=2048&amp;q=75 2048w, \/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75 3840w\" src=\"\/_next\/image\/?url=https%3A%2F%2Fwww.datocms-assets.com%2F104802%2F1788302109-efficient-frontier-image2.png%3Fauto%3Dformat%26w%3D1200&amp;w=3840&amp;q=75\"\/><span class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue font-mono text-r-label-mobile-m md:text-r-label-l font-mono mt-4 text-b-fills-800 [&amp;_*]:!text-sm italic flex items-center\"><span class=\"\">In practice, disaggregation is often most useful for increasing throughput while keeping latencies the same or slightly better.<\/span><\/span><\/div>\n<p class=\"[&amp;_b]:md:font-semibold [&amp;_strong]:md:font-semibold font-neue !text-r-ps-reg\">This article provided a basic overview of techniques for managing tradeoffs versus techniques for improving systemwide performance. For more detail on every technique mentioned in this article, read my free book <a href=\"https:\/\/www.baseten.co\/inference-engineering\/\"><em>Inference Engineering<\/em><\/a>.<\/p>\n<\/div>\n<p><a href=\"https:\/\/www.baseten.co\/blog\/the-efficient-frontier-of-llm-inference\/#quantization?utm_source=tldrai\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the AI industry, we borrowed the term \u201cefficient frontier\u201d from economists. We use it to talk about managing tradeoffs, most often the tradeoff between cost and capabilities for models. A model is a \u201cfrontier model\u201d if it offers the highest degree of intelligence at a given cost or size. \u2715 An efficient frontier shows [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":23714,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-23713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/comments?post=23713"}],"version-history":[{"count":0,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23713\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media\/23714"}],"wp:attachment":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media?parent=23713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/categories?post=23713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/tags?post=23713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}