テンセント、Hy3 モデル向け統一学習フレームワーク「AngelSpec」をオープンソース化
Tencent は推論効率を向上させるオープンソースフレームワーク「AngelSpec」を公開し、会話とコード・数学という異なる負荷特性に特化した統一型トレーニング手法を提供した。
AI深層分析を開く2026年7月30日 19:16
AI深層分析
キーポイント
負荷特性に応じた二重ドラフター設計
汎用的な単一ドラフターの限界を克服するため、会話向け MTP モデルとコード・数学向けブロック並列ドラフターの 2 つを併用する構造を採用した。
トレーニング時テストによる推論不整合の解消
EAGLE-3 の原則に基づき、トレーニング時に多段予測をシミュレートすることで、推論時の誤差蓄積問題を解決し、深層での受容率を向上させた。
パラメータ共有と凍結戦略の採用
ターゲットバックボーンと言語モデルヘッドを凍結し、MTP 入力も切り離すことで、ドラフターの提案分布のみを最適化する効率的な学習を実現した。
学習戦略の最適化
ターゲットバックボーンとヘッドを凍結し、MTP 入力を切り離すことで検証対象の分布を維持しつつ drafter の提案分布を改善する。また、トレーニングにターゲットモデルによるロールアウトを使用することで、推論時のトークン選択や隠れ状態の軌道を正確に再現する。
DFly アーキテクチャの特徴
DFly は共通セマンティック基盤を提供する FC ブランチと、各ドラフト層ごとの視点を可能にする残差リファインメントとしての層別融合を組み合わせる。また、並列バックボーンに小さな逐次ヘッドを追加し、位置ごとの周辺予測を接頭辞条件付き分布に変換することでサフィックス受容の減衰を防ぐ。
重要な引用
AngelSpec treats workload heterogeneity as a first-class design constraint
Errors accumulate with depth, so the second and third draft positions accept at substantially lower rates than the first.
AngelSpec therefore ships two complementary drafters, not one compromise.
The drafter improves its proposal distribution without touching the distribution that verification must preserve.
編集コメントを表示
編集コメント
推論効率化の分野において、汎用アプローチからタスク特化型への転換を示す重要な技術的知見である。実運用環境でのパフォーマンス差を明確に分析し、具体的なアーキテクチャ改善策を提示している点は、現場の開発者にとって即戦力となる情報だ。
Source Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
テンセントは、推測デコーディング用のドラフトモデル向けに設計されたオープンソースの Torch ネイティブなトレーニングフレームワーク「AngelSpec」を公開しました。このリリースには、自己回帰的多トークン予測(MTP)と、ブロック並列処理に対応する DFlash ファミリーが含まれています。
従来の推測デコーディングの研究では、平均化されたベンチマークの組み合わせに対して高いスコアを示す単一のドラフトモデルを探す傾向がありました。しかし、実際のサービス現場でのトラフィックはそんな単純な分布にはなっていません。AngelSpec はワークロードの多様性を設計上の重要な制約として扱い、それに応じてモデル構造やトレーニングデータ、検証の深さを最適化しています。
なぜ万能型のドラフトモデルでは性能が出ないのか
推測デコーディング自体はロスレス(情報損失なし)です。軽量なドラフトモデルが複数の未来トークンを提案し、ターゲットモデルが拒否サンプリングを用いてこれらを一度に検証します。この際の加速効果は主に 2 つの要素によって決まります。1 つ目は、提案されたトークンの中で実際に採用されるものの数、2 つ目は、ドラフト生成から検証までの一連の処理にかかる時間です。
しかし、ドメインによってこれらの 2 つの指標は逆の方向に動きます。エントロピーが高く自由な対話形式では、文脈的に妥当な続きが多数存在します。ターゲットモデルはその中から任意のものを選べるため、提案するトークンの深さが増すほど採用率は急速に低下します。長いブロックを生成して検証しても計算リソースの無駄になります。このような状況には、より短い候補シーケンスを提案する自己回帰的な MTP ドラフティングが適しています。
コード処理と数学的推論では、振る舞いが異なります。プログラミングの構文や繰り返し出現する識別子、形式的な表現、そして段階的な導出プロセスは、次に生成されるトークンに対してより強い制約を課します。こうしたワークロードは予測可能な範囲が長く続くため、ブロック並列ドラフト方式によるコスト分散効果が高く発揮されます。
そのため AngelSpec は妥協点ではなく、2 つの補完的なドラフターを搭載しています。MTP モデルは豊かで多様な会話指向データで訓練され、一方ブロック拡散モデルはコードと数学に焦点を当てたサンプルによって強化されています。
MTP パス:トレーニング時のテストとターゲットモデル展開
元の Hy3 モデルは単一の MTP レイヤーを持ち、再帰的な自己条件付きアンロールは行われません。推論時にはブロックを再帰的に再利用できますが、トレーニングの目的関数は長い自己生成チェーンに対して準備されていませんでした。深さが増すにつれて誤差が蓄積するため、2 番目や 3 番目のドラフト位置での採用率は、1 番目の位置に比べて大幅に低下します。
AngelSpec はこのトレーニングと推論の不一致を、共有パラメータによる多深度スキームで解決します。D の論理的予測深さは維持しつつ、物理的な MTP ブロックは 1 つだけ再利用されます。トレーニング中は、そのブロックが D ステップにわたって自己回帰的にアンロールされ、各予測結果が次の呼び出しに引き渡されます。EAGLE-3 の「トレーニング時のテスト」の原則に従い、深さ k+1 では正解トークンではなく、深さ k からの最大確率推定値を受け取ります。パラメータは共有されますが、教師信号は各深度ごとに特定されたままです。つまり、教師ターゲットは各深度で未来の位置を 1 つずつ進めます。
この手法の効果を最大化する上で、2 つの重要な選択が鍵となります。まず、ターゲットとなるバックボーンと言語モデルヘッドを凍結し、バックボーンから得られる MTP 入力を切り離すことです。これにより、ドラフターは検証プロセスで維持すべき分布を変更することなく、提案分布の改善に集中できます。
2 つ目は、トレーニングにターゲットモデルによるロールアウトを採用する点です。生成される応答は元の参照コーパスから取得するのではなく、凍結されたターゲットモデル自体によって生成されます。これにより、推論時に MTP が近似しなければならないトークンの選択、隠れ状態の軌跡、そして局所的な不確実性のパターンを、本番環境と完全に一致させることが可能になります。
測定結果は、期待通り特定の領域に集中しています。T = 0 の時点で、平均受け入れ率は 52.8% から 66.4% に向上し、平均受け入れトークン数も 2.58 から 2.99 に伸びました。1 番目の位置での成功率はほぼ維持され、0.799 から 0.814 へとわずかに改善されています。一方、より深い位置における改善幅が顕著で、GSM8K では p3 が 0.290 から 0.706 に、HumanEval では 0.387 から 0.757 へと大幅に上昇しています。
DFly: ハイブリッドターゲット条件付けと、先行条件付きの AR ヘッド
DFly はブロック拡散アーキテクチャです。DFlash をベースに、2 つの構造的変更を加えています。
ハイブリッド型ターゲット条件付きバックボーン:DFlash は複数のターゲット層からの隠れ状態を結合し、全結合層で変換して 1 つの共有コンテキスト特徴を生成します。この単一のコンテキストがすべてのドラフト層に供給されるため、層ごとの専門化が制限されてしまいます。
一方、DFlare は層ごとの融合重みを学習し、各ドラフト層がターゲット階層独自の視点を持つようにしますが、DFlash が持つ学習された層間変換機能は失われます。DFly はこれらを組み合わせています:全結合(FC)ブランチが共通の意味的基盤を確立し、層ごとの融合はその上に残差リファインメントとして適用されます。
この追加のブランチは D × T 個のスカラー重みのみを導入し、そのソフトマックス係数はトレーニング後に事前計算可能です。
先行条件付き自己回帰ヘッド:並列バックボーンは、受け入れられたコンテキストのみから各ブロック位置を予測します。これは、以前のドラフト位置で実際にどの継続が選択されたかを見ることができないため、サフィックスの受容率低下を引き起こします。
DFly は並列バックボーンの後に小さな逐次ヘッドを配置し、位置ごとの周辺予測を接頭辞条件付き分布に変換します。高コストなバックボーンは完全に並列のまま維持され、小さいヘッドのみが左から右へ実行されます。
初期パフォーマンス
Qwen3-8B における評価では、DFly は平均受容長が 5.41 を記録し、DSpark(5.32)、DFlash(4.57)、MTP(3.24)を上回りました。また、数学とコードに関する 5 つのベンチマークすべてで最高スコアを達成しています。MT-Bench では DSpark が 3.77 でわずかに上回っていますが、これは DFly がコードと数学に特化して設計されていることと整合する結果です。
Hy3-A21B モデルではその差はさらに顕著です。DFly は 4.79 を達成し、DFlash(3.69)や MTP(3.00)を大きく引き離しました。これはそれぞれ相対的に 29.8%、59.7% の向上となります。報告された 6 つのベンチマークすべてで改善が見られました。
貪欲デコーディング(greedy decoding)下での Hy3-A21B における累積アブレーション実験では、各構成要素がどのように寄与しているかが明確になります。DFlash ベースモデルは 3.77、DFly ベースモデルは 4.40、Markov ヘッドを追加すると 4.56、さらに隠れ状態の補正機能を加えると 4.60、最後にコードと数学のデータ拡張を施すと 4.75 に達します。このデータ拡張では、評価例との間で連続した 16 トークンのスパンが重複するプロンプトは生成前に除外しています。追加されたプロンプト数は合計 70 万件で、そのうちコード関連が OpenCodeInstruct と OpenCodeReasoning から 50 万件、数学関連が Big-Math から 20 万件です。
フレームワークの内部構造について
AngelSpec は TorchSpec を基盤として構築され、複数の箇所を拡張しています。アーキテクチャは非集約型(disaggregated)で、推論エンジンが凍結されたターゲットモデルを実行し、Mooncake に基づく RDMA ストアを経由して隠れ状態をストリーミングしながら、分散トレーニングワーカーへ直接転送します。隠れ状態の取得は vLLM ワーカープロセス内で行われ、vLLM の公開 API を通じて実装されています。これには推測用の隠れ状態抽出フックとカスタム KV コネクタが含まれますが、エンジン自体をフォークする必要はありません。
本研究において特に重要な拡張機能は以下の通りです:
TTT ロールアウトは、シーケンス全体で並列に展開されます。因果的プレフィックスと対角線アテンションの構造は、コンパイルされた FlexAttention と logsumexp の結合によって暗黙的に再現され、メモリ使用量は単一の因果パスに近い水準に抑えられます。
Ulysses シーケンス並列性を用いた長文脈トレーニングでは、128k トークンまでの長さで検証済みです。各ローカルシャードには D トークンのハロー領域が含まれており、深さシフトされた教師信号がランク単位で保持されます。
ドキュメント認識型のシーケンスパッキングでは、3 つの分離メカニズムを採用しています。1 つはアテンション用ドキュメントゲート、2 つ目は MTP パス専用の深さシフトドキュメントゲート、そして 3 つ目はドキュメントローカルな位置エンコーディングです。ドキュメント間の完全な分離は、アテンションの漏洩がゼロであることを検証するユニットテストによって保証されています。
評価サーバーでは、専用 GPU 上で最新のチェックポイントに対して本格的なスペキュレーティブデコーディングを定期的に実行し、サービスエンジン自身が測定した平均受容長と位置ごとの受容率を報告します。
3 つのレベルでプラグイン可能なインターフェースを提供しています。ターゲット層はランタイム上の vLLM プラグインエントリーポイント(ソースコードのパッチ不要)、目的関数層は共有ベース上で構成され設定ファイルで選択可能、最適化器層では AdamW の代替として Muon をドロップイン形式で利用できます。
バックエンドは階層化されており、vLLM がファーストクラスとしてサポートされています。SGLang と HuggingFace Transformers はコミュニティレベルで対応しています。
Hugging Face と ModelScope に 7 つのチェックポイントが公開され、思考なし(no-think)と高思考(high-think)の DFly バリアントが含まれています。
AngelSpec は、設定ファイル駆動のパイプラインの下で、DFly、DFlash、DFlare、Eagle3、DSpark、MTP の 6 つのドラフトアーキテクチャを統一して訓練します。
Hy3-A21B モデルにおいて、DFly は平均受容長を 4.79 に引き上げました。これは DFlash の 3.69 や MTP の 3.00 を上回る結果です。
HY3-295B-A21B で TP=8 の設定で DFly-8 を使用すると、並列度 4 から 64 の範囲で、自己回帰型デコーディングに対して 1.98〜2.40 倍の高速化を実現します。
D-cut は、c64(並列度 64)でのライブトラフィックスループットを 981 tok/s に押し上げ、DFly よりも 15.7% 向上させました。ただし、受容率は 2.8% 低下しています。
論文、GitHub リポジトリ、ドキュメント、Hugging Face コレクション、ModelScope コレクションをチェックしてください。本研究のすべての功績は、このプロジェクトの研究チームにあります。
原文を表示
Tencent has released AngelSpec, an open-source, torch-native training framework for speculative-decoding draft models. The release covers both autoregressive multi-token prediction (MTP) and the block-parallel DFlash family.
Most speculative-decoding work searches for one drafter that scores well on an averaged benchmark mixture. Real serving traffic does not look like that mixture. AngelSpec treats workload heterogeneity as a first-class design constraint, and specializes structure, training data, and verification depth around it.
Why one universal drafter underperforms
Speculative decoding is lossless. A lightweight drafter proposes several future tokens, and the target model verifies them together in one forward pass using rejection sampling. Acceleration then depends on two things: how many draft tokens get accepted, and how long the complete draft–verify round takes.
Those two quantities move in opposite directions across domains. In high-entropy open-ended conversation, many continuations are semantically valid. The target may pick any one of them, so acceptance decays quickly with proposal depth. Generating and verifying a long block wastes compute. Autoregressive MTP drafting fits this regime because it proposes a shorter candidate sequence.
Code and mathematical reasoning behave differently. Programming syntax, repeated identifiers, formal expressions, and step-by-step derivations constrain future tokens more strongly. These workloads create longer predictable spans, which is exactly what block-parallel drafting amortizes well.
AngelSpec therefore ships two complementary drafters, not one compromise. The MTP model is trained on rich, diverse conversation-oriented data. The block-diffusion model is strengthened with code- and mathematics-focused samples.
The MTP path: Training-Time Test and target-model rollout
The original Hy3 model is trained with a single MTP layer and no recurrent self-conditioned unrolling. At inference the block can be reused recurrently, but the training objective never prepared it for a long self-generated chain. Errors accumulate with depth, so the second and third draft positions accept at substantially lower rates than the first.
AngelSpec addresses this train–inference mismatch with a shared-parameter, multi-depth scheme. It retains D logical prediction depths but reuses one physical MTP block. During training that block is autoregressively unrolled for D steps, with each prediction fed into the next invocation. Following the Training-Time Test principle of EAGLE-3, depth k+1 receives the arg max prediction from depth k instead of the ground-truth token. Parameters are shared, but supervision stays depth-specific: the teacher target advances one future position at every depth.
Two further choices carry most of the gain. First, the target backbone and target language-model head are frozen, and MTP inputs from the backbone are detached. The drafter improves its proposal distribution without touching the distribution that verification must preserve. Second, training uses target-model rollout: responses are generated by the frozen target rather than taken from the original reference corpus. That produces the exact token choices, hidden-state trajectories, and local uncertainty patterns MTP has to approximate at serving time.
The measured effect is concentrated where it should be. At T = 0, mean acceptance moves from 52.8% to 66.4%, and mean accepted length from 2.58 to 2.99. The first-position rate is nearly preserved at 0.799 → 0.814. The deeper positions carry the delta: p3 climbs from 0.290 to 0.706 on GSM8K, and from 0.387 to 0.757 on HumanEval.
DFly: hybrid target conditioning and a predecessor-conditioned AR head
DFly is the block-diffusion architecture. It builds on DFlash with two structural changes.
Hybrid target-conditioning backbone: DFlash concatenates hidden states from multiple target layers and transforms them with a fully connected layer, producing one shared context feature. That single context is then supplied to every draft layer, which limits layer specialization. DFlare instead learns per-layer fusion weights, giving each draft layer its own view of the target hierarchy, but drops DFlash’s learned cross-layer transformation. DFly composes them: the FC branch establishes a common semantic basis, and the per-layer fusion is applied as a residual refinement on top. The extra branch introduces only D × T scalar weights, and its softmax coefficients can be precomputed after training.
Predecessor-conditioned autoregressive head: A parallel backbone predicts each block position from the accepted context only. It cannot see which continuation was actually selected at earlier draft positions, which produces suffix acceptance decay. DFly places a small sequential head after the parallel backbone, converting position-wise marginal predictions into prefix-conditioned distributions. The expensive backbone stays fully parallel; only the small head runs left to right.
Early Performance
On Qwen3-8B, DFly reaches 5.41 average mean accepted length, against 5.32 for DSpark, 4.57 for DFlash, and 3.24 for MTP. It takes the best result on all five math and code benchmarks. DSpark stays slightly ahead on MT-Bench at 3.77 versus 3.67, which is consistent with DFly being positioned for code and math.
On Hy3-A21B, the margin is wider. DFly reaches 4.79 against 3.69 for DFlash and 3.00 for MTP — relative gains of 29.8% and 59.7%. It improves every one of the six reported benchmarks.
The cumulative ablation on Hy3-A21B under greedy decoding traces where that comes from: DFlash backbone 3.77, DFly backbone 4.40, plus Markov head 4.56, and hidden correction 4.60, and code/math data 4.75. The data expansion adds 700K prompts — 500K code from OpenCodeInstruct and OpenCodeReasoning, 200K math from Big-Math. Any prompt sharing a contiguous 16-token span with an evaluation example is removed before response generation.
Inside the framework
AngelSpec is built on TorchSpec and extends it in several places. The foundation is disaggregated: inference engines run the frozen target model and stream hidden states through a Mooncake-backed RDMA store directly to distributed training workers. Hidden states are captured inside vLLM worker processes through public vLLM APIs — a speculative hidden-state extraction hook and a custom KV connector — without forking the engine.
The extensions that matter for this work:
TTT rollout unrolled in parallel over the whole sequence, with the causal-prefix-plus-diagonal attention structure reproduced implicitly via compiled FlexAttention and logsumexp merging. Memory stays close to a single causal pass.
Long-context training with Ulysses sequence parallelism, validated at context lengths up to 128k tokens. Each local shard carries a D-token halo so depth-shifted supervision stays rank-local.
Document-aware sequence packing with three isolation mechanisms — an attention document gate, a depth-shift document gate specific to the MTP path, and document-local position encoding. Cross-document isolation is covered by unit tests verifying zero attention leakage.
Evaluation server that periodically runs genuine speculative decoding against the latest checkpoint on dedicated GPUs, reporting mean accepted length and per-position acceptance as measured by the serving engine itself.
Pluggable interfaces at three levels: targets (runtime vLLM plugin entry point, no source patch), objectives (composed over a shared base, selected by config), and optimizers (Muon as a drop-in alternative to AdamW).
Backends are tiered: vLLM is first-class, with SGLang and HuggingFace Transformers supported at community tier.
Key Takeaways
Seven checkpoints ship on Hugging Face and ModelScope, including no-think and high-think DFly variants.
AngelSpec trains six draft architectures — DFly, DFlash, DFlare, Eagle3, DSpark, MTP — behind one config-driven pipeline.
DFly lifts mean accepted length on Hy3-A21B to 4.79, versus 3.69 for DFlash and 3.00 for MTP.
On HY3-295B-A21B with TP=8, DFly-8 delivers a 1.98–2.40× speedup over autoregressive decoding across concurrency 4 to 64.
D-cut pushes live-traffic throughput to 981 tok/s at c64, +15.7% over DFly, while giving up 2.8% acceptance.
Check out the Paper, GitHub Repo, Documentation, Hugging Face Collection and ModelScope Collection. All credit for this research goes to the researchers of this project.
The post Tencent Open-Sources AngelSpec: A Unified Training Framework for MTP and Block-Parallel Speculative Decoding on Hy3 Models appeared first on MarkTechPost.
AI算出
主要ニュースainew評価標準
AI/ML の核心的な研究・ツール発表であり、既存の推測デコーディングの課題に対する新しい解決策(MTP とブロック並列の補完的実装)と具体的な数値結果が含まれているため新規性は高い。検索機会については「AngelSpec」や「Hy3」という固有名詞が明確に含まれるため 0.75 となるが、日本企業との直接的な関連性や日本語一次情報としての独自価値は限定的である。
6つの評価軸を見る
- AI関連度
- 100
- 情報源の信頼性
- 25
- 新規性
- 75
- 調べる価値
- 75
- 重複の少なさ
- 100
- 日本での有用性
- 25
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み