Encoder, decoder and hybrid model architectures 00:00:01 The repair manual before the question At night the repair depot is quiet and its catalog barely changes. By morning people will ask dozens of different questions. Jo wants to do as much useful computation tonight as she can, without pretending she knows tomorrow’s questions. Model architecture determines which positions can interact and how information survives generation. A bidirectional encoder can read both sides of an observed token and output a representation for classification or retrieval. A causal decoder predicts the next token using only its available prefix. An encoder–decoder processes a source once and uses a separate decoder with cross-attention to generate a target sequence. A fixed document vector is cheap to reuse. A sentence answering a particular customer depends on both that customer's query and the chosen passage. Draw a line between those two clocks. 00:00:59 Separate retrieval from writing Bidirectional source representations yield vectors that can be reused across many queries. Encode the query in the aligned representation space and select a bounded set of permitted documents. An encoder–decoder can compute source states once and expose them to its decoder’s cross-attention. Decode each output token conditioned on the source and prior output. Compare against a decoder-only alternative on actual latency and quality. 00:01:29 What each backbone retains A dual-encoder system precomputes document vectors and encodes queries independently. An encoder–decoder instead keeps source representations available to an autoregressive decoder. Both can use encoders while exposing very different serving contracts. A search service scores a new query against a stored catalog. A translation service must emit a new target sequence conditioned on a particular source. Multi-head latent attention compresses information retained for keys and values using learned low-dimensional representations. State-space models maintain recurrent state across positions. Hybrid architectures combine mechanisms. Costs depend on implementation, state dimensions and sequence lengths. At the same input length, compare cache bytes, retrieval of a distant fact and sustained token latency before choosing a smaller-state design. A latent key and value design caches a compressed representation from which the model computes attention. An MoE router chooses experts per token, which creates a different bottleneck when many tokens select the same expert. Measure cache bytes and expert dispatch imbalance independently. Two variants fit the same context in memory. The expert-routed one can still slow down if a majority of tokens land on one device and other workers wait at the collective. Select the architecture by the interface the task needs. Search may demand millions of precomputable document vectors, while summarization must generate an output of variable length. At long contexts, compare attention memory and compute, recurrent state, and hybrid designs empirically. An expert router changes which network weights are active per token. it does not by itself change every attention or caching cost. 00:03:28 Which work can happen overnight? Which part of this design can be computed once for a static catalog before any user query? Document embeddings are independent of the future query in this dual-encoder design. The generated summary depends on the selected source and request. The depot can precompute document representations, refresh them when the manuals change, and spend request-time compute where the answer actually depends on the question.