速くする前に、何の計算が増えたかを測る
Measure the added computation before optimizing it
1-pass化や候補の絞り込みだけでは速度を保証できません。実際の状態更新、保存、中間値、同期まで確認します。
One pass or fewer active candidates does not guarantee speed; recurrence, saved states, and synchronization still matter.
構造名から速度は決まらない
Architecture labels do not determine speed
最終予測を次トークンの入力へ返す構造には、一つの位置の処理が終わるまで次を始められない依存があります。2-passでは予備予測で代用し、学習の位置方向をまとめて計算します。ただし、これは厳密な逐次計算に対する近似です。
1-passの記憶モデルでも、時間方向の行列更新や逆伝播用の状態保存が重ければ遅くなります。しきい値で重みを0にしても全候補の投影や行列積を実行していれば、その部分の演算量は減りません。
Feeding a final prediction into the next token introduces a dependency: the current position must finish first. Two-pass training substitutes preliminary predictions so positions can be processed in parallel within a pass. This is an approximation to exact recurrence.
A one-pass memory model can still be slow if temporal matrix updates or backward-state storage dominate. Thresholding weights to zero does not reduce arithmetic when all candidate projections and matrix products still execute.
数値を保った改善の例
An optimization with measured numerical agreement
DC-B1の短い実データ試験では、文脈末尾で書き込んでも後の予測から読まれない候補処理を省略しました。同じ10M重み・Adam内部状態・乱数へ戻して比較し、四つのwindowでloss、勾配、parameter更新、optimizer状態の最大差は0でした。
記録された短期試験では速度比は約1.045倍です。計算が不要な位置を特定することで、学習の意味を保った改善が得られた例です。ただし、少数の計時から長時間学習全体の倍率までは確定しません。
A short DC-B1 test skipped candidate work at context tails where later predictions could never read the writes. Comparisons restored the same 10M weights, Adam state, and RNG. Across four real-data windows, maximum differences in loss, gradients, parameter updates, and optimizer state were zero.
The recorded short-test speed ratio was about 1.045×. This is an example of removing provably unused work while preserving the tested updates. It does not establish the end-to-end speedup of a long training run.
他の研究で再利用できる手順
A transferable procedure
速度は、同じ実データ・系列長・有効batch・精度で測ります。コンパイル初回費用と定常更新時間を分け、さらに保存と評価を含めた総時間を見ます。新しい融合や低精度化では、出力だけでなく勾配とAdam更新まで照合します。
丸めが変わる最適化と、候補数を切る・帰還を近似する構造変更は分けて記録します。どちらも試す余地はありますが、同じモデルを速くしたのか、学習する計算を変えたのかが読者に分かることが必要です。
Measure speed on the same real data, sequence lengths, effective batch, and precision. Separate first-compilation cost from steady updates, then include saving and evaluation in total runtime. For fusion or precision changes, compare gradients and Adam updates as well as outputs.
Record numerical-order changes separately from changes such as limiting candidate count or approximating feedback. Both may be useful, but readers need to know whether execution was accelerated or the learned computation was changed.
この章の根拠を調べるInspect the evidence
番号から構成と実測を確認できます。元資料の識別子・ハッシュも各モデル詳細にあります。Model IDs open recorded configurations and measurements. Source identifiers and hashes are provided in the model details.
exact_tail_speed.json ↗