首页›Ahead of AI›文章

Recent Developments in LLM Architectures: KV Sharing, mHC, and Compressed Attention

Sebastian Raschka, PhD · 2026年5月16日

AI 摘要 AI 生成,可能有误

本文综述了近期发布的开放权重 LLM——Gemma 4、ZAYA1-8B、Laguna XS.2 和 DeepSeek V4——这些模型的架构日益聚焦于长上下文效率,通过减小 KV 缓存大小、内存流量和注意力成本来实现。文章详细介绍了 Gemma 4 的跨层 KV 共享机制,即较后的层复用键值张量,从而使缓存内存大约减半;以及它的逐层嵌入(PLE),在不膨胀主 Transformer 堆栈的情况下增加了针对特定词元的容量。作者严格聚焦于 Transformer 块、残差流、KV 缓存和注意力计算中的新设计选择,刻意略去了数据集、训练配方和基准测试。

After a short family break, I am excited to be back and catching up on a busy few weeks of open-weight LLM releases. The thing that stood out to me is how much newer architectures are focused on long-context efficiency.

As reasoning models and agent workflows keep more tokens around (for longer), KV-cache size, memory traffic, and attention cost quickly become the main constraints, and LLM developers are adding a growing number of architecture tricks to reduce those costs.

The main examples I want to look at are KV sharing and per-layer embeddings in Gemma 4, layer-wise attention budgeting in Laguna XS.2, compressed convolutional attention in ZAYA1-8B, and mHC plus compressed attention in DeepSeek V4.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Ahead of AI

Understanding Positional Embeddings in Modern LLMs

AI 摘要This article is a detailed tutorial on how LLMs encode token position information, explaining why explicit positional signals are needed (beyond the implicit order given by causal attention masks) and walking through methods like GPT-2's learned absolute position embeddings, the original transformer's fixed sinusoidal encodings, and RoPE, illustrated with visuals, math, and PyTorch code. The author also previews which positional encoding approaches are used in 2026 open-weight model architectures. The article serves as a standalone foundational reference, motivated by reader requests for a RoPE tutorial and as preparation for an upcoming analysis of modern LLM architecture trends.

Building Reasoning Models from the Ground Up: A Full Video Course

AI 摘要The author announces an 11-hour, eight-video course that builds a reasoning model from scratch in Python and PyTorch, starting from a pre-trained Qwen3 model and covering evaluation with a math verifier, inference-time scaling techniques like sampling, self-consistency, and self-refinement, and reinforcement learning with verifiable rewards using GRPO. The videos accompany his book 'Build a Reasoning Model (From Scratch)' and require comfort with Python and PyTorch, with a GPU recommended for the training-focused later videos. He also explains that reasoning models act as the 'engine' inside agent harnesses, making them essential for understanding modern LLM-based agents.

Language Models for Text Classification: From Bag-of-Words to Jev

AI 摘要This article analyzes the newly released Jev AI model, positioning it as a fast and inexpensive text classifier that bridges the gap between general-purpose LLMs and narrow task-specific classifiers. To demystify the hype, the author traces the history of language models for text classification, from bag-of-words representations with classic methods like naive Bayes and logistic regression, through word embeddings and recurrent neural networks such as LSTMs, up to transformer-era approaches. The author concludes that while Jev is essentially a text classifier, it is more general and capable than its simple predecessors, which explains its recent popularity.

GPT-6 Astra, Looped Transformers, and Hidden Reasoning

AI 摘要The article reviews OpenAI's newly released GPT-6 Astra, describing it as the best model the author has used, with standout performance in 3D rendering, animation, and computer-use tasks, and explaining how computer-use skills are trained via reinforcement learning in macOS environments. It then explains 'looped transformers' (recurrent depth), an architecture in which intermediate representations pass through the same transformer blocks multiple times with shared weights, an idea dating back to Universal Transformers (2018). Finally, it examines whether this looped design relates to rumors that Astra conceals its chain-of-thought reasoning trace.

How Claude Watermarks AI-Generated Text

AI 摘要The author expands on a popular social media post by creating a detailed 48-minute video lecture (with over 50 slides and a transcript) explaining how Anthropic's new watermarking for Claude-generated text works. The lecture first covers how LLM text generation functions under the hood—tokenization, score distributions, and next-token sampling—to show that watermarking is a minor tweak within the normal generation process. The goal is to help readers understand how the invisible watermark is embedded, why it can fail or be removed, and its pros and cons.