Command Palette
Search for a command to run...
Qwen3.8-Next 아키텍처 설계에 관한 연구: 평가, 효율성 및 훈련 안정성
Qwen3.8-Next 아키텍처 설계에 관한 연구: 평가, 효율성 및 훈련 안정성
온라인에서 Qwen3.8-Flash-Next-FP8 멀티모달 대규모 모델 실행하기
초록
우리는 125B 파라미터를 가지며 토큰당 6B 파라미터가 활성화되고, 가속기 외부에 51B 파라미터의 n-그램 임베딩 테이블을 추가로 보유하는 희소 혼합 전문가 모델인 Qwen3.8-Flash-Next의 아키텍처와 절제 연구를 설명한다. 14개의 사전 훈련 벤치마크에서 이 모델은 397B-A17B 이전 모델을 8개 벤치마크에서 능가하며, 나머지 벤치마크에서는 최대 2.6포인트 차이로 뒤처지는데, 활성화 파라미터는 1/3, 훈련 토큰은 1/3, 훈련 FLOPs는 약 1/9에 불과하다. 토큰 혼합은 Gated DeltaNet(GDN)과 전역 주의 메커니즘의 계층별 하이브리드를 사용하며, 4개 층마다 하나의 전체 주의 층을 둔다. 지속 사전 훈련 시 이러한 전체 주의 층은 Qwen Sparse Attention(QSA)으로 대체되는데, QSA는 압축된 경량 인덱서를 사용하여 마이크로 블록 단위로 컨텍스트를 점수화한다. 잔차 스트림은 4개의 분기로 확장되고 요소별 게이트를 통해 읽히는데, 이를 Gated Residual(GR)이라고 부른다. 용량은 백본 외부에 단일 n-그램 임베딩 층을 추가하여 확보하며, 해당 테이블은 호스트 메모리에서 프리페치된다. 우리는 모든 후보 변경 사항을 세 가지 축으로 평가한다: 손실 및 다운스트림 벤치마크; 훈련, 프리필 및 디코딩에서의 변경 비용; 최적 하이퍼파라미터와 훈련 안정성에 미치는 영향. 손실과 다운스트림 정확도는 항상 함께 움직이지 않는다: n-그램 어휘를 확대하면 손실은 단조롭게 감소하지만 다운스트림 정확도는 포화된다. 아키텍처와 Muon 최적화 도구는 함께 최적 학습률과 배치 크기를 상향 이동시키고, 배치 크기 워밍업을 불필요하게 만들며, 스트레스 테스트에서 안정성을 크게 개선한다. 손실, 벤치마크, 효율성 및 안정성은 하나의 설계 문제를 구성한다. 이를 함께 해결하면 동시에 더 효율적이고, 더 유능하며, 더 안정적인 레시피가 도출된다.
One-sentence Summary
The Qwen Team presents Qwen3.8-Flash-Next, a 125B-parameter sparse MoE with 6B activated tokens and 51B n-gram embedding parameters, which outperforms its 397B-A17B predecessor on eight of fourteen benchmarks at 31 the activated parameters, 1/3 the training tokens, and roughly 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 10−4.
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.