Decoding the K3 Architecture: Three Designs and a Verifiable Selection Method
This article breaks down the K3 architecture—a new LLM reportedly from a Chinese AI lab—focusing on its three core designs: KDA attention, AttnRes residual, and LatentMoE routing. Based on an unverified technical draft, it analyzes the potential benefits and costs of each design, evaluates the credibility of various observation signals, and provides a practical checklist for model selection and evaluation.
Scope of Evidence
This article is rewritten based on a technical draft. The draft describes K3 as a new large language model introduced by a Chinese AI lab, proposing three designs: KDA, AttnRes, and LatentMoE. Because the draft does not provide the laboratory’s name, release time, or paper links, the architectural descriptions below should only be treated as leads to be verified. Readers should rely on official technical reports, papers, and open-source implementations. Numbers in the draft without cited sources are not used as conclusions in this text.
KDA Attention: How KV Cache Changes After Key Sharing
Standard multi-head attention (MHA) saves Key and Value for each token at every layer. During inference, the KV Cache byte count can be written as:
Cache Bytes = 2 × Num Layers × Num KV Heads × Head Dim × Bytes Per Element × Seq Length × Batch Size
According to the draft, KDA generates Keys via low-dimensional channels shared across layers, while Values are retained per layer. If the shared Key dimension is denoted as d_k, the per-layer Value dimension as d_v, and the number of layers as L, the cache per token can be approximated as: (d_k + L × d_v) × Bytes Per Element. The draft’s original phrasing of “Num Layers × Shared Key Dim + Local Value Dim” lacked sequence length and batch size, which this article has supplemented in the formula above.
Based on this formula, the savings primarily come from the Key component. The Key is stored only once, and the savings increase as the number of layers grows. The Value component remains unchanged.
This design comes with trade-offs. Shared Keys may weaken fine-grained differentiation between adjacent positions, which is particularly evident in tasks like code symbol tracking. The draft suggests that the subsequent AttnRes design can compensate for this loss, but the compensation effect requires ablation studies to prove; it cannot be assumed based solely on structural inference.
AttnRes Residual: What the Gated Branch Brings
Standard Pre-LN residual is written as x_{l+1} = x_l + F(LN(x_l)). The draft describes AttnRes as adding a learnable gated branch between the attention output and the feed-forward layer, which can be summarized as y = x + g ⊙ F(x), where g is a per-channel or per-head learnable coefficient. By initializing g close to 0, the network’s starting point aligns with a standard residual network, preventing training instability early on due to the new branch.
The draft also mentions that a branch “directly passes the weighted aggregation result of the original attention matrix.” The attention matrix, representing token-to-token weights, has a shape of [Seq Length, Seq Length] and cannot be directly added to hidden vectors. This statement needs to be cross-referenced with the actual implementation to confirm whether it passes the attention output vector or another tensor.
The parameter count for per-head gating is very small, and the additional inference overhead is minimal. The draft’s conclusions that “gradients significantly decay after 80 layers” and “convergence speed improves steadily” are presented without experimental data and should be treated as hypotheses pending verification.
LatentMoE Routing: The Cost Account of Low-Dimensional Scoring
A standard MoE router computes p = softmax(W_r x), where W_r has a shape of [E, d], E is the number of experts, and d is the hidden dimension. The LatentMoE in the draft first projects the input into an r-dimensional space, then scores in this low-dimensional space: z = Px, p = softmax(W_z z), where P has a shape of [r, d] and W_z has a shape of [E, r].
After this modification, the routing-related computation changes from E·d to r·d + E·r. Taking d=4096 and E=256 as an example (an estimation based on these sample dimensions), a standard router requires about 1.05M multiply-accumulate operations (MACs). If r=512, the projection plus scoring requires about 2.23M MACs, which is actually higher. Only when r is less than approximately 240 does the standalone routing computation decrease.
Therefore, the benefit depends on whether the projection result is reused by the experts. If the experts’ input is also z, the projection is not an extra overhead. Readers should confirm this point during evaluation.
The draft states that the compression dimension is typically 1/4 to 1/8 of the original dimension, but provides no source. This ratio should be treated as a hyperparameter to be scanned, comparing routing accuracy and downstream quality using a validation set. A low-dimensional space does not automatically solve routing collapse; load-balancing losses or similar constraints are still required.
Credibility of Three Types of Observation Signals
When evaluating external information about an architecture, the strength of evidence varies greatly. The table below outlines three levels and the judgments they can support.
| Evidence Level | Typical Sources | Supported Judgments | Unsupported Judgments |
|---|---|---|---|
| Level 1 | Official technical reports, papers, open-source model configs | Architecture structure, parameter scale, training settings | Production environment stability |
| Level 2 | Official version notes of inference frameworks, merged PRs and PR status in code repos | Deployment path feasibility | Performance superiority |
| Level 3 | Third-party data panels, mirror site downloads, community discussions, independent eval repos | Community interest | Model capability or market share |
Numbers in the draft regarding weekly active user growth and two-week download increments are not cited in this article because they lack platform names, statistical periods, and definitions. An increase in downloads indicates that the weights have been acquired, but it does not mean the inference framework has completed integration. A draft-status PR indicates that someone is attempting to implement it, not that the feature is usable. Level 3 data is also influenced by operational factors like pricing adjustments, default model switches, and benchmark gaming. If readers wish to collect such data, they should record the collection time, API endpoints, and statistical definitions.
Selection Checklist
- Verify weight sources: Record the repository address, commit, or file hash, and confirm license terms.
- Verify inference backend: Check official version notes for frameworks like vLLM, SGLang, etc., to confirm if there is a dedicated implementation for this architecture, rather than just loading via a generic path.
- Test KV Cache empirically: Estimate VRAM using the formula above, and measure VRAM usage and Time-To-First-Token (TTFT) across different sequence lengths on target hardware.
- Compare quality: Use data distributions from your own tasks, fix decoding parameters, run multiple times to get averages, and compare against baseline models of the same scale.
- Check routing health: Track the percentage of tokens received by each expert to ensure no small group of experts consistently dominates the traffic.
- Record versions and dates: Third-party data and framework support statuses change rapidly; conclusions must be timestamped.
This article does not constitute selection or investment advice. Data and judgments herein may change with platform operational statuses and framework versions, and should be re-verified before use.
