feat: add superderive child and open phase-2 routing
Attach the stepwise derivation toolkit as a submodule and default SUPERPAPER_PHASE to 2 so rewrite-figure can use superderive. Notes still keep align for short expansions without cancel or subst.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
$QK^\top \to QK^\top/\sqrt{d_k}$。缩放压方差,避免 softmax 饱和。
|
||||
@@ -0,0 +1,14 @@
|
||||
# Figure request F3
|
||||
toolkit: superderive
|
||||
language: cjk
|
||||
claim: 1/√d_k 是改写,不是新算子
|
||||
grammar: derivation
|
||||
work_rel_dir: figures/F3
|
||||
|
||||
## Flow
|
||||
stage: {name: D1, text: "缩放来自方差,不是装饰"}
|
||||
row: {name: R1}
|
||||
in_row:
|
||||
- {macro: sdstep, name: s1, role: rewrite,
|
||||
lhs: "QK^{\\top}", rhs: "QK^{\\top}/\\sqrt{d_k}"}
|
||||
- {macro: sdreason, name: s1, text: "§3.2.1,避免 softmax 饱和"}
|
||||
@@ -0,0 +1,20 @@
|
||||
% Golden example -- a scale rewrite that must be seen, not just aligned.
|
||||
% ../scripts/build.sh rewrite-cancel.tex
|
||||
\documentclass[border=10pt]{standalone}
|
||||
\usepackage[cjk]{superderive}
|
||||
|
||||
\begin{document}
|
||||
\begin{tikzpicture}
|
||||
\sdstage{D1}{缩放来自方差,不是装饰}
|
||||
\sdrow{R1}
|
||||
\sdstep[role=rewrite]{s1}{QK^{\top}}{QK^{\top}/\sqrt{d_k}}
|
||||
\sdreason{s1}{§3.2.1,避免 softmax 饱和}
|
||||
\sdrowend
|
||||
\sdbbox{all}
|
||||
\sdtopformula{F}{$\mathrm{Attention}(Q,K,V)=\mathrm{softmax}(QK^{\top}/\sqrt{d_k})V$}
|
||||
\sdmeaningbox{mb}{120mm}{all}
|
||||
{点积方差随 $d_k$ 线性涨}
|
||||
{缩放是改写,不是新算子}
|
||||
{没有缩放,softmax 进饱和区,梯度消失}
|
||||
\end{tikzpicture}
|
||||
\end{document}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 105 KiB |
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 238 KiB |
Reference in New Issue
Block a user