Get your free personalized podcast brief

We scan new podcasts and send you the top 5 insights daily.

For long queries, Baseten first checks for cached inputs. It then uses disaggregated GPUs—one set for pre-fill (processing input) and another for decode (generating tokens), often with a speculative decoder to accelerate output.

Related Insights

The AI inference process involves two distinct phases: "prefill" (reading the prompt, which is compute-bound) and "decode" (writing the response, which is memory-bound). NVIDIA GPUs excel at prefill, while companies like Grok optimize for decode. The Grok-NVIDIA deal signals a future of specialized, complementary hardware rather than one-size-fits-all chips.

Separating inference into "prefill" (memory-bound) and "decode" (bandwidth-bound) tasks is a game-changer for hardware longevity. It allows older GPUs to be used for prefill tasks indefinitely, extending their useful economic life from 3-4 years to 10-15 years, a boon for data centers and their financiers.

APIs charge less for input prompts (prefill) than for generating responses (decode). This is because prefill processes many tokens at once, becoming compute-bound. Decode generates tokens one-by-one, making each step dominated by the high, unamortized cost of memory access. The price difference reflects this efficiency gap.

Top inference frameworks separate the prefill stage (ingesting the prompt, often compute-bound) from the decode stage (generating tokens, often memory-bound). This disaggregation allows for specialized hardware pools and scheduling for each phase, boosting overall efficiency and throughput.

Optimizing transformer inference, specifically the separation of pre-fill (KV cache building) and decode (token generation), is becoming a foundational skill. Chris Fregly predicts this complex topic, known as disaggregated pre-fill decode, will be a core component of AI engineering interviews at top labs within two years.

The AI inference process is being broken apart, with different stages of the transformer architecture running on different specialized chips. For example, the compute-heavy "prefill" step and the memory-heavy "decode" step can be handled by separate hardware. This explains NVIDIA's strategic interest in Grok, which excels at the decode portion.

A key way to improve consumer LLM speed and cost is to cache the results for frequently asked, static questions like "When was OpenAI founded?" This approach, similar to Google's knowledge panels, would provide instant answers for a large cohort of queries without engaging expensive GPU resources for every request.

In a powerful feedback loop, Baseten used their GLM-5.2 endpoint to analyze its own performance traces, identify bottlenecks in its inference engine, and then write new, more efficient GPU kernels. The model was literally optimizing the stack it was running on.

For dedicated deployments, a small "draft" model can be trained on traffic-specific data (e.g., Harry Potter books). This allows the draft model to predict subsequent tokens with high accuracy, significantly accelerating the main model's decoding speed for that specific use case.

The biggest performance gains in LLM inference come from speculative decoding, which uses a smaller model to predict tokens in batches. This provides a multiplicative speedup, while optimizing low-level kernels only yields marginal, percentage-point improvements.

Baseten's Process for a 200k Token Query Involves Caching and Disaggregated GPUs | RiffOn