Meta, Pfizer Pivot From Frontier AI to Small Models to Cut Costs

How Generative Models Are Built and Deployed — Ai4

Ai4

Deploying generative AI at enterprise scale has shifted from a modeling race to a systems engineering discipline where distilled smaller models, deterministic workflows, and disaggregated inference infrastructure dictate economic viability.

AI-assisted summary of How Generative Models Are Built and Deployed — original source. Check the original for full context.

Source published:

Detailed notes

## Background Published by Ai4 on YouTube on August 22, 2026, this panel session explores how cutting-edge generative AI models are engineered, deployed, and scaled in live production environments. Moderated by Shane Snider of DCK, the panel features technical leaders Philip Kiely from Baseten, William Tran from Meta, and Johannes Plambeck from Pfizer detailing the practical engineering trade-offs behind LLMs, hybrid architectures, safety guardrails, and open-source versus proprietary deployment stacks.

## TL;DR The panel examines the industry-wide transition from raw model parameter scaling to the hard realities of systems engineering, latency management, and unit economics. Johannes Plambeck outlines Pfizer's deterministic architecture and knowledge graph retrieval designed to eliminate hallucinations in highly regulated healthcare workflows, while William Tran explains Meta's model distillation pipelines powering billions of daily personalized notifications. Philip Kiely details low-level inference mechanics, emphasizing that production bottlenecks stem from KV cache management, prefill-decode disaggregation, and front-end parsing rather than quantization degradation. Together, the speakers discuss the rising parity of open-weights models, the emerging verification bottlenecks of agentic coding loops, and the expanding cybersecurity risks inherent in autonomous tool execution.

## Atmosphere & style The discussion carries a refreshingly pragmatic, collegial, and clear-eyed tone, stripping away theoretical research hype in favor of tactical engineering post-mortems. Self-deprecating banter—touching on startup panel attire, vendor over-promising, and the end of reckless 'token maxing' budgets—smoothly balances deep-dive technical exchanges on GPU memory bottlenecks and regulatory compliance. Listening feels like sitting in on an honest, behind-the-scenes debrief between seasoned practitioners who are genuinely navigating the unforgiving operational limits of live production systems.

## Key takeaways - [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) The generative AI industry has decisively transitioned from debating raw parameter sizes to solving production realities such as latency, guardrails, GPU availability, and unit economics. - [03:27](https://www.youtube.com/watch?v=FS64MoF9jlk&t=207s) In highly regulated environments like pharmaceutical sales, generative models are paired with deterministic knowledge graphs, tool-calling protocols, and KPI rules engines to eliminate hallucinations and adhere strictly to pre-approved clinical text. - [06:58](https://www.youtube.com/watch?v=FS64MoF9jlk&t=418s) At hyper-scale, serving general-purpose frontier models for billions of background events is economically unviable, prompting organizations to distill capabilities into compact 8B–10B parameter models trained on continuous task-specific pipelines. - [09:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=540s) Serving infrastructure must navigate a strict Pareto trade-off between low-latency interactive responsiveness (leveraging Tensor Parallelism) and aggregate batch throughput (leveraging Expert and Data Parallelism). - [10:43](https://www.youtube.com/watch?v=FS64MoF9jlk&t=643s) Open-weights architectures have reached performance parity with proprietary frontier models across reasoning and enterprise benchmarks, driving baseline operational cost reductions of up to 80%. - [12:55](https://www.youtube.com/watch?v=FS64MoF9jlk&t=775s) Frontier models are often over-engineered for deterministic selector tasks or graph routing, whereas small language models (SLMs) and traditional deterministic code deliver equivalent utility at lower cost and higher arithmetic reliability. - [17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) At scale, even a 0.1% hallucination rate impacts millions of users, requiring rigorous guardrails—though certain workflows intentionally pass unedited text to let auditors detect non-compliant behavior. - [21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) Most production inference failures stem from front-end parsing, tokenization bugs, and malformed structured JSON outputs rather than standardized quantization schemes like NVFP4. - [26:29](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1589s) Key-value (KV) cache hit rates and disaggregated serving (splitting prefill and decode compute phases) are the primary engineering levers to unlock 2x or greater gains in tokens per minute (TPM). - [34:12](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2052s) Agentic software development has shifted the engineering bottleneck from code generation to verification and review, forcing teams to practice strict context engineering to prevent skyrocketing token costs. - [39:54](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2394s) Expanding models from conversational chatbots into autonomous tool-using agents introduces significant cybersecurity risks, including supply-chain attacks via unvetted open-source model weights designed to execute malicious tool routines. - [40:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2459s) Managing scarce GPU VRAM has become a game of 'KV cache hot potato,' requiring tiered offloading across host RAM and high-speed network fabrics to prevent out-of-memory crashes during high-concurrency serving. - [42:32](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2552s) Operating generative AI in production has transformed from a pure machine learning research challenge into a multi-disciplinary systems engineering discipline spanning infrastructure, networking, security, and hardware co-design.

## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) The Shift from Model Size to Production Realities and Panel Introductions

The discourse surrounding generative artificial intelligence has undergone a fundamental transformation over the past few years. While earlier industry conversations were preoccupied almost entirely with raw model parameter size and flashy research demos, the focus among practicing engineers has shifted decisively toward the hard realities of operating production systems: latency constraints, infrastructure stability, evaluation benchmarks, guardrails, GPU availability, networking bottlenecks, and unit economics. Introducing the session, Shane Snider emphasizes that deploying dependable systems requires moving past theoretical possibilities to confront what actually breaks in live environments and how architectures must be designed to scale.

The panel brings together engineering leaders from across the AI stack. Philip Kiely, Developer Advocate at Baseten, breaks the ice with a joke about startup attire, noting, "I did not receive the memo that we're supposed to wear a suit today. I guess that's what happens when you bring a startup engineer to a panel." Kiely outlines Baseten’s focus on inference infrastructure and day-zero deployment support for massive, newly released open architectures such as Kimi k3. William Tran, Engineering Manager for Creative AI at Meta, introduces his team's mission to power the Facebook notification experience for "basically half the planet," applying large language models and generative techniques to personalize copy and ranking at immense scale. Johannes Plambeck, Senior Managing Data Scientist and AI Engineer at Pfizer, describes his work supporting Pfizer's North American commercial teams, building tools that equip sales representatives with strictly compliant, approved medical content during conversations with healthcare professionals.

[03:27](https://www.youtube.com/watch?v=FS64MoF9jlk&t=207s) Deterministic Guardrails and Compliance Architecture at Pfizer

When deploying generative systems within highly regulated pharmaceutical environments, the fundamental technical problem is not open-ended content generation, but ultra-strict content curation. Field representatives soliciting information to doctors must differentiate Pfizer's therapies from competitors while tailoring discussions to specific clinical segments—such as high-value prescribers or pediatric specialists. Because marketing materials must strictly comply with rigorous regulatory guidelines, the AI cannot freely improvise copy. Instead, the architecture must curate text verbatim from pre-approved source documentation, completely eliminating hallucinations while keeping complex clinical insights coherent.

```mermaid flowchart TD accTitle: Pfizer Deterministic Content Retrieval Flow subgraph Input ["User Request & Context"] A["Sales Rep Query"] B["Doctor Segmentation"] end

subgraph Deterministic ["Deterministic Pipeline"] C["Knowledge Graph Lookup"] D["Cosine Similarity Matching"] E["KPI Rules Engine"] end

subgraph LLM ["Model Execution"] F["Targeted Tool Calls / MCP"] G["Verbatim Approved Content"] end

Input --> Deterministic C --> D D --> E Deterministic --> F F --> G ```

To eliminate latency and eliminate non-deterministic failure modes, Pfizer offloaded significant portions of the workflow from the LLM into deterministic processes. The system leverages knowledge graphs for clustering related clinical concepts, paired with deterministic cosine similarity matching and KPI firing logic.

Plambeck highlights that the primary friction in enterprise environments often stems from vendor coordination rather than pure engineering. He shares a cautionary tale from an early implementation where external vendors attempted to solve retrieval by dumping entire knowledge structures into the model prompt:

- In one unoptimized runtime, vendors stuffed approximately 57,000 characters directly into a single GPT context window. - This brute-force prompting resulted in latencies exceeding 15 seconds during live interactive demonstrations, which Plambeck called "pretty embarrassing" for an in-person sales tool. - Resolving this required moving away from monolithic context-injection toward targeted LLM tool calling, structuring capabilities through protocols like the Model Context Protocol (MCP), and relying on pre-computed graph lookups.

[06:58](https://www.youtube.com/watch?v=FS64MoF9jlk&t=418s) Distillation and High-Throughput Batch Processing at Meta

Representing the opposite end of the deployment spectrum, Meta approaches generative AI not as an interactive, conversational sales assistant, but as an asynchronous, high-throughput backend engine. William Tran explains that Meta integrates LLMs deep behind the scenes to perform real-time candidate ranking and generate personalized notification copy for billions of global users. While rapid prototyping tools like Claude Code and off-the-shelf frontier models make building a proof of concept straightforward, operating at a volume of "tens of billions of events per day" renders standard inference architectures economically and operationally non-viable.

To make this scale feasible, Meta avoids serving massive, general-purpose frontier models for every backend event. Instead, engineering teams employ automated training and fine-tuning pipelines built around student-teacher distillation setups:

- Meta condenses task-specific capabilities from large teacher models into specialized, smaller models ranging from 8 billion to 10 billion parameters. - Dedicated engineering teams build automated continuous fine-tuning pipelines to adapt these compact models specifically to notification copywriting and ranking. - Tailored internal serving infrastructure hosts these fine-tuned models to maximize raw token throughput and lower per-request compute costs enough to justify the deployment economics.

[09:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=540s) Navigating the Pareto Frontier of Inference Infrastructure

Connecting the enterprise requirements of Pfizer with the hyper-scale pipelines of Meta, Philip Kiely details how infrastructure layers manage the fundamental trade-offs of model serving. Engineering teams must navigate a strict Pareto frontier between time-to-first-token latency and aggregate query throughput. Depending on whether a workload demands sub-second responsiveness for live user interaction or maximum batch efficiency for millions of background tasks, infrastructure engineers can manipulate specific architectural levers to hit exact performance targets.

```mermaid flowchart LR accTitle: Inference Optimization Levers subgraph Tradeoff ["Target Metric"] L["Low Latency / TTFT"] T["High Batch Throughput"] end

subgraph Strategies ["Serving Strategy"] TP["Tensor Parallelism (TP)"] EP["Expert / Data Parallelism (EP / DP)"] end

subgraph Infra ["Hardware & Scheduling"] Q["Custom Queuing & Batch Sizing"] H["Dedicated Silicon Selection"] end

L --> TP T --> EP TP --> Q EP --> Q Q --> H ```

- **Low-Latency Interactive Optimization:** Prioritizes Time to First Token (TTFT) within a few hundred milliseconds using strategies like Tensor Parallelism (TP) to split computation across tightly coupled GPUs. - **High-Throughput Batch Optimization:** Maximizes total daily query volume using wide Expert Parallelism (EP), Attention Data Parallelism (DP), and dynamic request batching. - **Self-Hosted Control:** By managing inference infrastructure directly rather than relying on black-box commercial APIs, engineering teams can fine-tune batch sizes, queuing policies, and hardware selection to sit exactly where they choose on the cost-latency curve.

[10:43](https://www.youtube.com/watch?v=FS64MoF9jlk&t=643s) Open-Source Model Parity and Heterogeneous Stacks

The panel turns to the strategic choice between open-weights architectures and proprietary hosted APIs. Kiely observes a massive inflection point where open-source and open-weights models are capturing significant token share and workload volume across both early-stage startups and massive enterprises. This shift is driven by the fact that open models are no longer compromised compromises; they now match or exceed frontier proprietary benchmarks across general reasoning, coding, and domain-specific enterprise tasks.

Beyond model quality, the unit economics of open-weights inference have created compelling cost advantages:

- **Kimi k3:** Delivers frontier-grade capabilities over massive architectures with day-zero infrastructure support. - **GLM-5.2:** Serves as a premier open model for complex programming harnesses and autonomous coding tasks. - **NVIDIA Nemotron-3 Ultra:** Provides specialized performance tailored for enterprise security and heavily regulated industry deployments. - **DeepSeek V4 Flash:** Ranked as the ninth most intelligent model globally while offering pricing around $0.26 per million output tokens.

These economics allow enterprises to reduce baseline operational costs by up to 80% while retaining full governance over data privacy and serving configurations. Rather than a zero-sum battle resulting in a single winner, Kiely concludes that the industry is converging on a highly heterogeneous ecosystem where organizations selectively blend proprietary frontier APIs with specialized, self-hosted open models tailored to specific operational requirements.

[12:55](https://www.youtube.com/watch?v=FS64MoF9jlk&t=775s) Open vs. Proprietary Models: Enterprise Trade-offs and Healthcare Compliance

When evaluating whether modern open-source foundation models are mature enough for enterprise workloads, the panel reflects on how different organizational stages and regulatory requirements dictate tooling. Philip Kiely opens with a humorous disclaimer that while he believes open models are ready, "I also sell open model tokens. So I'd love to hear from someone who doesn't." William Tran explains that Meta utilizes a hybrid approach, leveraging open-source models alongside first-party architectures and second-party offerings from cloud providers and vendors like Google Cloud Platform (GCP) and Anthropic. Tran highlights that while early-stage startups building a proof-of-concept (MVP) should quickly tap third-party commercial APIs like OpenAI's GPT or Anthropic's Claude to get demos out the door, enterprises operating at scale or under strict compliance mandates require a different path. For organizations prioritizing data sovereignty, self-hosting open models within controlled infrastructure perimeters is often essential, echoing Tran's previous experience in healthcare where workloads were restricted to tightly managed GCP legal contracts or on-premises open-source deployments.

Johannes Plambeck emphasizes that in healthcare, compliance makes foundation models the standard starting point, though he cautions against using frontier models for deterministic tasks. At Pfizer, Plambeck observes content-curation tools designed for sales representatives where an LLM is tasked with enforcing coherence across knowledge graph edge weights. He argues that when an LLM is relegated to the role of a selector, using a massive frontier model is unnecessary and philosophically questionable when small language models (SLMs), fine-tuned open models, or purely deterministic logic could handle the selection more efficiently. Plambeck also points out a puzzling anti-pattern observed across the industry over recent months: teams using LLMs to pre-calculate mathematical edge weights in knowledge graphs, despite the well-known limitations of autoregressive language models when performing numerical calculations.

- **Startup vs. Enterprise deployment**: Early MVPs benefit from managed proprietary APIs (e.g., GPT, Claude) for rapid prototyping, whereas scaled and regulated environments require self-hosted models for data sovereignty. - **Selector architectures**: Large frontier models are often over-engineered for deterministic content selection or routing; fine-tuned SLMs provide equivalent utility at lower cost. - **Graph weight generation anti-pattern**: Using LLMs to directly calculate numerical graph edge weights introduces arithmetic unreliability into deterministic knowledge bases.

```mermaid flowchart TD accTitle: Enterprise Model Selection Strategy subgraph Startup ["Early-Stage / MVP"] A["Rapid Prototyping"] --> B["Proprietary Cloud APIs\n(GPT, Claude)"] end

subgraph Regulated ["Enterprise / Regulated (Healthcare)"] C["Compliance & Data Sovereignty"] --> D["Self-Hosted Open Models / Fine-Tuned SLMs"] D --> E["Internal Infrastructure Parameter"] end

subgraph SelectionLogic ["Task Allocation"] F["Graph Edge Weighting / Selector"] --> G{"Deterministic Math?"} G -- "Yes" --> H["Deterministic Code / SLM"] G -- "No" --> I["Frontier LLM Reasoning"] end ```

---

[17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) Guardrails and Unexpected Failure Modes in Production

The discussion moves to real-world engineering failures, highlighting how models behave unpredictably once deployed. William Tran describes Meta’s notification rewrite engine, where models take user media (such as photos or videos) and generate personalized copy intended to increase engagement. When prompted loosely to make copy "really interesting," the model's subjective interpretations occasionally crossed into outputs that users found unsettling or "creepy." Tran underscores the mathematical reality of consumer scale: even a minuscule 0.1% hallucination or safety failure rate across a user base of one billion individuals impacts millions of users. Consequently, Meta invests heavily in safety guardrail layers to enforce strict adherence to corporate trust and safety guidelines, noting with a self-aware chuckle that Meta takes safety far more seriously than cynical internet reputations might suggest.

```mermaid flowchart LR accTitle: Meta Notification Guardrail Pipeline subgraph InputStage ["Input Context"] A["User Media\n(Photo / Video)"] --> B["LLM Rewrite Prompt\n('Make it interesting')"] end

subgraph GenerationStage ["Generation & Filtering"] B --> C["Candidate Copy Generation"] C --> D{"Trust & Safety Guardrail Layer"} end

subgraph OutcomeStage ["Delivery Decision"] D -- "Pass (Safe & Engaging)" --> E["Send Notification"] D -- "Fail (Creepy / Hallucinated)" --> F["Drop / Fallback Copy"] end ```

In sharp contrast to Meta's aggressive pre-filtering, Johannes Plambeck reveals that Pfizer intentionally allows specific apparent failure modes to pass through LLM summarization systems untouched. When analyzing field sales notes, legal and compliance teams need visibility into verbatim language that might indicate unethical conduct, such as potential quid pro quo arrangements; suppressing this language via model guardrails would blind auditors to critical compliance risks. Plambeck also details another persistent failure mode in sales recommendation systems: even when deterministic data pipelines supply clean, contextually relevant KPIs (e.g., market share, physician prescription rates, demographic statistics) into cutting-edge frontier models, the model output frequently drifts and generates recommendations that are completely disconnected from the provided metrics. Resolving these issues requires robust negative few-shot examples, tighter prompting constraints, and deterministic post-filters.

- **Scale exacerbates edge cases**: A 0.1% failure rate represents massive real-world harm when deployed across a billion users. - **Intentional failure pass-through**: In legal and audit workflows, LLM guardrails must not suppress non-compliant user input (e.g., quid pro quo phrasing) that compliance officers need to review. - **KPI-context hallucination**: Advanced frontier models can still ignore dense deterministic contextual tables, requiring prompt-level negative examples and deterministic verification filters.

---

[21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) The Mechanics of Inference Failures: Quantization Myths vs. Front-End Parsing

Philip Kiely dissects common misconceptions regarding inference reliability, challenging the notion that inference is an inherently repeatable and deterministic operation. To address common industry scapegoats, Kiely initiates a word-association exercise around the term "quantization." While panelists suggest "efficiency" and "histogram binning," Kiely notes that developer chatter online frequently equates quantization with being sold "garbage tokens." He clarifies that while extreme compression methods like 1.58-bit dynamic quantization on local hardware unavoidably degrade output quality, standardized enterprise quantization—such as NVFP4—preserves quality effectively as long as the quantized model's logits and probability distributions mirror the unquantized base model.

Kiely reveals that the majority of unexplained inference quality bugs have nothing to do with quantization or esoteric hardware issues like GPU kernel race conditions across differing memory bandwidths. Instead, the number one source of production inference failures resides in the front end of the inference engine. These failures typically stem from brittle input/output tokenization, structured JSON schema parsing, and malformed tool calls—such as an engine failing to correctly parse nested parentheses within a function call payload.

- **Quantization fidelity**: Responsible precision reduction (such as NVFP4) maintains model logit distributions, disproving the assumption that all quantization destroys reasoning quality. - **The primary source of inference bugs**: Front-end inference server layers—specifically tokenizer handling, structured output validators, and tool-call parsers—account for far more production failures than underlying model weights or GPU kernels.

---

[25:18](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1518s) Bottlenecks in Production Scaling: Throughput vs. Latency

Transitioning from initial proof-of-concept prototypes to production scale introduces severe infrastructure constraints. Shane Snider asks the panelists to identify the primary bottleneck in scaling generative systems—whether it is latency, inference cost, caching, routing, orchestration, or quantization. Philip Kiely explains that from a pure infrastructure and hardware efficiency standpoint, the paramount metric is aggregate throughput, specifically measuring tokens per minute (TPM) and TPM-per-GPU.

Optimizing this metric requires implementing high-performance execution engines and architectural innovations like disaggregation, which separates prefill and decode compute phases to dramatically boost hardware utilization. However, Kiely notes that engineering teams must navigate fundamental trade-offs: deploying systems with strict, interactive latency SLAs inherently forces teams to sacrifice maximum batch efficiency and raw token throughput.

- **Core scaling metric**: Infrastructure efficiency is driven by tokens per minute (TPM) per GPU. - **Architectural optimizations**: Disaggregating the prefill and decoding phases significantly increases aggregate throughput. - **Latency vs. throughput trade-off**: Servicing strict real-time latency requirements necessitates operating GPUs below theoretical peak batch throughput.

[26:29](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1589s) The Core Technical Levers of LLM Efficiency

From an engineering and systems performance standpoint, making LLM inference viable boils down to cold, hard efficiency. Philip Kiely highlights that while quantization gets substantial attention, the primary technical metric operators obsess over is the key-value (KV) cache hit rate. A high hit rate allows the serving system to bypass the compute-heavy prefill stage, returning instantaneous responses while consuming minimal GPU cycles. The second foundational lever is disaggregation—separating prefill and decode phases across specialized clusters. However, disaggregation only makes economic and architectural sense when an organization commands sufficient traffic to saturate a large fleet of worker nodes. When properly implemented, disaggregated serving can deliver a 2x throughput gain in tokens per minute (TPM), and frequently even more depending on the configuration.

William Tran adds that the industry has finally exited the pure research phase and arrived at an inflection point where "everybody realize we kind of have to make money from this." Transitioning generative models from internal lab prototypes to production scale forces teams to scrutinize every compute resource: maximizing CPU utilization, saturating available VRAM, and balancing latency targets with system throughput. For typical developers graduating from proprietary third-party APIs to self-hosting, the journey begins with lightweight runtimes like llama.cpp, before advancing to production inference engines such as vLLM or SGLang on cloud-rented virtual instances. Each runtime targets distinct serving dynamics, requiring engineers to pair the engine with optimal software configurations and aggressive KV cache reuse to eliminate redundant prefill computation.

```mermaid flowchart TD accTitle: Inference Optimization Layers from Startup to Hyper-Scale subgraph AppLevel["Standard Serving Tier"] A["Traffic Ingestion"] --> B{"KV Cache Hit?"} B -- "Hit: Skip Prefill" --> C["Direct Decode Phase"] B -- "Miss: Full Prefill" --> D["vLLM / SGLang Engine"] D --> C end subgraph HyperScale["Hyper-Scale Tier (Meta)"] E["Autonomous Kernel Tuning Agents"] F["Custom ASIC & Inference Silicon"] G["Bespoke Data Center Topology"] end C -. "Requires Scaled Hardware".-> HyperScale ```

- **Primary Serving Metrics**: Optimizing KV cache reuse and raising hit rates directly avoids redundant prompt prefill processing on GPUs. - **Disaggregated Serving**: Yields a 2x or greater boost in tokens per minute (TPM), contingent upon enough aggregate traffic to keep large worker pools fully utilized. - **Inference Runtimes**: llama.cpp serves edge and initial exploration; production enterprise clusters transition to dedicated engines like vLLM and SGLang.

[29:21](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1761s) Hyper-Scale Optimization and the Absence of Silver Bullets

When serving expands beyond tens of thousands to hundreds of millions or billions of active users, off-the-shelf software stacks and commodity cloud instances quickly fall short. At Meta, optimization penetrates down to the silicon and facility levels. William Tran describes deploying autonomous AI agents specifically engineered to rewrite and tune GPU kernels for individual inference workloads to extract maximum hardware performance. Meta designs bespoke data center layouts to perfectly balance memory bandwidth against raw compute, and even fabricates custom in-house inference ASICs because the standard offerings from NVIDIA and AMD cannot fully satisfy their internal deployment scales. When asked whether a single silver-bullet engineering breakthrough unlocked Meta's scale, Tran dismisses the idea: enterprise engineering operates under historical architectural constraints, relying instead on long-term strategy and agentic engineering workflows to automate iterative model adaptation and fine-tuning across target silicon.

Philip Kiely reinforces this reality, asserting that inference engineering inherently lacks magic fixes—performance is the compound result of many interlinked configuration and architectural choices. Yet Kiely finds tremendous optimism in the sheer immaturity of the field. Drawing an analogy to quantitative finance, where fifty years of relentless engineering mean a basis-point optimization (0.01%) justifies an academic paper and a promotion, modern generative AI inference routinely produces massive 20%, 30%, or 2x to 3x improvements from straightforward optimizations. Stacking three or four such enhancements regularly accelerates a baseline open-source model five- to tenfold, proving that systems are nowhere near fully optimized.

Johannes Plambeck offers a pragmatic, application-level perspective on squeezing performance without touching deep hardware layers. For teams unable to fine-tune or downscale to smaller parameter models, efficiency comes from aggressively reducing the work asked of the LLM: - **Trace Hygiene**: Stop writing out lengthy reasoning chains into logging and observability traces unless strictly necessary for human-in-the-loop evaluation. - **Deterministic Offloading**: Strip out pseudo-deterministic reasoning steps from prompts and delegate them to structured tool calls or standard deterministic code. - **Context Distillation**: Leverage offline LLM runs on historical traces to automatically identify and carve out non-essential reasoning tasks from the production execution path.

[34:12](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2052s) Infrastructure Realities and Agentic Software Engineering

Shane Snider steers the panel toward AI infrastructure, asking how the realities of power constraints, massive GPU clusters, high-speed networking fabrics, and escalating inference costs are reshaping everyday software engineering practices. William Tran notes that while frontline developers may not consciously ponder the power draw of physical data centers every morning, infrastructure economics have catalyzed a profound shift toward agentic engineering. Engineering teams rely heavily on coding assistants like Claude Code and Codex to accelerate software generation. However, this shift has relocated the core software engineering bottleneck from code writing to validation: velocity has exploded, but human capacity to review, test, and safely deploy unverified code remains static.

To break this verification deadlock without bottlenecking feature delivery, Meta built automated code-review agents designed to evaluate and approve lower-risk pull requests. Yet this automation loop introduces its own compute footprint: agentic developer loops consume vast quantities of tokens, rapidly driving up compute bills. Consequently, teams must adopt rigorous "context engineering," ensuring coding agents ingest only relevant repository files rather than exhaustively stuffing one-million-token context windows with extraneous code matching loose grep patterns. When forced to redesign architectures, engineering choices are dictated entirely by target throughput requirements and model serving latency profiles.

Philip Kiely reflects on the cultural shift across the industry, joking that the early days of unconstrained spending are over: "I liked token maxing, you liked token maxing, token maxing was fun guys... can't do that anymore apparently because everything's too expensive." Massive supply shortages across GPUs and power grids have driven organizations away from reckless compute consumption toward open-source models and low-cost serving frameworks. The growth mindset has evolved: leadership still expects aggressive, super-linear usage expansion, but demands that the underlying infrastructure costs scale sub-linearly. Achieving that decoupling relies on relentlessly optimizing the underlying token source and eliminating wasted compute on every individual generation.

[38:23](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2303s) Looking Ahead: Next-Generation Predictions for GenAI

With the session nearing its conclusion, Shane Snider asks the panelists for their definitive forward-looking predictions: what architectural shift, breakthrough capability, or engineering advance will exert the greatest influence on generative AI systems in the coming years? Johannes Plambeck predicts an era where model fine-tuning becomes vastly more accessible and ubiquitous for everyday engineering organizations. Focusing on enterprise architectures where models operate primarily as orchestrators and selectors, Plambeck anticipates a future where foundational engineering around knowledge graphs, vector embeddings, and vector stores is standardized and solved, shifting developer focus toward hyper-efficient retrieval and precise decision-making pipelines.

[39:54](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2394s) Security Risks and Attack Vectors in Agentic Tool Use

As generative AI applications evolve beyond simple conversational chatbots into agentic systems capable of autonomous tool calling, the attack surface expands dramatically. While early deployments primarily worried about unintended output generation—highlighted by recent high-profile vulnerabilities at OpenAI and Hugging Face—giving models the agency to trigger external API calls and system commands introduces dangerous cybersecurity vectors.

A major emerging threat involves open-source models downloaded from unverified or less-than-reputable sources on the internet. These models can be intentionally pre-trained or fine-tuned to trigger malicious tool calls behind the scenes. As engineering teams grant autonomous agents broader execution privileges across internal infrastructure, defenses cannot remain static. Guardrail layers, execution sandboxes, and continuous monitoring solutions must scale proportionally to detect and intercept unauthorized tool usage before actions are executed.

- **Expanding Threat Model**: Transitioning from passive text generation to active external tool execution creates direct entry points for unauthorized actions and data exfiltration. - **Supply Chain Risks**: Malicious open-source weights downloaded from unvetted repositories can contain poisoned pre-training or hidden backdoors tailored to invoke destructive tool routines. - **Defensive Scaling**: Systems require layered security, including strict runtime guardrails, anomaly monitoring, and least-privilege permissioning for any tool accessible by an agent.

---

[40:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2459s) Inference Engineering and the "KV Cache Hot Potato"

At the low-level infrastructure tier, inference engineering is increasingly dominated by memory bandwidth bottlenecks and the challenge of managing the key-value (KV) cache. The KV cache stores calculated token states from previous requests so the model does not have to recompute attention over historical context on every decoding step. While preserving the KV cache is essential for latency and throughput, it consumes massive amounts of scarce GPU VRAM, turning memory management into a high-stakes game of "KV cache hot potato"—holding an asset that is vital to performance, yet too bulky to store permanently on the GPU.

```mermaid flowchart TD accTitle: KV Cache Disaggregation and Offloading Architecture subgraph Compute ["Inference Pipeline"] PF["Prefill Workers<br/>(Context Ingestion)"] DC["Decode Workers<br/>(Token Generation)"] end

subgraph MemoryTier ["KV Cache Management ('Hot Potato')"] VRAM["GPU VRAM<br/>(High Speed / Scarce)"] SYS["System Memory / Host RAM<br/>(Offloaded Context)"] NET["Inter-GPU Network<br/>(Sharded Cache)"] end

PF -->|"Write KV"| VRAM VRAM -->|"Evict / Offload"| SYS VRAM -->|"Distribute / Shard"| NET SYS -->|"Prefetch"| DC NET -->|"Stream Tokens"| DC ```

To prevent out-of-memory bottlenecks without sacrificing context, modern inference stacks disaggregate computation and offload cached states across a tiered hierarchy. Engineers continuously shuffle cache data between GPU VRAM, host system memory (CPU RAM), and network interconnects, while sharding state across GPU clusters. This disaggregated approach splits prefill workers (optimized for high-throughput compute during prompt ingestion) from decode workers (optimized for memory-bandwidth-bound token generation). Looking ahead to next-generation architectures like NVIDIA's Rubin platform and emerging specialized accelerators, hardware-level KV cache offloading and workload disaggregation are becoming core design principles for production-grade serving.

- **VRAM Contention**: KV caches contain high-value intermediate attention computations, but unchecked memory growth quickly leads to GPU out-of-memory crashes during high-concurrency serving. - **Prefill vs. Decode Disaggregation**: Decoupling the compute-heavy prompt prefill phase from the memory-bandwidth-heavy autoregressive decoding phase allows for specialized hardware utilization. - **Hardware Trajectory**: Upcoming GPU architectures (such as NVIDIA Rubin) and custom accelerators are embedding dedicated offloading mechanisms and high-speed disaggregation fabrics natively into the silicon.

---

[42:32](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2552s) Conclusion: Production AI as a Systems Engineering Discipline

Moderator Shane Snider brings the panel to a close by synthesizing the primary lessons from the discussion across architecture, model evaluation, guardrails, deployment, and infrastructure. The overarching realization across industry practitioners is that running generative models at scale is no longer merely a machine learning or modeling problem—it has transformed entirely into a complex discipline of systems engineering.

Building resilient, cost-effective generative systems requires tight collaboration across disciplines that historically operated in silos. Long-term production success relies on the continuous alignment of software engineers, infrastructure specialists, networking architects, operations teams, security experts, and continuous evaluation frameworks to keep models safe, reliable, and performant in real-world environments.

## Notable quotes > [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) I did not receive the memo that we're supposed to wear a suit today. I guess that's what happens when you bring a startup engineer to a panel. — Philip Kiely

> [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) basically half the planet — William Tran

> [03:27](https://www.youtube.com/watch?v=FS64MoF9jlk&t=207s) pretty embarrassing — Johannes Plambeck

> [06:58](https://www.youtube.com/watch?v=FS64MoF9jlk&t=418s) tens of billions of events per day — William Tran

> [12:55](https://www.youtube.com/watch?v=FS64MoF9jlk&t=775s) I also sell open model tokens. So I'd love to hear from someone who doesn't. — Philip Kiely

> [17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) really interesting — William Tran

> [21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) garbage tokens — Philip Kiely

> [26:29](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1589s) everybody realize we kind of have to make money from this. — William Tran

> [34:12](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2052s) I liked token maxing, you liked token maxing, token maxing was fun guys... can't do that anymore apparently because everything's too expensive. — Philip Kiely

> [40:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2459s) KV cache hot potato — Philip Kiely

## Mentioned Shane Snider, Philip Kiely, William Tran, Johannes Plambeck, DCK, Baseten, Meta, Facebook, Pfizer Inc., OpenAI, Anthropic, Google Cloud Platform (GCP), NVIDIA, AMD, Hugging Face, Kimi k3, Claude Code, Claude, GPT, Model Context Protocol (MCP), GLM-5.2, NVIDIA Nemotron-3 Ultra, DeepSeek V4 Flash, NVFP4, llama.cpp, vLLM, SGLang, Codex, NVIDIA Rubin

## Video description Shane Snider - Senior Writer, DCK Philip Kiely - Developer Advocate, Baseten William Tran - Engineering Manager, Creative AI, Meta Johannes Plambeck - Senior Managing Data Scientist, AI Engineer, Pfizer Inc.|

Hear from builders and users some of the most powerful generative systems in use today. Panelists will explore the engineering choices behind LLMs, diffusion models, and hybrid architectures, along with lessons from scaling and deploying these models safely. Topics include controlling generation, reducing hallucinations, and choosing between open-source vs proprietary stacks.This panel will gather technical experts working to build and deploy generative AI systems to help you understand the cutting edge.

[Source](https://www.youtube.com/watch?v=FS64MoF9jlk)

中文简报

Meta与辉瑞转向小模型以削减成本 在企业级规模部署生成式AI已从单纯的模型竞争转向系统工程实践,其中经蒸馏的小型模型、确定性工作流以及解耦的推理基础设施决定了其经济可行性。 该专家小组探讨了全行业从单纯追求模型参数规模转向系统工程、延迟管理和单位经济效益等现实问题的过渡。Johannes Plambeck概述了辉瑞为在严格受监管的医疗保健工作流程中消除幻觉而设计的确定性架构与知识图谱检索;William Tran解释了Meta支持每日数十亿次个性化通知的模型蒸馏管线。Philip Kiely详细剖析了底层推理机制,强调生产瓶颈源于KV缓存管理、prefill与decode解耦以及前端解析,而非量化损失。嘉宾们还共同探讨了开放权重模型日益逼近的性能表现、智能体编码循环中新出现的验证瓶颈,以及自主工具执行固有的日益增长的网络安全风险。 生成式AI行业已明确从争论单纯的参数规模,转向解决延迟、安全护栏、GPU可用性以及单位经济效益等实际生产问题。 (0:04) 在医药销售等高度受监管的环境中,生成式模型与确定性知识图谱、工具调用协议及KPI规则引擎相结合,以消除幻觉并严格遵循预先批准的临床文本。 (3:27) 在超大规模场景下,为数十亿次后台事件提供通用前沿模型服务在经济上并不可行,这促使各机构将模型能力蒸馏到通过持续特定任务管线训练的8B–10B紧凑参数模型中。 (6:58) 服务基础设施必须在低延迟交互响应能力(利用张量并行)与聚合批处理吞吐量(利用专家并行和数据并行)之间进行严格的帕累托权衡。 (9:00) 开放权重架构在推理和企业基准测试中已达到与专有前沿模型相当的性能表现,推动基础运营成本降低高达80%。 (10:43)

Reading summary

Deploying generative artificial intelligence in enterprise environments has transitioned from chasing raw model parameter scale to solving systems engineering bottlenecks around latency, unit economics, and infrastructure stability. Practitioners from Baseten, Meta, and Pfizer demonstrate that reliable production systems rely on deterministic architectures, task-distilled models, and low-level inference optimizations rather than general-purpose frontier models. Deterministic Offloading and Task-Specific Distillation (3:27) In highly regulated enterprise deployments, engineering teams frequently offload operations from generative models into deterministic pipelines to eliminate hallucinations and enforce compliance. Johannes Plambeck recounted an early implementation at Pfizer where vendors stuffed approximately 57,000 characters of knowledge structures directly into a single GPT context window, causing interactive latencies to exceed 15 seconds. Pfizer resolved this by replacing context stuffing with deterministic knowledge graphs, cosine similarity matching, KPI firing logic, and targeted tool calls via protocols like the Model Context Protocol (MCP) to curate verbatim, pre-approved medical content for sales representatives. In contrast to interactive sales tools, Meta employs generative models as high-throughput backend engines powering notification ranking and personalized copywriting across tens of billions of daily events. William Tran stated that deploying general-purpose frontier models at this volume is economically non-viable. Instead, Meta uses automated student-teacher distillation pipelines to condense capabilities into specialized models of 8 billion to 10 billion parameters, serving them via internal infrastructure optimized to maximize token throughput and lower per-request compute costs. Open-Weights Economics and Model Right-Sizing (10:43) The panel emphasized a structural shift toward open-weights models driven by cost efficiency and data sovereignty. Philip Kiely noted that open architectures—such as Kimi k3, GLM-5.2, NVIDIA Nemotron-3 Ultra, and DeepSeek V4 Flash (priced around $0.26 per million output tokens)—now match or exceed proprietary benchmarks on reasoning and coding tasks. Deploying these architectures allows enterprises to reduce baseline operational costs by up to 80% while preserving control over data privacy and serving configurations, leading organizations to adopt heterogeneous stacks combining proprietary APIs with self-hosted open models. Model selection also requires right-sizing the architecture to the operational task. While third-party commercial APIs enable rapid prototyping for early proofs of concept, Plambeck cautioned against using massive frontier models for simple data selector or routing roles, where fine-tuned small language models (SLMs) or deterministic code perform equally well at a fraction of the cost. He also warned against an industry anti-pattern of prompting autoregressive models to pre-calculate numerical graph edge weights, which introduces arithmetic errors into deterministic knowledge bases. Guardrails, Context Drift, and Parsing Failures (17:26) Deploying models at scale exposes non-intuitive failure modes. Tran pointed out that across Meta's user base of one billion individuals, even a 0.1% failure rate impacts millions of users, requiring strict trust-and-safety guardrails after early engagement prompts produced outputs users described as creepy. Conversely, Plambeck noted that Pfizer intentionally allows certain compliance failures to pass through summarization systems unedited; suppressing phrases that suggest potential quid pro quo arrangements would prevent compliance officers from auditing misconduct. Plambeck also identified context drift as a frequent issue, where frontier models ignore structured KPI tables unless constrained by negative few-shot examples and deterministic filters. Addressing inference stability, Kiely challenged common assumptions regarding quantization, arguing that standardized enterprise quantization like NVFP4 preserves model logit distributions and reasoning capabilities without generating degraded tokens. In practice, the primary source of production inference failures stems from front-end inference engine parsing—specifically brittle tokenization, structured JSON schema validation, and malformed function calls—rather than hardware-level memory bandwidth or GPU kernel race conditions. KV Cache Management and Disaggregated Serving (26:29) At the infrastructure layer, optimizing inference efficiency centers on tokens per minute (TPM) per GPU and key-value (KV) cache hit rates. Kiely explained that high KV cache hit rates allow systems to skip compute-heavy prompt prefill phases, while disaggregating prefill and decode phases across specialized clusters can deliver a 2x or greater boost in TPM when traffic volume is sufficient to saturate worker fleets. Because cached context consumes scarce GPU VRAM, engineers must manage cache states across a hierarchy of VRAM, host CPU memory, and network interconnects to prevent out-of-memory bottlenecks. At hyper-scale, Meta automates performance tuning by deploying AI agents to rewrite GPU kernels for specific workloads, constructing custom data center topologies, and fabricating in-house inference ASICs. While coding assistants accelerate software production, Tran noted that they shift the engineering bottleneck to code validation, prompting Meta to deploy automated review agents. However, expanded agentic autonomy introduces new vulnerabilities; unvetted open-source model weights can harbor hidden backdoors designed to execute malicious tool calls, requiring execution sandboxes and runtime monitoring. Generative AI deployment has evolved from an empirical machine learning research track into an interdisciplinary systems engineering practice. Sustainable production deployment requires cross-functional alignment across software engineering, security, and infrastructure architecture to continuously balance latency SLAs, token economics, and rigorous safety controls.

精炼阅读摘要

生成式人工智能的行业重心已从模型参数规模转向生产系统的工程化落地,包括延迟、吞吐量、基础设施稳定性与单位经济效益。来自 Baseten、Meta 和辉瑞(Pfizer)的工程专家指出,成功部署大模型并非单纯的算法研发,而是需要围绕特定业务合规、超大规模吞吐与系统级软硬件协同构建的复杂系统工程。 业务驱动架构:合规确定性与超大规模蒸馏 (3:27) 在实际生产中,不同业务形态对模型架构提出了截然相反的要求。辉瑞的 Johannes Plambeck 指出,医药等高度监管行业的核心诉求并非开放式生成,而是绝对合规的内容筛选。在早期实验中,外部供应商将约 5.7 万字符的知识结构直接注入单个 GPT 上下文,导致交互演示延迟超过 15 秒;辉瑞随后将工作流剥离至确定性系统,通过知识图谱、余弦相似度匹配与 KPI 规则引擎预先筛选内容,并利用模型上下文协议(MCP)实施精准工具调用以逐字引用获批医学资料。同时,出于法律合规审计需要,辉瑞故意放行销售代表笔录中的特定不合规措辞(如利益交换暗示),避免被安全护栏屏蔽而导致合规部门失去审查视野。 与之相对,Meta 的 William Tran 描述了超大规模异步处理的挑战。面对每天数百亿次通知排序与文案生成的负载,直接调用前沿通用大模型在经济和算力上均不可行。Meta 采用师生蒸馏方案,将通用大模型的能力浓缩至 80 亿至 100 亿参数的专用轻量模型,并通过自动化微调流水线与自研推理基础设施压低单请求计算成本。Tran 强调,在十亿级用户规模下,即使仅有 0.1% 的安全失误或幻觉,也会波及上百万用户,这促使 Meta 必须在文案生成后部署严格的信任与安全护栏。 开源生态平价与推理帕累托前沿权衡 (9:00) 模型选型与基础设施管理正处于显著的转折点。Baseten 的 Philip Kiely 指出,以 Kimi k3、GLM-5.2、NVIDIA Nemotron-3 Ultra 以及每百万输出 Token 成本约 0.26 美元的 DeepSeek V4 Flash 为代表的开源权重模型,在代码生成和专业推理等任务上已匹敌甚至超越专有商业模型,能帮助企业削减高达 80% 的基线运营成本并保障数据主权。Tran 认为,初创团队在概念验证(MVP)阶段可优先调用商业 API 快速上线,但在规模化运营或严格数据监管下,自托管开源模型往往是必由之路。Plambeck 则警告了一种反模式:当前部分团队尝试让自回归 LLM 直接计算知识图谱中的数学边权重,但模型在数值计算上天然不具可靠性,此类任务应交由确定性代码或微调后的小型语言模型(SLM)处理。 在部署层面,Kiely 说明工程团队必须在首字延迟(TTFT)与批处理吞吐量之间权衡帕累托前沿。低延迟交互系统依赖张量并行(TP)在紧密耦合的 GPU 间拆分计算,而高吞吐批处理系统则依赖专家并行(EP)、数据并行(DP)及动态请求批处理。通过直接掌管自托管基础设施而非依赖黑盒 API,企业能自主调节批处理大小与排队策略,精确落在成本与性能的平衡点上。 推理底座瓶颈:KV Cache 与分阶段解耦 (26:29) 在底层基础设施层面,推理效率的衡量核心在于每张 GPU 每分钟产出的 Token 数(TPM-per-GPU)。Kiely 澄清了一个行业误区:合理的量化方案(如企业级 NVFP4)能有效保留模型对数概率分布,并不会直接毁掉推理质量;生产环境中最主要的故障并非源于量化或 GPU 显存竞争,而是出现在推理引擎前端,例如脆弱的 Token 处理、JSON 格式解析失败以及包含嵌套括号的工具调用语法错误。 当前提升推理吞吐量的关键抓手在于最大化键值缓存(KV Cache)命中率与实施计算解耦。Kiely 将 KV Cache 的管理形容为“烫手山芋”——它对降低首字延迟与跳过计算密集的 Prefill(预填充)阶段至关重要,但对显存的剧烈占用极易引发内存溢出(OOM)。为此,现代架构将计算密集型的 Prefill 节点与内存带宽受限的 Decode(解码)节点拆分为独立集群,并在 GPU 显存、主机内存和网络互连层之间分层调度缓存。在业务负载足以填满计算集群的前提下,该解耦架构可带来两倍甚至更高的吞吐量提升。针对超大规模场景,Tran 透露 Meta 已部署自主 AI 智能体针对特定工作负载自动重写与优化 GPU 算子内核,并自主研发专用推理 ASIC 芯片。 智能体工程演进与工具调用安全风险 (34:12) 基础设施与算力成本的现实正在重塑日常软件工程模式。Tran 观察到,随着工程团队重度采用 Claude Code 等辅助编程工具,开发瓶颈已从代码编写转移至代码验证与测试环节。为了消化剧增的代码交付量,Meta 引入了自动化代码审查智能体来审核低风险代码合并请求(PR)。然而,智能体本身的循环执行同样带来庞大的 Token 消耗,促使工程团队转向严苛的“上下文工程”,避免因无节制地将整个代码库塞满上下文窗口而导致算力成本失控。 与此同时,大模型从被动生成对话转向自主调用外部 API 和执行系统命令,大幅拓展了安全攻击面。研讨指出,从非可信来源下载的开源模型可能在预训练或微调阶段被植入恶意后门,暗中诱发具有破坏性的未授权工具调用或数据外泄。随着模型在企业内部环境中获得更高执行权限,工程架构必须同步构建多层沙箱环境、异常调用监测与最小权限访问控制,以应对供应链与自主执行层面的新型威胁。 研讨表明,大模型规模化落地的核心挑战已超越模型本身的算法设计,演进为涵盖硬件拓扑、推理调度、安全护栏及上下文管理的综合系统工程。未来企业在追求业务使用量超线性增长的同时,必须依托细颗粒度的算力优化使基础设施成本呈次线性增长,但如何在自主工具调用激增的背景下兼顾架构透明性、合规审查与供应链安全,仍将是生产系统持续面临的工程考验。

Detailed notes — zh

## Background 本视频由 Ai4 于 2026 年 8 月 22 日发布在 YouTube 平台上。视频记录了一场关于“生成式模型构建与部署”的技术圆桌论坛,汇聚了来自 DCK、Baseten、Meta 以及辉瑞制药(Pfizer)的工程专家,共同探讨大语言模型、扩散模型和混合架构背后的工程选型、安全落地与规模化部署实战经验。 ## TL;DR 圆桌讨论围绕生成式 AI 从技术原型走向生产级系统的工程演进展开。来自 Meta、辉瑞和 Baseten 的专家结合自身业务场景,深入剖析了百亿级通知生成中的小模型蒸馏、医疗强合规环境下的确定性检索与知识图谱设计,以及自建推理基础设施在时延与吞吐量之间的帕累托前沿权衡。嘉宾们重点分享了 KV Cache 复用、Prefill/Decode 解耦架构、前端解析故障排查及 Agent 化带来的网络安全与上下文工程挑战,指出当下生产级 AI 的本质已是一门高度复杂的全栈系统工程。 ## Atmosphere & style 整场对话务实且极具技术洞察力,既有资深工程师之间的幽默调侃与随性互动,也有直面生产落地痛点时的严谨反思。不同背景嘉宾在对比消费级海量吞吐与医疗强合规场景时碰撞出鲜明观点,打破了对前沿大模型与量化技术的盲目崇拜,展现了从底层 Kernel 调优到宏观架构治理的真实硬核工程质感。 ## Key takeaways - [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) 生成式 AI 的关注重心已从早期的模型参数量和技术 Demo 转向推理时延、吞吐量、基础设施成本、确定性流程及安全护栏等生产级工程挑战。 - [03:56](https://www.youtube.com/watch?v=FS64MoF9jlk&t=236s) 在制药等强合规场景中,系统核心是精准检索而非内容生成;辉瑞通过知识图谱与余弦相似度等确定性算法剥离 LLM 计算,以杜绝幻觉并降低延迟。 - [03:56](https://www.youtube.com/watch?v=FS64MoF9jlk&t=236s) 将庞大的图谱或超长上下文直接硬塞进 Prompt 会导致严重的推理延迟,应转向模型上下文协议(MCP)和结构化的工具调用(Tool Calling)机制。 - [06:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=419s) 面对每日数百亿次的超大规模调用,Meta 采用前沿大模型蒸馏出 8B–10B 的紧凑型专用小模型,以此在保障质量的同时实现成本与吞吐的最优解。 - [09:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=540s) 推理基础设施的核心是在时延与吞吐量的帕累托前沿上做权衡:低时延场景适用张量并行(TP),超高并发吞吐场景则需采用专家并行(EP)和数据并行(DP)。 - [10:43](https://www.youtube.com/watch?v=FS64MoF9jlk&t=643s) 企业技术栈正在演变为高度异构的共存生态:初创期或快速 MVP 优先调用第三方闭源 API,而大规模与高合规场景则倾向在自建基础设施上部署开源模型以降低约 80% 成本并保障数据主权。 - [17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) 内容安全护栏需根据业务场景定制:消费端应用(如 Meta)需严格过滤越界或不当言论,而在医药合规审查场景下,系统需刻意放行敏感表述以便法务团队介入审计。 - [21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) 推理质量崩塌的罪魁祸首往往不是量化算法,而是前端的基础解析缺陷(如 Tokenizer 边缘情况、工具调用与 JSON 格式化解析错误)以及底层 GPU Kernel 竞态条件。 - [26:29](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1589s) 生产环境的核心瓶颈在于 GPU 的每分钟 Token 吞吐量(TPM),提高 KV Cache 复用率与采用 Prefill/Decode 解耦架构通常能带来 2 倍以上的吞吐量提升。 - [27:24](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1644s) 超大规模部署涉及全栈协同优化,从本地的 llama.cpp 到生产级 vLLM/SGLang,再到 Meta 等大厂使用 AI Agent 自动优化 Kernel、定制数据中心乃至自研专用推理芯片。 - [30:25](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1825s) AI 推理工程处于早期红利期且不存在单一银弹,调度、Kernel 调优和内存管理等多项 20%-30% 的优化措施复合叠加后,能为整体系统带来 5 到 10 倍的速度飞跃。 - [34:19](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2059s) AI 编程工具极大提升了开发速度,但瓶颈随之转移至代码审查与验证环节;同时,软件开发的 Agent 化要求更加严格的上下文工程,防止无关文件撑爆上下文窗口并推高算力成本。 - [39:46](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2386s) 大模型从单向对话 Chatbot 演进为具备工具调用权限的 Agent 后,安全攻击面显著扩大,必须警惕非权威开源供应链风险并同步升级运行时护栏与权限监控体系。 - [40:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2459s) 推理工程面临“KV Cache 烫手山芋”困境:高价值但极耗显存的 KV Cache 迫使系统在 VRAM、内存、网络传输以及 Prefill/Decode 节点间进行精细化调度与解耦。 - [42:32](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2552s) 构建生产级生成式 AI 早已超越单纯的机器学习范畴,而是一门高度依赖软件工程、底层基础设施、网络通信、运维管理与持续评测协同配合的系统工程。 ## Detailed walkthrough ### [00:04](https://www.youtube.com/watch?v=FS64MoF9jlk&t=4s) 生成式 AI 的工程演进与嘉宾简介 在过去几年中,生成式 AI 经历了从实验室研究项目和惊艳的技术 Demo 到真正改变企业软件构建、客户服务及自动化工作流的生产级系统的转变。行业的关注焦点也发生了剧烈的迁移:几年前大家还在热衷于讨论“模型参数量有多大”,而现在的工程师关心的则是完全不同的现实问题——推理时延(Latency)、底层基础设施、系统可靠性、模型评估(Evaluation)、安全护栏(Guardrails)、GPU 可用性、算力成本、网络拓扑以及如何构建真正让业务敢于依赖的生产系统。 圆桌嘉宾针对各自的背景及当前工程重心进行了简要介绍: - **Philip Kiely(Baseten 开发者倡导者)** 调侃自己没有收到“必须穿西装”的通知,展现了初创公司工程师的随性风格。他介绍 Baseten 专注于 AI 推理基础设施及模型训练全流程支撑。团队近期的核心工作是为最新开源模型提供“零日支持”(Day Zero Support),例如在面对像 Kimi K3 这种体量比以往大三倍、采用全新架构的模型时,快速进行工程适配并保证高可靠上线。 - **William Tran(Meta 工程经理)** 幽默地介绍自己来自一家“名为 Meta 的小公司”。他的团队负责覆盖全球数十亿用户的 Facebook 通知体验,目前的核心工程任务是利用大模型与生成式 AI 让通知内容更具创意、表现力和个性化。 - **Johannes Plambeck(辉瑞制药 高级数据科学主管/AI 工程师)** 负责辉瑞北美商业化业务线,主要为市场营销人员及一线医药代表构建 AI 工具,帮助他们在与医生的沟通互动中快速定位经过合规审批的专业材料。 ```mermaid flowchart LR accTitle: 生成式 AI 关注维度的转变 subgraph Past["过去:概念验证期"] A["关注模型参数量 (Model Size)"] B["研究项目与 Demo 展示"] end subgraph Present["现在:生产落地期"] C["时延 (Latency) 与高吞吐"] D["基础设施、算力成本与 GPU 供给"] E["可靠性、安全护栏与模型评估"] F["确定性流程与业务合规"] end Past --> Present ``` --- ### [03:56](https://www.youtube.com/watch?v=FS64MoF9jlk&t=236s) 辉瑞制药:合规场景下的确定性内容检索与上下文优化 在高度监管的制药行业,医药代表需要向医生推广药品并说明辉瑞产品与竞品的差异。拜访医生前,营销系统首先会对医生进行用户画像分群(例如高价值医生、低价值医生、主要面向青少年的医生等)。在确定目标分群后,业务流程要求代表所使用的沟通物料必须严格源自经过极高标准合规与市场审查的已审批内容。因此,AI 系统的核心职责绝不是凭空“生成”宣传说辞,而是以“逐字逐句”(Verbatim)的高精度从源文档中检索与组织素材。 ```mermaid flowchart TD accTitle: 辉瑞医药代表合规内容检索架构 subgraph Input["用户与医生画像"] DocProfile["医生细分画像 (Doctor Segment)"] KG["知识图谱聚类 (Knowledge Graph)"] end subgraph Processing["确定性计算流程 (非 LLM)"] Match["余弦相似度匹配 (Cosine Similarity)"] KPI["KPI 规则触发器 (KPI Firing)"] end subgraph Output["安全合规输出"] Tool["模型上下文协议 (MCP) / 工具调用"] Result["合规源文档逐字呈现 (零幻觉)"] end DocProfile --> KG KG --> Match Match --> KPI KPI --> Tool Tool --> Result ``` 为了彻底杜绝幻觉并保证输出见解的连贯性,系统将绝大部分非确定性的 LLM 计算剥离出来,转化为确定性流程: - 引入**知识图谱(Knowledge Graph)**对关联信息进行聚类沉淀。 - 使用余弦相似度匹配(Cosine Similarity Matching)与关键绩效指标触发器(KPI Firing)在底层直接完成信息筛选,最大程度削减大模型推理带来的延迟。 - 谈及开发过程中的教训,Johannes 指出大企业项目的核心难点往往在于跨部门与供应商的协同而非纯工程实现。他曾发现外部供应商在一个 GPT-5.1 运行时中直接塞入了高达 57,000 个字符的上下文,导致面向医药代表的现场实时 Demo 产生了长达 15 秒的严重延迟。 - 这种将庞大图谱直接硬塞入 Context 的做法被证明是“最糟糕的方案”,系统必须转向采用模型上下文协议(MCP, Model Context Protocol)和结构化的 LLM 工具调用(Tool Calling)机制。 --- ### [06:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=419s) Meta:海量规模下的通知生成与小模型蒸馏架构 与辉瑞注重实时人机交互的场景不同,Meta 的大模型落地主要运行在后台异步流程中。William Tran 阐述了 Meta 内部截然不同的技术挑战:团队使用大模型进行内容排序(Ranking)和通知文案(Copywriting)的个性化生成,背后的流量规模高达每天数百亿次(Tens of billions of events per day)。在这种极致规模下,使用昂贵的前沿大模型是无法通过成本效益分析的。 ```mermaid flowchart LR accTitle: Meta 海量通知生成与蒸馏部署架构 subgraph Teacher["前沿大模型"] Frontier["大型前沿模型 (Teacher)"] end subgraph Distillation["自动化训练流水线"] Student["8B-10B 紧凑模型 (Student)"] Pipeline["自动化微调与蒸馏 Pipeline"] end subgraph Serving["大规模生产服务"] Infra["高并发推理集群"] FBNotice["每日数百亿次 Facebook 通知下发"] end Frontier -->|知识蒸馏| Pipeline Pipeline --> Student Student --> Infra Infra --> FBNotice ``` 尽管使用 Claude Code 等最新编码工具和顶尖模型可以极快地跑通一个原型 MVP,但要落地到 Meta 的规模,核心工程全部集中在吞吐与成本效率的极致优化上: - 核心策略是采用 **80 亿到 100 亿(8B–10B)参数量**的紧凑型语言模型。 - 通过构建**教师-学生模型蒸馏(Student-Teacher Distillation)**架构与自动化微调流水线,将大模型的高阶创意与排序能力迁移到定制的小模型中。 - 多个专门的工程团队协同攻坚,确保这些经过专用微调的小模型在基础设施层能够维持极高的并发吞吐量并控制推理成本。 --- ### [09:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=540s) Baseten:推理基础设施与时延-吞吐量帕累托前沿 针对前两位嘉宾展示的一快(低时延互动)一重(超高吞吐后台)两类极端场景,Philip Kiely 从基础设施服务商的视角进行了解构。他指出,大模型推理的核心本质是在**时延(Latency)与吞吐量(Throughput)的帕累托前沿(Pareto Frontier)**上寻找最佳平衡点: ```mermaid flowchart TD accTitle: 推理基础设施控制杠杆与性能帕累托前沿 subgraph Levers["基础设施层调控杠杆"] Batch["批处理大小 (Batch Sizing)"] Hardware["硬件选型与显存拓扑"] Parallelism["并行策略配置"] Queue["队列策略 (Queuing Strategy)"] end subgraph Modes["两种典型优化方向"] Interactive["极致低时延场景 (首字时间 < 几百毫秒)\n采用张量并行 (Tensor Parallelism)"] Throughput["海量吞吐场景 (日均千万/百亿查询)\n采用专家并行 (EP) + 数据并行 (DP)"] end Levers --> Interactive Levers --> Throughput ``` - **交互式低时延场景**:若业务需要现场销售演示中 Time to First Token(首字生成时间)控制在数百毫秒以内以实现无缝实时感,系统应调整批处理大小(Batch Size)并采用张量并行(Tensor Parallelism, TP)架构。 - **高并发离线吞吐场景**:若系统需要处理每天千万至百亿级别的调用,架构应切换为更宽的专家并行(Expert Parallelism, EP)以及高注意力数据并行(Data Parallelism, DP),并辅以针对性的硬件选型与排队调度策略。 - 自主掌控推理基础设施相比直接调用标准黑盒 API 的最大优势,在于团队能够亲自掌握该帕累托前沿的所有控制权,根据业务指标精准调参,而非被迫接受外部 API 固定的性价比曲线。 --- ### [10:43](https://www.youtube.com/watch?v=FS64MoF9jlk&t=643s) 开源与闭源模型选型:异构模型生态的崛起 在探讨技术栈选择(开源模型 vs 闭源专有 API)时,Philip 指出行业正迎来开源模型的大规模爆发拐点,开源方案正在从初创团队到头部 AI 原生企业中全面抢占“Token 份额”(Token Share)与工作负载份额: | 典型代表模型 | 核心优势与适用场景 | 关键性价比 / 性能表现 | |:--- |:--- |:--- | | **Kimi K3** | 具备顶尖能力的前沿基座模型 | “无需加任何限定词的顶尖前沿模型(No caveats)” | | **GLM 5.2** | 深度优化的代码生成能力 | 开发者日常编程工具链集成 | | **Nvidia Nemotron 3 Ultra** | 面向受监管行业及大企业的合规计算 | 企业私有化与受限环境部署 | | **DeepSeek V4 Flash** | 极低成本与高智能密度 | 全球排名前十智能水平,输出 Token 成本仅约 **$0.26 / 百万 Tokens** | Philip 强调,企业迁移到开源栈的核心驱动力在于成本可降低约 80% 并且能深度调优性能指标。但未来的 AI 架构不会是单纯的“非开即闭”,而是一个高度异构的共存生态:闭源前沿模型处理高难度复合逻辑,定制化的开源模型支撑高频垂直负载,两者共同组成完整的生产级应用体系。 ### [12:55](https://www.youtube.com/watch?v=FS64MoF9jlk&t=775s) 企业级场景下的开源与专有模型选型权衡 关于当下的开源模型是否已经足够胜任绝大多数企业级任务,Baseten 的 Philip Kiely 打趣地表示自己完全赞同,但因为自己本身就在“贩卖开源模型的 Token”,所以很想听听其他人的看法。Meta 的创意 AI 工程经理 William Tran 随即接话,并在现场笑声中坦言 Meta 内部其实有着非常优越的选型条件:不仅广泛使用开源模型,同时也在使用第一方内部模型以及来自 Google Cloud(GCP)、Anthropic 等第二方与第三方的模型。这种丰富的工具库让团队能够根据具体需求“选择最合适的工具”。 ```mermaid flowchart TD accTitle: Model Selection Decision Tree Start["评估业务场景与资源"] --> Scale{"规模与合规要求?"} Scale -- "初创公司 / 快速 MVP" --> CloudAPI["第三方闭源模型 API<br/>(如 GPT / Claude 快速验证)"] Scale -- "大规模 / 强监管环境<br/>(医疗、金融、数据主权)" --> SelfHosted["自建基础设施与开源模型<br/>(合规保障、本地可控)"] ``` William 指出,模型选型完全取决于工程团队所掌握的算力资源、开发时间和工程师技能储备。如果是一家正在搭建首个 MVP 的初创公司,最明智的做法就是直接调用 GPT 或 Claude 等第三方模型,快速上线原型并进行业务验证;但如果是身处高并发、大规模或受到严格监管的行业(例如必须保证合规性与数据主权的环境),在受控的企业安全边界内自建基础设施并部署开源模型则是极其严肃的必选项。结合自己过往在医疗行业的背景,William 分享道,当时系统的合规与安全要么通过与 GCP 签订严格的法务合规协议来保障,要么直接在内网系统中部署开源模型。 - **初创与原型开发**:优先调用第三方成熟商业 API(如 GPT、Claude),以最短时间交付 MVP 演示。 - **高合规与大规模落地**:将模型部署在自主可控的基础设施之内,以满足严格的数据驻留与行业法规要求。 --- ### [15:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=900s) 医疗场景的微调实践与知识图谱中的反直觉设计 辉瑞(Pfizer)的高级数据科学家 Johannes Plambeck 谈到,在强监管的医疗健康领域,基础模型一直是首选方案。然而在实际工程中,他总结了三个极具代表性的落地思考。以辉瑞内部用于为医药代表精选推荐内容的工具为例,系统最初引入大语言模型(LLM)的动机是确保不同备选内容之间的连贯性,利用知识图谱中的边权重(Edge Weights),让 LLM 充当“选择器”(Selector)的角色。 Johannes 对这种架构提出了反思:让 LLM 充当选择器在设计哲学上本身就值得商榷,因为这种选择逻辑很大程度上完全可以通过确定性算法(Deterministic Process)来实现。即便一定要用语言模型做选择,也完全不需要动用最昂贵的前沿大模型(Frontier Model),小语言模型(SLM)或团队自主微调的小型模型就足以胜任,而且引入人类在环(Human-in-the-loop)的评估能够有效简化上下文。此外,Johannes 指出过去半年在行业中发现了一个令他非常震惊的现象——不少团队竟然直接用 LLM 本身来预先计算知识图谱中的边权重。他对此感到十分不解,因为“LLM 本身并不擅长数学运算”,用它来计算图权重完全是一种滥用。 --- ### [17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) 模型意外行为:从通知生成的“越界”到医药合规的逆向审查 当主持人 Shane Snider 将话题引向大模型落地中最令人头疼的可靠性与故障模式时,William Tran 分享了 Meta 在系统通知重写业务中的真实案例。团队尝试利用多模态能力,根据用户上传的照片或视频自动生成更具吸引力的通知文案。然而,“有趣”在不同用户的理解中差异巨大,模型有时会生成被用户判定为“令人感到毛骨悚然”(Creepy)的内容。William 强调,对于拥有数十亿用户的平台而言,即便幻觉率只有 0.1%,受影响的用户数量也是极其庞大的绝对值。为此,Meta 投入了大量资源构建内容安全护栏(Guardrails),严格验证生成文案是否契合公司的信任与安全原则。 ```mermaid flowchart LR accTitle: Guardrail Strategy Comparison subgraph MetaApp["Meta 消费端场景"] M_In["多模态输入 / 提示词"] --> M_LLM["LLM 生成通知"] M_LLM --> M_Guard["严格安全护栏<br/>(过滤越界与诡异言论)"] M_Guard --> M_Out["安全触达用户"] end subgraph PfizerApp["辉瑞医疗合规场景"] P_In["一线医药代表现场记录"] --> P_LLM["LLM 摘要提取"] P_LLM --> P_Pass["放行潜在违规表述<br/>(不过度拦截过滤)"] P_Pass --> P_Legal["法务合规人工介入<br/>(审查利益交换风险)"] end ``` 有趣的是,辉瑞在处理故障模式时采取了完全相反的策略。Johannes 透露,在对一线医药代表填写的现场记录进行摘要提炼时,系统反而会刻意“放行”许多异常和潜在违规表述。例如,一线笔记中偶尔会出现涉嫌“权钱利益交换”(Quid pro quo)的敏感字眼,系统绝不能通过模型前置护栏把这些内容洗白或过滤掉,而必须原汁原味地呈现出来,以便法务团队能够及时介入并审查。 此外,Johannes 还提到了另一种令团队苦恼的逻辑脱节问题:在为销售人员推荐专业医学内容时,系统虽然已经通过确定性算法将市场份额、处方开具统计、医生画像等核心业务 KPI 组装进上下文,但即便使用最顶尖的模型(如 GPT-5 系列),模型依然会偶尔输出与这些 KPI 毫无关联的离谱内容。这迫使团队不断补充负样本、优化 Prompt,甚至在外部增加更多确定性的硬代码过滤层。 --- ### [21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) 推理失效的真相:量化误解与被忽视的前端解析 Bug 针对系统运行时的失效,Philip Kiely 剖析了许多人认知中的盲区。很多人误以为大模型推理是一个高度可预测且完全可重复的过程,但事实并非如此。在推理质量的衡量上,核心是模型输出对原始意图的保真度(Fidelity),即便每次运行生成的具体文本有所差异,模型在选择 Token 时所生成的 Logits 概率分布理应保持稳定。谈到导致质量劣化的元凶,许多人第一反应会联想到“量化”(Quantization)。 Philip 坦言,量化在网络舆论中往往背负着“兜售垃圾 Token”的恶名。虽然在本地端侧运行 1.58-bit 动态量化确实会带来严重的质量损失,但如果是经过严格对齐校验的量化方案(例如 NVFP4 量化),只要其生成的 Logits 概率分布与原生浮点模型高度吻合,质量就完全能够得到保障。 ```mermaid flowchart TD accTitle: Inference Engine Failure Points subgraph Frontend["推理引擎前端 (头号 Bug 来源)"] P1["Tokenizer 分词处理"] P2["输入提示词解析"] P3["工具调用 (Tool Calls) 解析<br/>(如括号、特殊字符处理错误)"] P4["结构化输出 (JSON) 格式化"] end subgraph Backend["推理后端 / 硬件层 (偶发问题)"] K1["GPU Kernel 竞态条件<br/>(高低显存带宽差异)"] K2["量化精度损失 (如极端低比特)"] end Frontend -->|"诱发常见质量崩塌"| OutputFail["模型逻辑错乱 / 幻觉 / 死循环"] Backend -->|"硬件表现不一致"| OutputFail ``` Philip 指出,真正导致推理失效的往往不是量化本身,也不是什么玄妙的未解之谜,而是潜藏在推理引擎前端(Front-end)极其平庸的基础代码中: - **前端解析缺陷**:输入解析、结构化输出格式化以及工具调用(Tool Calls)的解析逻辑是整个推理链路中最大的 Bug 来源(例如解析器无法正确处理参数中的括号)。 - **分词器(Tokenizer)边缘情况**:分词异常会导致上下文传递错位,直接引发灾难性遗忘或死循环(Doom loops)。 - **底层 Kernel 竞态条件**:个别 GPU Kernel 存在竞态条件,导致模型在不同显存带宽的 GPU 硬件之间表现出微小但致命的行为差异。 --- ### [25:08](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1508s) 规模化落地瓶颈:吞吐量优化与分离式架构 在讨论从概念验证(PoC)走向大规模生产环境的核心瓶颈时,Shane 抛出了延迟、推理成本、缓存、路由编排及量化等诸多考量。Philip Kiely 直截了当地指出,从基础设施的角度来看,生产环境的最大瓶颈归根结底就是系统吞吐量——即“每分钟 Token 数”(Tokens Per Minute, TPM),或者更具体地说是“单张 GPU 能够压榨出的每分钟 Token 吞吐量”。 为了突破这一瓶颈,工程团队一方面需要部署极致高效的推理执行引擎,另一方面则需要引入先进的架构模式。例如采用分离式架构(Disaggregation,将 Prefill 预填充阶段与 Decode 解码阶段物理分离),能够显著拉升整体的 TPM 吞吐上限。然而,架构设计始终是一场权衡取舍:如果业务对延迟有极高的硬性要求,工程团队就必须做好牺牲部分推理效率与硬件吞吐量的准备,以确保响应时间达标。 ### [26:29](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1589s) 推理性能优化的两大支柱:KV Cache 复用与解耦架构 在评估大语言模型的服务性能和工程表现时,效率始终是核心考量。除了常规的模型量化(Quantization)手段之外,推理系统的优化重心高度集中在两个关键杠杆上:**KV Cache 命中率**与**计算解耦(Disaggregation)**。 ```mermaid flowchart TD accTitle: LLM Inference Optimization Flow subgraph ClientStage["请求接入"] Req["客户端请求"] end subgraph OptimizationLevers["两大核心优化杠杆"] KVCache["杠杆 1: KV Cache 复用<br/>提高命中率,跳过 Prefill 阶段"] Disagg["杠杆 2: Prefill/Decode 解耦<br/>充分饱和多 Worker 集群"] end subgraph HardwareExecution["后端硬件执行"] GPU["GPU 计算资源节省<br/>吞吐量 (TPM) 提升 2x+"] end Req --> KVCache Req --> Disagg KVCache --> GPU Disagg --> GPU ``` 提高 KV Cache 的命中率决定了系统能够在多大程度上跳过计算密集的预填充(Prefill)阶段。一旦命中,服务就能以极低的 GPU 资源开销快速返回结果。而解耦架构(如 Prefill 与 Decode 阶段分离)则适用于具备足够流量规模的场景。当请求量足以打满大量工作节点时,部署解耦架构通常能直接带来 2 倍甚至更高的每分钟 Token 吞吐量(TPM)增益。 - **核心优化指标**:KV Cache 复用率(减少重复 Prefill 开销)与 Prefill/Decode 解耦。 - **性能回报**:在合理配置与饱和流量下,吞吐量提升通常可达 2 倍以上。 --- ### [27:24](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1644s) 从开源引擎到自研芯片:Meta 的分层优化体系 随着大模型从实验室探索迈向工业级生产环境,整个行业清晰地意识到一个现实:“我们必须从中盈利(we kind of have to make money from this)”。这迫使工程团队极其严苛地审视部署效率,包括 CPU 利用率、显存(VRAM)占用、吞吐量以及端到端延迟是否与具体业务场景精准匹配。 不同规模的应用在技术选型上呈现出明显的分层演进路径: | 阶段 / 规模 | 典型技术栈与策略 | 核心关注点 | |:--- |:--- |:--- | | **轻量级 / 自建初期** | `llama.cpp` | 本地化部署与基础推理验证 | | **中等规模生产服务** | `vLLM`、`SGLang` | 针对特定场景选型,配置虚拟云端硬件与智能 KV 缓存策略 | | **超大规模(数百万至数十亿用户)** | 自动化 Kernel 优化 Agent、定制数据中心、自研推理芯片 | 软硬件全栈协同极致压榨每瓦特算力与显存带宽 | 在 Meta 这类服务数十亿用户的超大规模场景下,优化工作深入到底层体系结构。Meta 不仅使用 AI Agent 自动优化针对特定芯片的 GPU Kernel,还在数据中心层面平衡算力与内存带宽配置;当英伟达(NVIDIA)和 AMD 的通用方案无法完全满足特定能效与成本需求时,团队甚至选择自研专用推理芯片(Inference Chips)。 --- ### [30:25](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1825s) 推理工程的复合收益:没有“银弹”,但充满倍增机会 针对是否存在某种“能瞬间让一切变简单的单一工程突破(Silver Bullet)”,工业界的共识是在复杂的推理工程中,从来没有单一的配置、引擎或硬件能包治百病。在大厂的多层技术架构中,工程师往往受到既有基础设施的约束,更多是通过引入智能体工程(Agentic Engineering)来加速模型微调与底层目标硬件的适配过程。 与高频交易(HFT)等经过数十年打磨、提升 0.01% 就足以发表论文和晋升的成熟领域不同,当前的 AI 推理工程仍处于非常早期的发展阶段: - **早期红利显著**:单项优化(如调度、Kernel 调优、内存管理)常能带来 20%、30%、甚至 2 到 3 倍的提速。 - **乘数叠加效应**:将 3 到 4 项独立的优化措施级联复合后,基础模型和实现的整体运行速度往往能实现 5 到 10 倍的飞跃。 - **业务实践建议**: - 精简模型任务,将原本确定性的逻辑剥离为工具调用(Tool Calls),避免消耗模型推理算力。 - 在无需排查故障时,避免在 Traces 中输出冗余的思考过程(Reasoning Traces)。 - 利用大模型反向分析系统 Traces,识别哪些上下文环节可以被重构为确定性规则。 --- ### [34:19](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2059s) 基础设施现实如何重塑软件开发:Agentic Engineering 与算力瓶颈 针对算力、电力、网络和大规模集群等基础设施制约是否改变了软件构建方式的问题,开发范式的重塑更多体现在“智能体化工程(Agentic Engineering)”的兴起上。团队广泛借助 Claude Code、Codex 等 AI 编码工具提升开发效率,但这种生产力的跃迁也引入了新的系统约束。 ```mermaid flowchart LR accTitle: Agentic Engineering Lifecycle and Bottlenecks subgraph DevGen["代码生成"] Gen["AI 编程工具<br/>(Claude Code, Codex)"] --> Code["代码生成速度剧增"] end subgraph Verification["验证与治理瓶颈"] Code --> ReviewBottleneck["人工评审与测试瓶颈"] ReviewBottleneck --> AutoReview["自动代码评审 Agent<br/>(处理低风险变更)"] end subgraph ComputeImpact["算力与上下文开销"] AutoReview --> TokenBurn["Token 消耗与计算成本增加"] TokenBurn --> CtxEng["上下文工程 (Context Engineering)<br/>杜绝百万 Token 窗口填充垃圾文件"] end ``` 代码生成速度虽然呈现爆发式增长,但瓶颈迅速转移到了代码审查与测试环节。为了防止未经验证的代码进入生产环境,Meta 构建了用于低风险变更的自动化代码审查 Agent。然而,软件生命周期的 Agent 化反过来又推高了 Token 消耗和算力开销,使得“上下文工程(Context Engineering)”变得至关重要——必须防止 Agent 在检索时用正则匹配到的无关文件塞满百万级 Token 上下文窗口。 在宏观趋势上,行业正在告别无节制的“Token 狂欢(Token Maxing)”。面对昂贵的推理成本和供应链约束,业界不再追求单维度的盲目扩张,而是转向在保持业务高增长的同时,通过底层 Token 来源优化和单 Token 效率提升,使成本增长显著低于业务用量增长。 --- ### [38:42](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2322s) 展望未来趋势:微调普及与知识图谱的工程化演进 在对未来几年关键突破的展望中,微调(Fine-Tuning)技术的普及门槛预计将大幅降低,使得更多团队能够低成本定制专属模型。 在具体架构演进方向上: - **模型定位转变**:大语言模型将更多作为智能“选择器(Selector)”或路由核心,而非包揽所有底层逻辑。 - **结构化知识集成**:依托嵌入向量库与向量检索的高效工程体系,知识图谱(Knowledge Graphs)的存储、检索与调用机制将进一步成熟,为大模型提供高精度、确定性的结构化上下文支撑。 ### [39:46](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2386s) 从聊天机器人迈向 Agent 时代的网络安全新挑战 随着生成式模型的技术演进,行业正从简单的微调与专用场景适配,快速过渡到更复杂的 Agent(智能体)应用场景。嘉宾指出,当大语言模型(LLM)从仅能进行单向文本对话的 Chatbot,演变成能够充当“大脑”并自主调用外部工具(Tool Calls)去执行复杂任务的 Agent 时,这也直接打开了一个全新的网络安全攻击面。 这种风险不仅限于 OpenAI 或 Hugging Face 等平台曾遭遇的模型非预期行为或意外漏洞,更潜藏着恶意攻击的威胁。例如,企业如果从网络上信誉存疑的非权威来源下载并部署开源模型,这些模型可能在预训练阶段就已被植入了恶意逻辑,一旦赋予其工具调用权限,便可能在运行时发起恶意调用。因此,随着赋予 LLM Agent 的自主操作权限越来越大,安全防御体系、防护栏(Guardrails)机制以及监控解决方案也必须以同等规模升级,以严密规避潜在风险。 - **攻击面拓展**:LLM 具备外部工具调用能力后,漏洞影响从单纯的“生成不良内容”转变为“执行恶意操作”。 - **开源供应链风险**:未经严格审计的第三方开源模型可能预置恶意触发逻辑。 - **防御协同升级**:随着 Agent 权限的扩大,护栏系统与全链路监控必须同步扩容。 ```mermaid flowchart TD accTitle: Agent 模式下的安全风险演进 subgraph Risks ["安全风险升级"] A["传统 Chatbot 模式<br/>(内容生成/意外后果)"] --> B["Agent 模式<br/>(工具调用/外部执行)"] B --> C["恶意攻击面<br/>(植入恶意 Tool Calls)"] end subgraph Defense ["防御措施扩容"] D["基础内容过滤"] --> E["运行时防护栏 (Guardrails)"] E --> F["系统级调用权限控制与监控"] end B -.-> E C -.-> F ``` --- ### [40:59](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2459s) 推理工程的前沿趋势:玩转“KV Cache 烫手山芋” 在推理工程(Inference Engineering)领域,嘉宾分享了一个非常前沿且高度专精的技术趋势——“KV Cache 烫手山芋”(KV Cache Hot Potato)。KV Cache(键值缓存)保存了模型处理先前请求时计算得出的注意力状态数据,对于维持上下文和快速响应极为宝贵,工程上极度希望保留它;但另一方面,KV Cache 体积极其庞大,会迅速吃紧本就稀缺昂贵的显存(VRAM)。 这就导致现代推理架构演变成了一场围绕 KV Cache 的调度接力赛:既想保留这份高价值数据,又不能让它长期霸占宝贵的 GPU 显存。工程师们必须将其转移到系统内存(CPU RAM)、通过网络传输、在不同 GPU 之间共享或分片(Sharding),或者在“预填充节点(Prefill Workers)”与“解码节点(Decode Workers)”之间进行解耦流转(Prefill-Decode Disaggregation)。面向下一代 GPU 硬件(如 NVIDIA 的 Rubin 架构)以及各类新型加速硬件,KV Cache 卸载(Offloading)与计算解耦正成为核心能力,如何把这场“KV Cache 烫手山芋”的调度游戏玩到极致,已成为推理工程的核心焦点。 - **KV Cache 的两难困境**:计算复用价值极高,但显存占用极大。 - **数据调度流向**:VRAM $\rightarrow$ 系统内存(RAM) $\rightarrow$ 网络传输 $\rightarrow$ 跨 GPU 分片 / 节点共享。 - **架构解耦(Disaggregation)**:在 Prefill 阶段与 Decode 阶段之间高效流转 KV Cache。 - **硬件演进支撑**:包括未来的 NVIDIA Rubin 架构在内的新一代硬件正在原生强化 Cache Offloading 与解耦能力。 --- ### [42:32](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2552s) 圆桌总结:生产级 AI 是一门复杂的系统工程 主持人对全场讨论进行了系统性收尾,感谢各位技术专家在模型构建与工程实践中所分享的实战经验。回顾整场专题,讨论涵盖了模型架构设计、模型选型、安全护栏、生产环境部署、规模化扩展以及底层基础设施优化等多个关键维度。 主持人在总结中强调,当今构建生产级 AI 系统早已不再只是纯粹的机器学习问题,而是一个极其庞大且严密的**系统工程(Systems Engineering)问题**。AI 系统的落地与成功,高度依赖于软件工程、底层基础设施、网络通信、运维管理(Ops)、安全保障以及持续评测(Continuous Evaluation)等多学科团队的深度协同与紧密配合。最后,全场在对嘉宾们精彩洞见的掌声中圆满落幕。 ## Notable quotes > [03:56](https://www.youtube.com/watch?v=FS64MoF9jlk&t=236s) 将庞大图谱直接硬塞入 Context 被证明是最糟糕的方案,系统必须转向采用模型上下文协议(MCP)和结构化的工具调用机制。 — Johannes Plambeck > [10:43](https://www.youtube.com/watch?v=FS64MoF9jlk&t=643s) Kimi K3 是无需加任何限定词的顶尖前沿模型(No caveats)。 — Philip Kiely > [12:55](https://www.youtube.com/watch?v=FS64MoF9jlk&t=775s) 选型完全取决于团队所掌握的算力资源、开发时间和工程师技能储备,核心是为不同场景选择最合适的工具。 — William Tran > [15:00](https://www.youtube.com/watch?v=FS64MoF9jlk&t=900s) LLM 本身并不擅长数学运算,用它来预先计算知识图谱中的边权重完全是一种滥用。 — Johannes Plambeck > [17:26](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1046s) 对于拥有数十亿用户的平台而言,即便幻觉率只有 0.1%,受影响的用户数量也是极其庞大的绝对值。 — William Tran > [21:53](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1313s) 真正导致推理失效的往往不是量化本身,而是潜藏在推理引擎前端极其平庸的基础代码中。 — Philip Kiely > [25:08](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1508s) 从基础设施的角度来看,生产环境的最大瓶颈归根结底就是系统吞吐量——即单张 GPU 能够压榨出的每分钟 Token 吞吐量(TPM)。 — Philip Kiely > [27:24](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1644s) 整个行业清晰地意识到一个现实:我们必须从中盈利(we kind of have to make money from this)。 — William Tran > [30:25](https://www.youtube.com/watch?v=FS64MoF9jlk&t=1825s) 在复杂的推理工程中,从来没有单一的配置、引擎或硬件能包治百病,但将多项优化措施级联复合后,运行速度能实现 5 到 10 倍的飞跃。 — Philip Kiely > [42:32](https://www.youtube.com/watch?v=FS64MoF9jlk&t=2552s) 当今构建生产级 AI 系统早已不再只是纯粹的机器学习问题,而是一个极其庞大且严密的系统工程问题。 — Shane Snider ## Mentioned Shane Snider, Philip Kiely, William Tran, Johannes Plambeck, Baseten, Meta, Pfizer (辉瑞制药), Facebook, OpenAI, Anthropic, Google Cloud (GCP), Hugging Face, NVIDIA, AMD, Kimi K3, GLM 5.2, Nvidia Nemotron 3 Ultra, DeepSeek V4 Flash, GPT-5.1, Claude Code, Codex, llama.cpp, vLLM, SGLang, Rubin 架构 ## Video description Shane Snider - Senior Writer, DCK Philip Kiely - Developer Advocate, Baseten William Tran - Engineering Manager, Creative AI, Meta Johannes Plambeck - Senior Managing Data Scientist, AI Engineer, Pfizer Inc.| Hear from builders and users some of the most powerful generative systems in use today. Panelists will explore the engineering choices behind LLMs, diffusion models, and hybrid architectures, along with lessons from scaling and deploying these models safely. Topics include controlling generation, reducing hallucinations, and choosing between open-source vs proprietary stacks.This panel will gather technical experts working to build and deploy generative AI systems to help you understand the cutting edge. [Source](https://www.youtube.com/watch?v=FS64MoF9jlk)

Source quotes

[3:56] Johannes Plambeck: 将庞大图谱直接硬塞入 Context 被证明是最糟糕的方案,系统必须转向采用模型上下文协议(MCP)和结构化的工具调用机制。 [10:43] Philip Kiely: Kimi K3 是无需加任何限定词的顶尖前沿模型(No caveats)。 [12:55] William Tran: 选型完全取决于团队所掌握的算力资源、开发时间和工程师技能储备,核心是为不同场景选择最合适的工具。 [15:00] Johannes Plambeck: LLM 本身并不擅长数学运算,用它来预先计算知识图谱中的边权重完全是一种滥用。 [17:26] William Tran: 对于拥有数十亿用户的平台而言,即便幻觉率只有 0.1%,受影响的用户数量也是极其庞大的绝对值。 [21:53] Philip Kiely: 真正导致推理失效的往往不是量化本身,而是潜藏在推理引擎前端极其平庸的基础代码中。 [25:08] Philip Kiely: 从基础设施的角度来看,生产环境的最大瓶颈归根结底就是系统吞吐量——即单张 GPU 能够压榨出的每分钟 Token 吞吐量(TPM)。 [27:24] William Tran: 整个行业清晰地意识到一个现实:我们必须从中盈利(we kind of have to make money from this)。 [30:25] Philip Kiely: 在复杂的推理工程中,从来没有单一的配置、引擎或硬件能包治百病,但将多项优化措施级联复合后,运行速度能实现 5 到 10 倍的飞跃。 [42:32] Shane Snider: 当今构建生产级 AI 系统早已不再只是纯粹的机器学习问题,而是一个极其庞大且严密的系统工程问题。

Source quotes

[0:04] Philip Kiely: I did not receive the memo that we're supposed to wear a suit today. I guess that's what happens when you bring a startup engineer to a panel. [0:04] William Tran: basically half the planet [3:27] Johannes Plambeck: pretty embarrassing [6:58] William Tran: tens of billions of events per day [12:55] Philip Kiely: I also sell open model tokens. So I'd love to hear from someone who doesn't. [17:26] William Tran: really interesting [21:53] Philip Kiely: garbage tokens [26:29] William Tran: everybody realize we kind of have to make money from this. [34:12] Philip Kiely: I liked token maxing, you liked token maxing, token maxing was fun guys... can't do that anymore apparently because everything's too expensive. [40:59] Philip Kiely: KV cache hot potato

Original transcript

[0:04] You know, over the past few years, we've  watched generative AI evolve from research [0:08] projects and impressive demos into production  systems that are changing the way organizations [0:15] build software, serve customers, and  automate work. What's fascinating is [0:20] that the conversation has changed  dramatically. A couple of years ago, [0:25] it feels like a long time ago, doesn't it?  Um, everyone wanted to talk about model size. [0:31] Today, engineers are thinking about very different  problems. They're thinking about latency, [0:36] infrastructure, reliability, evaluation,  guardrails, GPU availability, cost, networking, [0:45] and how to deploy AI systems that  people can actually depend on. [0:50] That's exactly what we're going to explore today.  And rather just than just talking about AI and [0:56] theory, we're going to hear from engineers who  are building and deploying these systems today. [1:02] We'll discuss how they choose models,  how they design architectures, [1:06] what breaks in production, how they scale, and  where they believe the technology is headed next. [1:12] Let's begin by meeting our esteemed panel.  Um, we're going to do brief introductions, a [1:19] couple sentences. Um, just take about a minute. uh  tell us who you are, what your organization does, [1:27] what you're building, and what's consuming  most of your engineering attention right now. [1:34] Hey everyone, I'm Philip Kylie from Base 10. Um  I did not receive the memo that we're supposed to [1:39] wear a suit today. I guess that's what you have  what happens when you bring a startup engineer [1:43] to a panel. Uh at base 10 we focus on inference  as well as other aspects of AI infrastructure [1:50] training and you know everything else that you  need to build a fully functioning AI application. [1:57] But you know the the big thing that we've been  working on recently is day zero support for new [2:03] open source models. For example when Kimmy  K3 came out three times bigger than anything [2:07] we've seen before a brand new architecture  a lot of engineering work goes into that. So [2:12] that's been a really fun journey to work on and  I'm super excited to share more details about [2:18] what goes into standing up models very  quickly and making them very reliable. [2:26] Hello everyone. Uh my name is William. I work  at a small company called Meta and uh I'm an [2:33] engineering manager over there. Uh my team is  responsible for um the Facebook notification [2:39] experience for basically half the planet and right  now we are working on applying OM and generative [2:48] AI to make that experience more creative,  more expressive, more personalized to you. [2:55] Hello everyone, my name is Johannes Planbeck. I'm  a senior managing data scientist and AI engineer [3:03] at Fizer. I work primarily on the North American  commercial side of the business, supporting [3:11] marketers and sales representatives with AI  tools that help them identify approved content [3:19] that can help them in their engagements and  conversations with doctors. Good to meet you guys. [3:27] Thank you guys. Um it's always interesting  to hear how different teams are approaching [3:32] similar problems. Um so let's let's dive  in. Um I'd like to start at the beginning. [3:39] Um think about a generative AI  application you've recently deployed [3:43] or one that you're actively building. Walk us  through it. What problem were you trying to [3:48] solve? What architecture did did you choose?  And why did you make those design decisions? [3:56] I can start with that. [3:59] At Fiser, [clears throat] we have an entire field  force that goes out and they have to solicit to [4:06] doctors marketing materials that will help doctors  understand what differentiates a Fiser drug from [4:15] a competitor drug. When engaging the doctors, one  of the first things that the marketers do is they [4:21] try to identify the segment that the doctor  might fall in. Is this a highvalue doctor? [4:27] Is this a lowv valueue doctor? Is this a  doctor that works primarily with teenagers? [4:34] When they identify the segment that they have  to talk to, they are supposed to divulge only [4:40] approved content that has gone through really  strict compliance and marketing controls. [4:46] So an AI system has to not necessarily generate  content for them to dulge to the doctor but really [4:55] curate content verbatim from source documents. So  the challenge in a system like this is actually [5:03] guardrailing the system to prevent it from  hallucinating anything that might come out of [5:08] the source material but then also ensure that  the insights that are generated are coherent [5:14] with one another. So to wrap this up, some of the  things that are key concepts to a system like this [5:21] include knowledge graphs for clustering  like information with other information [5:28] and then relegating as much of the LLM work  out of this non-deterministic process into [5:34] a deterministic process where cosign  similarity matching KPI firing is done [5:42] essentially to strip out as much of the  latency that the LL I might experience. [5:49] Johans, um, was there anything that surprised  you at all during the development or anything [5:54] that you would go back and change considering  what you know now? The complexity of these [5:59] projects in a corporate setting is really around  coordination more than it is around engineering. [6:07] When working with vendors, a lot of the vendors  decided maybe relegate as much context to the LLM [6:13] as possible. In one runtime, I found around 57,000  characters fed into a fi a GPT 5.1 context window. [6:25] That led to latencies of around 15 seconds  for a system that's supposed to provide [6:31] content to a representative in a live demo.  Something like that is pretty embarrassing. [6:38] So, this necessitates probably the use of  LLM tool calls, packaging the tools into MCP, [6:47] all that stuff. Um, working with a knowledge  graph like this and injecting it into context [6:52] is probably the worst thing you could possibly  do. Terrific. Whoever wants to jump in next. [6:59] Yeah, I'll jump in next here. Um, and I'll come  in from basically the other side of that spectrum. [7:06] Um for us our LM deployments are not really online  uh where you are having an interactive experience [7:15] with the user is actually more behind the scene.  We are using LM for ranking. We're using LM for [7:23] writing out the copy of your notification. Um  and at meta scale that means on the order tens [7:30] of billions of events per day, right? uh which  brings a very different set of challenge. Um [7:38] these days honestly with claw code and uh  with the latest crop of large language model [7:44] they are very capable. So you can build a  quick and dirty like MVP very quickly. Um [7:52] but for it to scale to our level uh there's a lot  of engineuring effort involved to make sure that [8:00] the LM deployment is efficient enough to  justify um you know the cost of doing it. [8:08] Um to that end we mainly focus on using smaller  lash language model on the order of let's say [8:17] 8 to 10 billion parameters and fine-tune them  for our use case. Maybe use a student teacher [8:24] distillation setup to really make that model  adapt to the use case that we wanted to do. [8:34] Um, so we have a pretty robust automated  pipeline for training and fine-tuning as well as [8:42] honestly multiple engineing teams uh making sure  that these fine-tuned models are then being served [8:50] um through our infrastructure um and maintain uh  the throughput that we require them to have. Yeah. [9:00] Terrific. you Johannes William you you  guys you guys could not have set me up [9:04] better here. Thank you. Um what I focus  on primarily at the infrastructure layer [9:11] is supporting the complete range of outcomes  that are possible within a LLM deployment. [9:18] You can think about a paro frontier between  latency and throughput where if you want your [9:24] time to first token for your active sales demo to  be, you know, within a few hundred milliseconds [9:30] so that it feels real time, fantastic. We can  push things in that direction. If you want to [9:35] push 10 million queries per day, fantastic. You  can push things in that direction. And the the [9:41] technical levers for doing this are actually  quite straightforward. You can adjust the batch [9:47] sizing. You can adjust the parallelism. Um, you  know, you can switch from maybe like a a TP like [9:53] tensor parallel type setup for a very low latency  use case to maybe a wide expert parallelism, high [9:59] attention data parallelism, etc. for ML throughput  aware use case. And along the way, you know, [10:05] you can also shade off the hardware you choose  to use. um you know maybe some of your queuing [10:11] strategy uh quite quite a bit of other things in  the infrastructure level as well. But ultimately [10:16] what that gets you is complete control over you  know rather than taking out of any arbitrary API [10:23] the performance and price characteristics that are  chosen for you uh by doing inference yourself you [10:30] get to take ownership over that paralle frontier  decide exactly where makes sense for the thing [10:35] you're trying to build and then just tweak a few  settings to hit that on the dot. Fantastic. Um, [10:43] you know, one thing I think it's becoming  clear is that architecture depends heavily on [10:49] the technology stack that that you choose.  So, let's talk a little bit about that. Um, [10:54] every engineering team eventually faces the same  question. Should we use open- source models? [11:01] Should we use proprietary APIs? Should we combine  them both? How are you making that decision today? [11:07] And what what trade-offs matter the most? latency,  infrastructure cost, customization, governance, [11:14] security. Philip, I mean we are fortunate to  see a massive inflection in open model use. [11:23] This is driven by a few different trends. One is  that open models are just very good now. Kimmy K3 [11:29] is a fantastic frontier model. Not a fantastic  open- source frontier model, just a fantastic [11:34] frontier model with no caveats. You have models  like GLM 5.2 2 which are amazing for coding. [11:40] You have models like Nvidia Neotron 3 Ultra which  are fantastic you know within the enterprise [11:45] within regulated industries. You have Deepseek V4  Flash just came out. It's the ninth smartest model [11:51] in the world and you can get a million output  tokens for 26 cents. You know the the range of [11:57] open models out there is absolutely fantastic. And  so what we are seeing is that these open models [12:03] throughout the industry are winning token share.  They are winning workload share across everything [12:08] across startups and individual developers who  just want a cheaper uh source [clears throat] of [12:14] intelligence to plug into their coding  harness that they use for their daily work [12:18] all the way up to you know major AI native  companies and enterprises looking at the [12:23] AI powered applications that they're shipping and  saying hey we need to cut our cost 80% we need [12:28] to improve our performance characteristics and  adopting open models. I think that the the future [12:33] that we're all building toward is a world of  highly heterogeneous models. There are going to be [12:38] a large number of closed models and a large number  of use cases that make sense for those. There [12:43] going to be a large number of open models and use  cases that make sense there. So I don't really [12:48] see it as a closed model or open model outcome.  Rather a complete ecosystem where all of these [12:55] different options exist and AI workloads become  specialized enough and differentiated enough to [13:01] actually fill in all of these niches. Are today's  open models good enough for most enterprise work? [13:12] Any anyone? I mean I think so. But  I also sell open model tokens. So [13:16] I'd love to hear from someone  who doesn't. Fair enough. Yeah. [13:20] Um so I can jump in and answer here. Um at Meta  we do use open source models. Um [laughter] [13:28] in addition to first party and also second  party models from GCP from Antropic and so on. [13:35] Um so we do have a very fortunate position  in the sense that we have access to all the [13:42] different options that are available there and  we are able to pick the right tool for the job. [13:49] Um and what that means is uh different for every  other engineing team right depending on the [13:55] amount of resources that is available to you  in terms of compute in terms of developer time [14:01] in terms of developer skill set as well right  um if you're a smaller startup you know just [14:07] standing up your first MVP definitely just go  and use um a third party model like GPT or cloud [14:16] and get it up quickly and get your demo out. Um  but if you're working at scale, if you're working [14:21] in a highly regulated environment, uh where you  have to ensure compliance and data sovereignty, [14:27] um then hosting your own models on infrastructure  that you control within your parameter is [14:34] something that you should seriously consider.  Um I do have background in healthcare as well. [14:40] Um so in my previous job a lot of our deployment  was either secure through legal and compliance [14:50] contract with GCP or simply deploying open  source model within our system. Um yeah [15:00] certainly within healthcare compliance is a  huge issue. Um, therefore, in any conversation [15:09] I've been in, foundation um foundation models are  the preferred go-to. Um, as far as model choice, [15:18] I see three uh three potential use cases that  I've encountered many times at Fizer. One, [15:29] human in the loop evaluation. Some of these  contexts, they can get pretty complicated [15:36] depending on what you're trying to use  the LLM for. The original use case for [15:41] this sales representative tool that I'm talking  about that curates content, um, its motivation [15:49] for using an LLM was to enforce coherence between  potential content. And so there are these weights, [15:58] edge weights that are used in a knowledge graph  that motivate the use of the LLM as a selector. [16:05] If an LLM is being relegated the role of  a selector, um, one, there may be some [16:11] um, philosophical issues maybe around using an  LLM as a selector. You I think a lot of that work [16:17] could be deterministic, but if you do use it as  a selector, I don't think you need a a frontier [16:23] model to do that work. I think you could get  away with an with an SLM, fine-tune your own LLM. [16:32] Um [clears throat] other than that, other than  human the loop evaluation um to simplify the [16:39] context and then using using an SLM instead  of an LLM um I think we have run into some [16:50] issues as well with pre pre-calculating the edge  weights in the LLM using the LLM itself. This is [17:00] I'm surprised that this is  being done in the industry. Uh [17:05] I don't know why why people would do this. Um  typically LLMs aren't very good at doing math, [17:11] but I'm still seeing people using the LLM to  actually come up with weights in these graphs. So [17:20] surprising finding in the work that  I've done in the last six months. [17:26] I think that's a great segue into our next uh  discussion. Uh no matter what models you choose, [17:32] eventually something unexpected happens.  Anyone who's built AI systems knows that. [17:37] So let's talk about reliability.  Um guard rails and reliability. [17:44] I'd love for each of you to think about a real  engineering story and tell us about a time when [17:49] a model behaved in an unexpected way. Maybe it  happened during testing. Maybe it happened after [17:55] deployment. What happened? How did you guys  discover it and and what changed afterwards? [18:06] I I'll take the first step at this. [18:08] Sure. Um so to take the use case of  notification, right? Um um to bo it down um [18:16] we are trying to use to rewrite the notification  content um so that it appeals to you more. Um, [18:24] and with that comes the risk of the LM just go  completely off the rail when you give it like a [18:30] photo or video and say, "Hey, write a notification  about this." That makes it really interesting. [18:36] Uh, interesting can mean very different things to  very different people. [laughter and gasps] And [18:41] in some cases, the LM just generates something  that could be considered creepy, for example. [18:48] Um and we are very concerned about that because  even if the hallucination risk is only let's say [18:56] 0.1% for a billion people that's already  a very large population affected. [19:03] Uh because of that we invest a lot in building  out this gut rail that verify um where the the [19:12] copy that the LM is generating conform to all of  the trust and safety principles that we establish [19:20] within MEA. Um, now you know, you might not really  think of Meta as a company that um, you know, um, [19:29] yeah, we we actually care a lot about this  despite all the internet reputation, right? [19:37] Um, so me and my team, we spend a lot of time  thinking about how can we make this better, safer [19:46] um, for all of our users across the world. [19:51] From [clears throat] Fizer's perspective, uh,  we actually try to let a lot of failure modes [19:58] pass through the LLM system. U, there's a  reason why a legal team might get involved [20:06] in flagging what gets summarized from, let's  say, the notes that are taken in the field. [20:13] Um, some of those notes might include  language that sounds like quidd proquo. So [20:18] you don't necessarily want to guard rail against  things that sound non-compliant in the field. So [20:26] that's that's one kind of interesting mirror  image of what Williams talking about. Um, [20:34] as far as other failure modes go when it comes to  serving out uh recommendations for salespeople, [20:41] [clears throat] coherence, I talked about that  one. Um, since the the content that's served [20:48] is supposed to be correlated in some way to the  business environment via KPIs like market share [20:55] statistics, um, prescription writing statistics,  other um, doctor characteristics. There are there [21:05] are plenty of cases that I've seen where you use  a deterministic process to serve out the universe [21:12] of metrics that matter. you correlate that to the  content that you want to serve out, it all goes [21:18] into the context and then somehow you end up with  content that is completely irrelevant to the KPIs [21:26] that they talk to. And this is using like 5.1, GPT  5.1 or 5.5. So certainly um there are plenty of [21:36] opportunities for doing robust guard railing that  lead to new ones examples, negative examples that [21:44] you might use in your prompt or even code changes,  deterministic filters that you might implement. [21:53] I want to talk about one of the most  interesting failure modes in AI, [21:56] which is the failure of the model itself  at inference. So a lot of people think [22:02] of inference as this very predictable and  repeatable operation when it's in fact not. [22:09] The way we think about quality is about fidelity  to the original intent of the model. Models work [22:17] by generating probability distributions from their  selecting tokens. the the logits that you generate [22:23] should be the same uh from uh from model to model  even if the outputs or from from run to run even [22:29] if the outputs are different. So there's a few  things that can affect quality here and and cause [22:35] some failure modes including you know catastrophic  forgetting doom loops all all kinds of stuff. [22:40] Um you know one one of the things that often  gets blamed and maybe we can play a little [22:45] word association game here is quantization.  When I say quantization, what do you think? [22:51] Efficiency. Efficiency. Okay. I like efficiency.  Binning. Binning. Yeah. Histogram binning. Yep. [22:59] Yep. Binning. Like like squishing all of this  stuff together in in a in a way that um you [23:05] know doesn't doesn't really preserve a lot of the  nuance to the data. Um and [clears throat] when I [23:10] say quantization on the internet, uh what I  hear is uh you're selling me garbage tokens. [23:18] I think quantization has a very  bad reputation honestly. Um [23:22] I I think that some to some degree it's justified.  You know obviously if you're doing local first AI [23:27] where you have to do like a 1.58 bit dynamic  quantization yes you're going to lose quality. [23:33] But if you are, you know, doing a a pretty  responsible like NVFP4 quantization, if you are, [23:39] you know, running that quantized model  against the main model, mapping the logits, [23:43] making sure that the probability distributions  are the same, then you know that's that's probably [23:48] fine. And and then you also have models that you  run where you are running a model at the native [23:54] weights and you still have quality issues. So  if it's not quantization, where do these quality [23:58] issues come from? It turns out that there's a  lot of sneaky places in inference where errors, [24:06] issues can can sneak in. Like you can even have  a race condition in a kernel that causes a model [24:11] to behave differently on one GPU versus another  GPU that maybe has a higher memory bandwidth. [24:17] But the most common cause is actually in the front  end of the inference server where you are parsing [24:24] the inputs, you're parsing your tool calls, you're  parsing your outputs, your structured outputs, [24:28] your tool choices, all of that kind of stuff. That  is you're doing the tokenizer that is actually [24:33] like the number one source of bugs in inference  is that front-end aspect of the inference engine. [24:40] And so a bunch of surprising failure  modes that you might expect are due to, [24:46] you know, some nebulous and unknowable piece of  the mysteries of inference are actually just like, [24:52] oh yeah, the tool cars was, you know,  not handling parenthesis correctly. [24:57] Um, so that's that's a surprising outcome and and  one that's always worth bearing in mind and and [25:01] fixing during the inference process. I I think I  can speak for all the non engineers in the room [25:08] and I thank you guys for uh giving us a definition  of quantization. [laughter] Um all right, let's go [25:18] talk a little bit about scaling. Um building  an impressive demo is one thing. Building a [25:23] production system is something completely  different. As your systems moved from proof [25:29] of concept into production, what became  the biggest bottleneck? Is it lat latency, [25:36] inference cost, caching, routing,  orchestration, quantization, [25:44] biggest bottleneck on efficiency? Yeah. Uh  I mean from an infrastructure perspective, [25:52] it's it's basically just throughput,  right? Like how many tokens per minute? [25:56] How many tokens per minute per GPU are  are you able to push through your system? [26:00] And some of that comes down to you know  implementing an efficient engine. Some of it is [26:05] implementing techniques like disagregation  for example massively improves TPM throughput. [26:11] But uh you know a big a big piece of it is just  you know picking the the right configuration like [26:18] I was talking about earlier. you know if you are  doing a latency sensitive deployment like you just [26:23] are going to give up some some efficiency and some  throughput in order to meet those characteristics. [26:29] So yeah, from a from a performance perspective, uh  from an engineering perspective, you're generally [26:35] thinking about efficiency. Yes, in terms of  quantization, uh but primarily in terms of like [26:40] how good is your KV cache hit rate, uh because  that's going to determine how often we can skip [26:44] prefill, just give you back a response very very  quickly and and not have to use very many GPU [26:49] resources to do that. And then are we going to get  disagregation up and running for this workload? Do [26:55] you have enough traffic to saturate the large  number of workers that it makes s that that is [26:59] required for for this setup to make sense? And in  that case, yeah, you're going to see, you know, [27:05] obviously it varies a little bit by config, but  but maybe like a a 2x gain in in TPM throughput. [27:11] Uh some sometimes more actually. So those  are the the two big levers on the technical [27:16] side for efficiency are KV cache reuse, KV  cache hit rate. Um and then disagregation. [27:24] Yeah, I think as LM workloads move from  the lab into production and scale up, [27:31] we are finally hitting the time when everybody  realize we kind of have to make money from this, [27:37] right? And that means you really have to care  about the efficiency of your deployment. Are you [27:44] using all of your CPU, the VRAM that's available?  are you serving it um at the right throughput and [27:52] at the right latency for your use case. Um and  as you get kind of more sophisticated with this [27:59] um you realize that there's an incredible amount  of engineering that goes into this stack right as [28:07] most you know common users um I mean when they  go beyond using the third third party API and [28:16] models and try to deploy it themselves um their  first exposure is probably to lama.cpp CPP or if [28:25] you're serving it on a server then uh it's time to  break out VLM or SG lang as your inference engine [28:33] and each of these are tuned for a different use  case right so you have to pick the right inference [28:39] engine for your application and then you have to  pick the right set of configuration as well um [28:47] uh for the hardware setup that you have um  for deployment. I think that should be enough, [28:55] right? Picking the right um kind of hardware,  virtual hardware that you rent on the cloud [29:03] plus the right inference engine for your workload  and then it's just a matter of software engineing [29:08] and smart caching uh to make sure that you're  not like recalculating the KV cach for example [29:14] uh unnecessarily. However, as it continue to  scale out, right, and you are serving not just, [29:21] let's say, 1,000, 10,000 users, but you are  serving millions or billions of users, that goes a [29:29] lot deeper than that. Um, at Meta, I mean, we have  um AI agents that uh optimize the GPU kernel for [29:38] you automatically to squeeze out the performance  of your model on a particular infant trip. [29:46] uh we design data centers to make sure that  you know we're we're using a good balance of [29:55] compute and RAM that's available. Uh and we  go even into designing our own inference chip [30:02] as well. Uh because sometimes what Nvidia  and what AMD gives you is not enough, [30:09] right? So there are levels to this and uh as you  continue hopefully to be more successful in your [30:17] deployment, you discover that um there's just so  much more. Yeah. Was there an optimization that [30:25] you know had the biggest payoff for for your  project and you know was there some engineering [30:30] um decision that suddenly made everything else  easier? Um I would say at meta scale not really. [30:40] um because there's already so many smart people  working at all the different layers of the stack. [30:45] So um it's a longer term strategy I would say  at the at the individual engineering team level [30:54] uh you're kind of constrained by  decisions that are made before you right [30:59] and the hardware infrastructure that is available  to you. Um but what we definitely try to do is [31:07] to use agentic engineering right to speed up the  process of optimization and also adaptation right [31:15] if we are fine-tuning a new uh base model for a  new use case for example we have to think about [31:22] okay so what kind of inference trip this is going  to run on and then you have to target that. Yeah, [31:29] I think William makes a really great point. Within  inference engineering, there's never one silver [31:33] bullet that just solves everything. It's not  one config. It's not one engine, one piece of [31:38] hardware. It's a large number of different factors  working together. That's what we've consistently [31:43] observed across all of our different deployments.  What I will say though is that there's quite a [31:48] lot of evidence that this space is very early.  If you think about for example optimizations in [31:54] finance and something like trading where there's  been 50 years of engineering effort to make this [31:59] as efficient as possible. If you get you know  1% of 1% improvement on some system you might [32:06] actually be you know writing a paper and getting  a promotion about that. When we roll out inference [32:11] optimizations it's usually this is 20% faster  30% faster twice as fast three times faster. [32:17] And then usually those three or four different  optimizations that are stacking and multiplying to [32:22] the point where you've taken a a base model and a  basic implementation and made it five or 10 times [32:27] faster. What that suggests to me is that we're  still very early because if we're still finding [32:33] opportunities here and there and everywhere  in the stack for 20 30 50 100% improvements, [32:39] then you know once those run out then it's  going to be 5 10% improvements, 1% improvements [32:46] down and down and and as of course the deployments  get bigger those stay very very meaningful. [32:51] So, it's just a very exciting time to be working  in that space. And it suggests to me that we're [32:58] still a long way from a, you know, perfectly  optimized system for just about anything. [33:06] I'd say from a more layman's perspective,  there are a couple things you could check. One, [33:11] um, caching that's been mentioned that can improve  performance. two, don't write uh don't write the [33:18] reasoning in the traces if you don't have to.  There are clear tradeoffs between um inference, [33:26] production, and human in the loop testing. So,  keep those things in mind. Um other than that, [33:37] uh strip out as much as you can from the work that  the LLM has to do. If you can't fine-tune and you [33:44] can't use a smaller model, then maybe you should  try to uh provide or have the LLM do less work. [33:50] So, use um use uh tool calls in the LLM. Try to  strip out as much of the reasoning as you can. [33:59] Uh that sounds or feels like it's deterministic.  seems a little counterintuitive, but you could [34:05] even use the LLM to try to figure out what part  of your context you could make more deterministic [34:12] uh when you analyze your traces. Great. Well,  since I spend most of my time at data center [34:19] knowledge covering AI infrastructure, I'd  like to drag you guys into my wheelhouse um [34:24] and shift the conversation toward infrastructure  supporting these models. Um, infrastructure has [34:30] become one of the biggest conversations in  AI. GPUs, networking, power, inference costs, [34:36] massive clusters. Have those infrastructure  realities changed the way you build software? [34:48] Changed the way we build software. [34:52] Um I'm not sure if there's a direct link  between like all the data centers that [34:57] are being built versus the way that my  team operates on a day-to-day basis. [35:01] Um but I think the rise of agent tech engineing  right where we are using claw code and codec and [35:09] all of these other different tools to help us  accelerate um it does present new constraint right [35:18] uh to the way that we work. Uh for example the  velocity of code being generated is a lot faster [35:26] but we're still primarily constrained by the  amount of code that we can review and test. [35:31] uh you don't want to push uh unverified code to  production for example. Um so then we actually [35:40] at Meta we actually end up creating an automated  code review agent for kind of lower risk changes. [35:47] Um that is one way you can deal with it. uh  but at the same time that does increase your [35:53] compute demand as well as more and more of this  software life cycle uh go into uh an Asian loop [36:02] right um then you're consuming more tokens you  have to burn more pay [clears throat] more and [36:10] uh at that time it comes back to context entering  for example right uh you definitely want to make [36:15] sure that your agents are accessing the right  thing and not really just filling up as million [36:22] token context window with like junk from unrelated  files that just happen to match a record. Yeah. [36:30] Have have infrastructure constraints  forced a a software redesign at any point? [36:38] Um well going back to the  architecture for my team right [36:43] we are designing the architecture around  the LM use case and around the amount of [36:49] kind of throughput that we need right so  everything has to be optimized for for that [36:58] I think a lot of the trends in the industry that [37:01] we're seeing today are downstream of  these infrastructure effects you know [37:06] I liked token maxing you like to token maxing  was fun guys you know uh can't do that anymore [37:13] apparently because everything's too expensive  uh you know there's there's a lot of demand I [37:19] think for for the open models for the lowerc  cost options driven by the the reality of [37:25] enormous amounts of supply constraint within this  industry at at just about every level of the stack [37:31] so what I've seen is a move from a philosophy  of growth, growth and only growth to [37:44] still having the same growth expectations. Still  thinking of the pace of the industry as the same. [37:51] still thinking of, you know, hitting the same  aggressive scaling targets in terms of usage, [37:57] but trying to grow that usage, continuing, you  know, through that that that linear even that that [38:03] better than linear growth while scaling costs at  a less than linear scale. Um, generally due to, [38:11] you know, aggressively optimizing the uh token  source under the hood. That's the biggest lever. [38:18] And then from there, you know, figuring out how  to use each one of those tokens more efficiently. [38:23] Fantastic. Um, I think we're getting close. We've  got about six minutes left. If you guys wanted to [38:29] hit the last question, unless Johannis, if  you had had a thought you had to get out, [38:36] we can go with the last question.  Sure. All right, let's do it. Um, [38:42] we spent most of our time talking about where  things are today. Let's finish by looking ahead. [38:48] What comes next? I'd like each of you to make  one prediction looking ahead. What capability, [38:54] architectural change, or engineering breakthrough  will have the biggest impact on how Gen AI systems [39:00] are built and deployed over the next few years.  We'll keep it to just a couple minutes a piece. [39:09] I think we're entering a stage where fine-tuning  is going to be more accessible um for everyone. [39:18] I'm not really sure what that looks like though.  But I mentioned my my particular problem has to [39:23] do with using the LLM as a as a selector and  assuming a lot of the engineering work around [39:32] storing knowledge graphs graphs as  embeddings and vector stores and [39:39] calling those things out efficiently is done.  Then I'd say the the next step is really just [39:46] fine-tuning your exact use case. So  I think that's where we're headed. [39:54] Um yeah, for me as everyone moves from  a simple LM power chatbot application [40:02] towards a more agentic uh scenario where this LM  brain can make two calls out um to do stuff. Um, [40:14] I think that does present a new attack  vector for cyber security risk where [40:21] it's not just unintended consequences like what  OpenAI and Hugging Face just went through, right? [40:29] uh but it could be when you are deploying an  open- source model that you get from maybe a less [40:35] than reputable source on the internet that can be  pre-trained to make malicious tool calls as well. [40:43] And as you give more abilities to these LM  agents, you have to scale up your defenses [40:51] scale up your gut rail and monitoring  solutions accordingly to avoid that risk. [40:59] I have very very specific technical trend that  I've been paying attention to recently within [41:03] inference engineering and uh you know for  forgive me if this concept is too technical [41:09] uh but I've been paying a lot  of attention to hot potato [41:13] specifically KV cache hot potato as we look at  you know the the KV cache it holds the previous [41:22] requests that you've uh that you've processed  and the information that the LLM calculated [41:27] to serve that. So it's highly valuable. The KV  cache is important. You want to hold on to it, [41:33] but at the same time it's big and it takes up VRAM  which is very scarce. And so a lot of the recent [41:39] infrastructure work in inference engineering is  this game of KV cache hot potato. You have this [41:45] valuable thing that no one wants to hold on to. So  you move it to the uh you know the system memory, [41:52] you move it to network, you share it or short it  between GPUs. uh you pass it from the pre-fill [41:59] workers to the decode workers and disagregation  and as we look ahead to you know the upcoming [42:05] Ruben generation of GPUs as well as uh you  know other hardware options that are coming out [42:10] what we see is an increase in KV cache offloading  as a strategy an increase in disagregation [42:18] as a core competency of this hardware and so  what I'm focused on right now within inference [42:23] engineering one of those main things is getting  really really good at playing KV Cash Hot Potato. [42:32] Fantastic. We are just about out of time. I want  to thank each of our panelists for sharing not [42:37] only what they're building, but the engineering  lessons that they've learned along the way. [42:42] Um, today we talked about architecture, model  selection, guard rails, production, deployment, [42:47] scaling, and infrastructure. One thing that  really stands out is that building production [42:52] AI is isn't simply a machine learning problem  anymore. It's a systems engineering problem. [42:59] Success depends on bringing together software  engineers, infrastructure, networking, operations, [43:04] security, and continuous evaluation. I think  we've heard some really terrific insights [43:10] and um please uh give give our panelists  a round of applause. [applause]