HyperAIHyperAI

Command Palette

Search for a command to run...

Qwen3.8-Nextアーキテクチャの設計について:評価、効率性、および学習安定性

Qwen3.8-Flash-Next-FP8 マルチモーダル大規模言語モデルをオンラインで実行する

ノートブックへ移動

概要

本稿では、スパース混合専門家モデルであるQwen3.8-Flash-Nextのアーキテクチャとアブレーションについて述べる。このモデルは125Bパラメータを有し、トークンあたり6Bのパラメータが活性化され、さらにアクセラレータ外に保持される51Bパラメータのn-gram埋め込みテーブルを追加で持つ。14の事前学習ベンチマークにおいて、本モデルは397B-A17Bの先行モデルを8つのベンチマークで上回り、残りのベンチマークでは最大2.6ポイントの差で劣る。これは、活性化パラメータ数が1/3、学習トークン数が1/3、学習FLOPsが約1/9であるにもかかわらず達成された。トークン混合には、Gated DeltaNet(GDN)とグローバルアテンションの層ごとのハイブリッドを使用し、4層ごとに1層のフルアテンション層を配置する。継続事前学習時には、これらのフルアテンション層はQwen Sparse Attention(QSA)に置き換えられ、QSAは圧縮された軽量インデクサを用いてマイクロブロック粒度でコンテキストをスコアリングする。残差ストリームは4つのブランチに拡張され、要素単位のゲートを通じて読み出される。この設計をGated Residual(GR)と呼ぶ。容量はバックボーンの外部に、ホストメモリからプリフェッチされるテーブルを持つ単一のn-gram埋め込み層によって追加される。我々は、すべての候補変更を3つの軸に沿って評価する:損失と下流ベンチマーク、学習・プリフィル・デコードにおける変更コスト、および最適なハイパーパラメータと学習安定性への影響。損失と下流精度は常に連動するわけではない:n-gram語彙を拡大すると損失は単調に低下する一方、下流精度は飽和する。アーキテクチャとMuonオプティマイザは、最適な学習率とバッチサイズを上方にシフトさせ、バッチサイズのウォームアップを不要にし、ストレステスト下での安定性を大幅に向上させる。損失、ベンチマーク、効率性、安定性は一つの設計問題を構成する。これらを統合的に解決することで、より効率的で、より高性能で、より安定したレシピが得られる。

One-sentence Summary

The Qwen Team presents Qwen3.8-Flash-Next, a 125B-parameter125\text{B-parameter}125B-parameter sparse MoE with 6B6\text{B}6B activated tokens and 51B51\text{B}51B n-gram embedding parameters, which outperforms its 397B-A17B397\text{B-A}17\text{B}397B-A17B predecessor on eight of fourteen benchmarks at 13\frac{1}{3}31 the activated parameters, 1/3 the training tokens, and roughly 19\frac{1}{9}91 the FLOPs, using a layer-wise hybrid of Gated DeltaNet and global attention (replaced by Qwen Sparse Attention during continued pretraining), a four-branch Gated Residual stream, and prefetched n-gram tables, while jointly optimizing loss, downstream accuracy, efficiency, and stability with the Muon optimizer.

Key Contributions

  • Introduces Qwen3.8-Flash-Next, a 125B-parameter sparse mixture-of-experts model with 6B activated parameters per token, matching or nearly matching the prior 397B-A17B flagship on fourteen pre-training benchmarks while using one-third of the activated parameters, one-third of the training tokens, and roughly one-ninth of the training FLOPs.
  • Combines a layer-wise hybrid of Gated DeltaNet and global attention, with Qwen Sparse Attention replacing full attention at continued pretraining, a four-branch Gated Residual stream read through an elementwise gate, and a host-memory n-gram embedding layer; these changes shift optimal hyperparameters upward, eliminate batch-size warmup, and improve stability, as shown by stress tests at four times the optimal learning rate where the new recipe remains stable while the previous structure spikes.
  • Demonstrates that loss and downstream accuracy do not always move together, as enlarging the n-gram vocabulary lowers loss monotonically while downstream accuracy saturates, and validates the design via a joint evaluation of loss, benchmarks, training/prefill/decode cost, and stability, yielding a recipe that is simultaneously more efficient, more capable, and more stable.

Introduction

The authors introduce Qwen3.8-Flash-Next, a sparse mixture-of-experts model with 125B total parameters and 6B activated per token, plus 51B parameters in n-gram embedding tables stored off-accelerator. The goal is to match the quality of the previous 397B-A17B flagship while using about a third of the activated parameters, a third of the training tokens, and roughly a ninth of the training FLOPs. Prior work faced trade-offs where architectural changes affect downstream performance, training and serving costs, and stability simultaneously, and simple fixes often fail under late-stage evaluation or stress. The authors’ main contribution is a coupled design across four components: a layer-wise hybrid of Gated DeltaNet and global attention for token mixing, Qwen Sparse Attention for efficient long-context prefill, a widened residual stream with an elementwise gate for capacity and stability, and an n-gram embedding layer for extra parameters without added per-token compute. They also refit the scaling law for the new optimizer and architecture, and validate stability under stress tests that expose instabilities at moderate scale. The result is a base model that leads the predecessor on eight of fourteen benchmarks and trails by at most 2.6 points on the rest, with no loss spikes during full-scale training.

Method

The authors address the tension between efficient local processing and persistent content-dependent memory by introducing a layer-wise hybrid of Gated DeltaNet (GDN) and global attention. GDN compresses the prefix into a fixed-size recurrent state and updates that state according to the current content, while interleaved global-attention layers retain direct token-level retrieval. Specifically, one full-attention layer is placed in every four layers, with the remaining three using GDN.

The GDN token-mixing path is illustrated below.

Given a normalized residual-stream input, GDN computes content features using learned projections followed by short depthwise causal convolutions. Queries and keys are L2-normalized to bound magnitudes and stabilize the rank-one delta transition. The recurrent state is updated using a gated delta rule, where a data-dependent decay gate globally controls the lifetime of the existing state, and a write gate controls the delta update. This targeted erase-and-write operation distinguishes GDN from purely additive linear attention. The head outputs are then normalized and modulated by a sigmoid output gate. For efficiency, the GDN kernel is optimized using a fused linear-attention kernel library.

To alleviate the quadratic computational bottleneck of softmax attention in long-context scenarios, the authors adopt Qwen Sparse Attention (QSA). QSA employs a lightweight indexer that compresses the sequence into micro-block representations, estimates their importance, and selects the most relevant context for attention computation.

As shown in the figure below:

The compressed lightweight indexer adopts a multi-query attention structure. Keys are partitioned into non-overlapping blocks and compressed via average pooling before applying partial rotary position embeddings. Block-level importance scores are obtained through block-causal scoring, allowing each query to score only fully observed blocks. Given a token budget, the top-scoring blocks are selected, expanded to original token indices, and combined with tail tokens for core attention computation.

The training of QSA involves two stages during continued pretraining. In the first stage, dense distillation, the full-sequence attention distribution of the backbone is distilled into the indexer. The token-level teacher distribution is max-pooled to align with block-level indexer scores, and the KL divergence is minimized to train the indexer. In the second stage, sparse training, the entire backbone is trained under the guidance of the indexer to adapt to sparse attention patterns. The indexer KL loss is computed only over the selected top-k blocks.

The effectiveness of this training process is demonstrated in the training loss curves.

The loss curves for QSA and full attention remain highly consistent, with the overall loss difference on the order of 10410^{-4}104.

Architecture ablations highlight the benefits of the intra-layer compression used in QSA.

QSA matches the full-attention baseline at a relative indexer latency of 0.25, outperforming cross-layer index sharing methods. Furthermore, QSA maintains performance with a small number of indexer query heads.

The efficiency gains of QSA are substantial at long sequence lengths.

By compressing the key sequence, QSA reduces indexer complexity and achieves significant kernel-level speedups for both prefill and decode stages compared to dense grouped-query attention.

To address signal attenuation in pre-normalization networks, the authors introduce Gated Residual (GR) connections, which widen the residual stream into multiple parallel branches. GR replaces block pre-normalization with a read operator that predicts elementwise gating scores per branch and channel from all branches, averaging the gated branches into the block input. The block output is written to every branch through a data-dependent scalar per branch. This design allows specific branches to preserve early attention outputs across many layers while others stay local, improving both training stability and downstream performance.

For optimization, the authors utilize the matrix-based optimizer Muon, applying Newton-Schulz iterations to orthogonalize momentum for two-dimensional weights. Fused parameters like attention query-key-value projections are split at per-head granularity before orthogonalization to avoid mixing singular directions across unrelated sub-blocks. Additionally, an updated hyperparameter scaling law is developed, predicting substantially larger batch sizes and learning rates. The new recipe eliminates the need for batch-size warmup, as Muon preserves data efficiency at larger batch sizes, leading to more stable and efficient large-scale training.

Experiment

The experiments validate the Qwen3.8-Flash-Next architecture across its key components. The GDN hybrid attention improves over both full-attention and SWA baselines on most benchmarks, while QSA sparse attention matches full-attention performance on short-context tasks and delivers substantial gains on long-context retrieval, with kernel-level speedups up to 7.6x at 1M context. N-gram embedding ablations show a single layer at Layer 2 is sufficient, and scaling its vocabulary improves loss and Chinese benchmarks without consistent downstream gains. Hyperparameter scaling experiments confirm the new recipe's predicted batch size and learning rate are near-optimal, yielding stable training with no need for batch-size warmup. Stress tests demonstrate the gated residual and Muon optimizer provide a large stability margin over the AdamW baseline, and the full model achieves results comparable to a much larger baseline at roughly one-ninth the training cost.

The GDN hybrid architecture outperforms both the full-attention and SWA-hybrid baselines on most benchmarks, particularly in reasoning, math, and code tasks. While full attention leads on some general knowledge benchmarks, the GDN hybrid achieves the highest average score across all nine tasks. GDN hybrid improves on 8 of 9 benchmarks relative to full attention and on 7 of 9 relative to SWA hybrid. GDN hybrid shows the largest gains in math and code benchmarks, such as MATH and EvalPlus. Full attention retains an edge on MMLU-Pro, while SWA hybrid leads on MMLU and SuperGPQA. The GDN hybrid achieves the best average score across all nine benchmarks.

Replacing full attention with Qwen Sparse Attention (QSA) maintains or slightly improves performance across most benchmarks, with the largest gains in reasoning and coding tasks. The only notable decline is on the SuperGPQA benchmark, while average scores across all categories improve modestly. QSA improves average performance over full attention, driven by gains in reasoning and coding benchmarks. The largest relative improvement with QSA is on the MATH benchmark, while SuperGPQA shows a slight drop. Multilingual and STEM results also improve with QSA, though the gains are smaller than those in reasoning and coding.

Applying Qwen Sparse Attention (QSA) to the model improves average long-context retrieval performance across RULER and MRCR benchmarks, with the largest gains observed at longer sequence lengths. While full attention retains a slight edge on some shorter-range and MRCR settings, QSA yields substantial improvements on the most challenging 512K–1M and 512K/1M MRCR cases. QSA raises the average score across both benchmarks from 78.76 to 80.93. The largest RULER gain with QSA occurs in the 512K–1M range, where the score jumps from 90.08 to 93.00. On MRCR, QSA more than doubles the full-attention score at 512K (from 30.66 to 40.53) and improves the 1M score from 20.71 to 26.44. Full attention remains slightly better on MRCR at 128K and 256K, but QSA closes the gap and outperforms at longer lengths.

Under four-step speculative decoding, replacing full attention with Qwen Sparse Attention (QSA) yields slightly higher mean MTP accepted lengths across all evaluated benchmarks. The gains are consistent but modest, with the average accepted length improving from 4.06 to 4.07. This indicates that QSA maintains or slightly improves decoding efficiency while reducing attention indexing overhead. QSA improves the average MTP accepted length from 4.06 to 4.07 compared to full attention. Gains are observed on every benchmark, with the largest relative improvement on MT-Bench (from 3.44 to 3.47). The improvements are consistent but small, suggesting QSA preserves decoding quality while reducing indexing cost.

Residual stream widening with multiple branches improves performance over standard pre-norm across all evaluated benchmarks. Dynamic gating of branch weights outperforms static weighting, and a further refined gating variant (GR) achieves the best overall results, particularly in STEM and multilingual tasks. All widened residual variants reduce loss and improve benchmark scores compared to the pre-norm baseline. Dynamic branch weighting consistently outperforms static weighting across knowledge, STEM, reasoning, and multilingual benchmarks. The refined gating variant (GR) achieves the highest average MMLU and the best scores on STEM and multilingual tasks, with the lowest loss among the compared configurations.

The experiments validate the proposed hybrid attention and architectural modifications across diverse benchmarks. The GDN hybrid attention achieves the best average performance across nine tasks, with notable gains in reasoning, math, and code, though full attention retains an edge on some general knowledge tasks. Replacing full attention with Qwen Sparse Attention (QSA) maintains or slightly improves most benchmark scores, with the largest gains in reasoning and coding, and also improves long-context retrieval, especially at 512K and 1M sequence lengths. Under speculative decoding, QSA preserves decoding efficiency with a marginal improvement in accepted token length. Finally, widening the residual stream with multiple branches and dynamic gating consistently outperforms the standard pre-norm baseline, with the refined gating variant yielding the best results overall.


AIでAIを構築

アイデアからローンチまで — 無料のAIコーディング支援、すぐに使える環境、最高のGPU価格でAI開発を加速。

AI コーディング補助
すぐに使える GPU
最適な料金体系

HyperAI Newsletters

最新情報を購読する
北京時間 毎週月曜日の午前9時 に、その週の最新情報をメールでお届けします
メール配信サービスは MailChimp によって提供されています