SPET Paper 03
注意力投影不變量
Attention Projection Invariants
版本:v0.1 日期:2026-08-27 理論定位:SPET Series Paper 03 / Attention Semantics and Projection Correctness 依賴:SPET Paper 00、SPET Paper 01、SPET Paper 02 作者: Neo.K機構: EveMissLab/一言諾科技有限公司
摘要
本文延續 Stable Projection Epoch Theory(SPET),建立 Attention Projection Invariants(API) 的形式理論。前兩篇已分別定義 projection readiness 與 persistent coordinate frame,但高維 AI 與 projected-native computation 仍存在一個更細緻的問題:即使座標、region、tile 與 locality 在 epoch 內保持穩定,若 attention semantics 在投影後失真,projected representation 仍可能失去任務相關性、重要度排序、可達性與局部計算優先級。
本文不將 attention 限定為 Transformer 的 softmax attention,而將其一般化為任何對 state elements、relations、regions、tasks 或 routes 的選擇、權重、優先級、可達性與資源分配結構 。定義 attention state:
A = ⟨ W , S , R , M , L , Q , Θ ⟩ , \mathcal A
=
\left\langle
W,
S,
R,
M,
L,
Q,
\Theta
\right\rangle, A = ⟨ W , S , R , M , L , Q , Θ ⟩ ,
其中 W W W 為權重結構、 S S S 為 support、 R R R 為 rank/order、 M M M 為 mass allocation、 L L L 為 locality、 Q Q Q 為 reachability/query relevance, Θ \Theta Θ 為 attention typing 與 threshold profile。
本文提出:
I a t t n = { I s u p p o r t , I r a n k , I m a s s , I l o c a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } . \boxed{
\mathcal I^{attn}
=
\left\{
I_{support},
I_{rank},
I_{mass},
I_{locality},
I_{reach},
I_{identity},
I_{entry},
I_{exit}
\right\}.
} I a tt n = { I s u pp or t , I r ank , I ma ss , I l oc a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } .
其中除了保存既有 attention support,還加入 entry / exit invariants ,用來處理一個重要失敗模式:未被保護的 coordinate 即使不直接修改既有 top- k k k support,也可能因權重上升而「闖入」 protected set,改變 projected-native operator 的任務語義。因此合法 transform 必須驗證新的全域 attention profile,而不能只檢查「舊 support 有沒有被改」。
本文進一步定義 attention role typing:
A t t n R o l e ∈ { S E L E C T O R , I N V A R I A N T , W E I G H T , L A Y O U T , R O U T E R , A D V I S O R Y } , \mathsf{AttnRole}
\in
\{
\mathsf{SELECTOR},
\mathsf{INVARIANT},
\mathsf{WEIGHT},
\mathsf{LAYOUT},
\mathsf{ROUTER},
\mathsf{ADVISORY}
\}, AttnRole ∈ { SELECTOR , INVARIANT , WEIGHT , LAYOUT , ROUTER , ADVISORY } ,
並強調:
Attention Evolution ≠ Frame Evolution \boxed{
\text{Attention Evolution}
\neq
\text{Frame Evolution}
} Attention Evolution = Frame Evolution
以及:
Attention Invariant ≠ Attention Permanence . \boxed{
\text{Attention Invariant}
\neq
\text{Attention Permanence}.
} Attention Invariant = Attention Permanence .
在同一 Stable Projection Epoch 中,可以要求特定 attention semantics 保持 exact 或 bounded;Release 後則可合法重建新的 attention profile 與 projection frame。本文最後提出 Attention Invariant Certificate、post-transform recertification、attention debt、attention staleness、cross-epoch continuity 與 multi-head / multi-layer attention profile,並與 HDSRC Stable Projection Epoch 實驗對接。
關鍵詞: Stable Projection Epoch、Attention Projection Invariants、Attention Support、Attention Rank、Attention Mass、Attention Locality、Attention Certificate、HDSRC、AI Native Computation
0. 研究目的
SPET Paper 02 已經建立:
I s p a c e = { I a d d r , I i d e n t i t y , I r e g i o n , I t i l e , I l o c a l i t y , I r e a c h , I t o p o l o g y } . \mathcal I^{space}
=
\left\{
I_{addr},
I_{identity},
I_{region},
I_{tile},
I_{locality},
I_{reach},
I_{topology}
\right\}. I s p a ce = { I a dd r , I i d e n t i t y , I r e g i o n , I t i l e , I l oc a l i t y , I r e a c h , I t o p o l o g y } .
但僅有 spatial correctness 不足以保證 projected-native computation 的任務正確性。
例如,同一 coordinate identity 與 tile address 都保持不變,但:
a i a_i a i
的 attention priority 已經從高變低;
或另一 coordinate:
c j c_j c j
從低 priority 躍升進入 top- k k k ;
則原本依賴 protected attention support 的 operator 可能已經失去合法性。
因此本文研究:
在 Stable Projection Epoch 內,attention 的哪些性質必須保持?哪些可以變?哪些改變必須觸發 Release 或 Re-certification?
1. Attention 的一般化定義
本文不把 attention 限定為單一 neural attention matrix。
定義廣義 attention:
A = ⟨ W , S , R , M , L , Q , Θ ⟩ . \boxed{
\mathcal A
=
\left\langle
W,
S,
R,
M,
L,
Q,
\Theta
\right\rangle.
} A = ⟨ W , S , R , M , L , Q , Θ ⟩ .
其中:
W W W :weight / salience structure;
S S S :active support;
R R R :rank / priority order;
M M M :mass allocation;
L L L :attention locality;
Q Q Q :task / query relevance;
Θ \Theta Θ :threshold、normalization、typing profile。
因此 attention 可以來自:
Transformer attention;
retrieval score;
task relevance;
activation importance;
memory salience;
graph priority;
routing weight;
uncertainty-weighted focus;
manually declared protected region。
2. Attention Role Typing
attention 在 projection system 中可能扮演完全不同角色。
定義:
A t t n R o l e ∈ { S E L E C T O R , I N V A R I A N T , W E I G H T , L A Y O U T , R O U T E R , A D V I S O R Y } . \boxed{
\mathsf{AttnRole}
\in
\{
\mathsf{SELECTOR},
\mathsf{INVARIANT},
\mathsf{WEIGHT},
\mathsf{LAYOUT},
\mathsf{ROUTER},
\mathsf{ADVISORY}
\}.
} AttnRole ∈ { SELECTOR , INVARIANT , WEIGHT , LAYOUT , ROUTER , ADVISORY } .
2.1 SELECTOR
attention 用來選擇 projection scope:
D σ = S e l e c t B y A t t e n t i o n ( S ) . \mathcal D_\sigma
=
\mathsf{SelectByAttention}(S). D σ = SelectByAttention ( S ) .
2.2 INVARIANT
attention 本身是 epoch correctness contract 的一部分。
2.3 WEIGHT
attention 改變 operator cost、importance 或 priority,但不直接決定合法性。
2.4 LAYOUT
attention 參與建立 frame:
π k = B u i l d F r a m e ( S , A k ) . \pi_k
=
\mathsf{BuildFrame}(S,\mathcal A_k). π k = BuildFrame ( S , A k ) .
2.5 ROUTER
attention 直接影響 compute routing、resource allocation 或 executor selection。
2.6 ADVISORY
attention 只提供提示,不影響 hard correctness。
因此:
same attention values ⇏ same attention semantics . \boxed{
\text{same attention values}
\not\Rightarrow
\text{same attention semantics}.
} same attention values ⇒ same attention semantics .
3. Attention Support
給定 threshold:
θ , \theta, θ ,
定義 support:
S θ = { c i : a i ≥ θ } . \boxed{
S_\theta
=
\{c_i:a_i\ge\theta\}.
} S θ = { c i : a i ≥ θ } .
對 top- k k k :
S k t o p = TopK k ( a ) . \boxed{
S_k^{top}
=
\operatorname{TopK}_k(a).
} S k t o p = TopK k ( a ) .
4. Support Invariant
若 Freeze 時 protected support:
S k ⋆ S_k^\star S k ⋆
被標為 hard invariant,則 epoch 內要求:
S t p r o t = S k ⋆ . \boxed{
S_t^{prot}
=
S_k^\star.
} S t p r o t = S k ⋆ .
若只要求 subset preservation:
S k ⋆ ⊆ S t , S_k^\star
\subseteq
S_t, S k ⋆ ⊆ S t ,
則必須顯式標示為:
I s u p p o r t s u b s e t . I_{support}^{subset}. I s u pp or t s u b se t .
5. Entry Invariant
定義 outsider set:
O k = C σ ∖ S k ⋆ . O_k
=
\mathcal C_\sigma
\setminus
S_k^\star. O k = C σ ∖ S k ⋆ .
Entry invariant 要求:
∀ c j ∈ O k , c j ∉ S t p r o t . \boxed{
\forall c_j\in O_k,
\quad
c_j\notin S_t^{prot}.
} ∀ c j ∈ O k , c j ∈ / S t p r o t .
即未被保護的 coordinate 不得未經認證地闖入 protected support。
6. Exit Invariant
對:
c i ∈ S k ⋆ , c_i\in S_k^\star, c i ∈ S k ⋆ ,
若 hard support contract 要求其保留,則:
c i ∈ S t p r o t . \boxed{
c_i\in S_t^{prot}.
} c i ∈ S t p r o t .
所以:
I s u p p o r t = I e n t r y ∧ I e x i t . I_{support}
=
I_{entry}
\land
I_{exit}. I s u pp or t = I e n t r y ∧ I e x i t .
7. 為什麼需要 Entry / Exit
考慮 top- k k k attention。
Freeze 時:
S k ⋆ = { c 1 , … , c k } . S_k^\star
=
\{c_1,\ldots,c_k\}. S k ⋆ = { c 1 , … , c k } .
某 operator 只修改:
c j ∉ S k ⋆ c_j\notin S_k^\star c j ∈ / S k ⋆
並使:
a j ′ > min c i ∈ S k ⋆ a i . a_j'
>
\min_{c_i\in S_k^\star}a_i. a j ′ > c i ∈ S k ⋆ min a i .
雖然沒有直接修改 protected coordinate,但:
TopK ( a ′ ) ≠ S k ⋆ . \operatorname{TopK}(a')
\neq
S_k^\star. TopK ( a ′ ) = S k ⋆ .
因此:
No Direct Protected Mutation ⇏ Attention Support Preservation . \boxed{
\text{No Direct Protected Mutation}
\not\Rightarrow
\text{Attention Support Preservation}.
} No Direct Protected Mutation ⇒ Attention Support Preservation .
8. Rank Invariant
定義 rank function:
ρ k ( c ) = rank A k ( c ) . \rho_k(c)
=
\operatorname{rank}_{\mathcal A_k}(c). ρ k ( c ) = rank A k ( c ) .
exact rank invariant:
ρ t ( c ) = ρ k ( c ) . \boxed{
\rho_t(c)=\rho_k(c).
} ρ t ( c ) = ρ k ( c ) .
也可以只保護 partial order:
I r a n k p a r t i a l : ∀ ( c i , c j ) ∈ P k r a n k , a i > a j . I_{rank}^{partial}
:
\forall(c_i,c_j)\in\mathcal P_k^{rank},
\quad
a_i>a_j. I r ank p a r t ia l : ∀ ( c i , c j ) ∈ P k r ank , a i > a j .
9. Rank Tolerance
對 approximate attention,可允許:
∣ ρ t ( c ) − ρ k ( c ) ∣ ≤ δ ρ . |\rho_t(c)-\rho_k(c)|
\le
\delta_\rho. ∣ ρ t ( c ) − ρ k ( c ) ∣ ≤ δ ρ .
並定義:
I r a n k s o f t ( δ ρ ) . \boxed{
I_{rank}^{soft}(\delta_\rho).
} I r ank so f t ( δ ρ ) .
10. Attention Mass
對 region:
R , \mathcal R, R ,
定義:
M R = ∑ c i ∈ R a i . \boxed{
M_{\mathcal R}
=
\sum_{c_i\in\mathcal R}
a_i.
} M R = c i ∈ R ∑ a i .
approximate mass invariant:
∣ M R ( t ) − M R ( τ k ) ∣ ≤ ε M . \boxed{
\left|
M_{\mathcal R}(t)
-
M_{\mathcal R}(\tau_k)
\right|
\le
\varepsilon_M.
} ∣ M R ( t ) − M R ( τ k ) ∣ ≤ ε M .
11. Support / Rank / Mass Non-Collapse
即使 support 不變,mass 也可能大幅重分配。
因此:
I s u p p o r t ⇏ I m a s s . \boxed{
I_{support}
\not\Rightarrow
I_{mass}.
} I s u pp or t ⇒ I ma ss .
同樣:
I m a s s ⇏ I r a n k . I_{mass}
\not\Rightarrow
I_{rank}. I ma ss ⇒ I r ank .
三者必須分開型別化。
12. Attention Locality
定義:
L k a t t n ⊆ C σ × C σ . L_k^{attn}
\subseteq
\mathcal C_\sigma
\times
\mathcal C_\sigma. L k a tt n ⊆ C σ × C σ .
若:
( c i , c j ) ∈ L k a t t n , (c_i,c_j)\in L_k^{attn}, ( c i , c j ) ∈ L k a tt n ,
可以要求:
A c c e s s C o s t π k ( c i , c j ) ≤ B a t t n . \boxed{
\mathsf{AccessCost}_{\pi_k}(c_i,c_j)
\le
B_{attn}.
} AccessCost π k ( c i , c j ) ≤ B a tt n .
13. Attention Reachability
對 query:
q , q, q ,
若:
R e a c h A t t n S ( q , c i ) \mathsf{ReachAttn}_S(q,c_i) ReachAttn S ( q , c i )
屬於 hard scope,則要求:
R e a c h A t t n P ( q , c i ) = R e a c h A t t n S ( q , c i ) . \boxed{
\mathsf{ReachAttn}_P(q,c_i)
=
\mathsf{ReachAttn}_S(q,c_i).
} ReachAttn P ( q , c i ) = ReachAttn S ( q , c i ) .
14. Attention Identity
attention value 與 semantic identity 不得塌縮:
Attention Weight ≠ Attention Identity . \boxed{
\text{Attention Weight}
\neq
\text{Attention Identity}.
} Attention Weight = Attention Identity .
即使:
a i ( t ) ≠ a i ( t + 1 ) , a_i(t)\neq a_i(t+1), a i ( t ) = a i ( t + 1 ) ,
只要 semantic identity 未變,仍是同一物件。
15. Attention Projection Invariant Family
本文定義:
I k a t t n = { I s u p p o r t , I r a n k , I m a s s , I l o c a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } . \boxed{
\mathcal I_k^{attn}
=
\left\{
I_{support},
I_{rank},
I_{mass},
I_{locality},
I_{reach},
I_{identity},
I_{entry},
I_{exit}
\right\}.
} I k a tt n = { I s u pp or t , I r ank , I ma ss , I l oc a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } .
每個 invariant:
I j a t t n = ⟨ R o l e , S c o p e , P r e d i c a t e , S e v e r i t y , T o l e r a n c e , E v i d e n c e , V a l i d i t y ⟩ . I_j^{attn}
=
\left\langle
Role,
Scope,
Predicate,
Severity,
Tolerance,
Evidence,
Validity
\right\rangle. I j a tt n = ⟨ R o l e , S co p e , P r e d i c a t e , S e v er i t y , T o l er an ce , E v i d e n ce , V a l i d i t y ⟩ .
16. Attention Invariant Certificate
定義:
A I C e r t k = ⟨ E p o c h I D , F r a m e I D , A t t e n t i o n P r o f i l e I D , S u p p o r t P r o o f , E n t r y P r o o f , E x i t P r o o f , R a n k P r o o f , M a s s B o u n d s , L o c a l i t y P r o o f , R e a c h a b i l i t y P r o o f , V a l i d i t y , P r o v e n a n c e ⟩ . \boxed{
\mathsf{AICert}_k
=
\left\langle
EpochID,
FrameID,
AttentionProfileID,
SupportProof,
EntryProof,
ExitProof,
RankProof,
MassBounds,
LocalityProof,
ReachabilityProof,
Validity,
Provenance
\right\rangle.
} AICert k = ⟨ E p oc h I D , F r am e I D , A tt e n t i o n P r o f i l e I D , S u pp or tP r oo f , E n t r y P r oo f , E x i tP r oo f , R ank P r oo f , M a ss B o u n d s , L oc a l i t y P r oo f , R e a c habi l i t y P r oo f , V a l i d i t y , P r o v e nan ce ⟩ .
若 attention 屬於 hard scope,Freeze Certificate 必須引用:
A I C e r t k . \mathsf{AICert}_k. AICert k .
17. Attention Profile Identity
定義:
A t t n P r o f i l e I D = H ( R o l e , S c o p e , T h r e s h o l d s , N o r m a l i z a t i o n , I n v a r i a n t S e t , V a l i d i t y ) . \boxed{
\mathsf{AttnProfileID}
=
H(
Role,
Scope,
Thresholds,
Normalization,
InvariantSet,
Validity
).
} AttnProfileID = H ( R o l e , S co p e , T h r es h o l d s , N or ma l i z a t i o n , I n v a r ian tS e t , V a l i d i t y ) .
同樣的數值在不同 role / threshold 下,不應被當成同一 semantic profile。
18. Post-Transform Attention Verification
對:
F P ( P ) = P ′ , F_P(P)=P', F P ( P ) = P ′ ,
必須重新驗證:
V e r i f y A t t n ( P ′ , A I C e r t k ) \boxed{
\mathsf{VerifyAttn}
(
P',
\mathsf{AICert}_k
)
} VerifyAttn ( P ′ , AICert k )
而不是只檢查是否直接寫入 protected coordinates。
如果 hard invariant FAIL:
P ′ P' P ′
不得成為 authoritative epoch state。
19. Pre-Check 與 Post-Check
Pre-check 可以快速拒絕明顯違規,例如:
直接寫 protected top- k k k coordinate。
但:
Pre-Check ≠ Post-Transform Certification . \boxed{
\text{Pre-Check}
\neq
\text{Post-Transform Certification}.
} Pre-Check = Post-Transform Certification .
因為 outsider intrusion 可以間接發生。
20. Attention-Safe Operator
定義:
F ∈ F k a t t n − s a f e \boxed{
F
\in
\mathcal F_k^{attn-safe}
} F ∈ F k a tt n − s a f e
若:
∀ P ∈ P π k v a l i d , \forall P\in\mathcal P_{\pi_k}^{valid}, ∀ P ∈ P π k v a l i d ,
都有:
V e r i f y A t t n ( F ( P ) , A I C e r t k ) = P A S S . \mathsf{VerifyAttn}
(
F(P),
\mathsf{AICert}_k
)
=
\mathsf{PASS}. VerifyAttn ( F ( P ) , AICert k ) = PASS .
21. Conditionally Attention-Safe Operator
某些 operator 只在參數範圍內安全:
F Δ : a j → a j + Δ . F_\Delta
:
a_j\rightarrow a_j+\Delta. F Δ : a j → a j + Δ.
若:
Δ ∈ Ω k s a f e , \Delta\in\Omega_k^{safe}, Δ ∈ Ω k s a f e ,
才有:
F Δ ∈ F k a t t n − s a f e . F_\Delta
\in
\mathcal F_k^{attn-safe}. F Δ ∈ F k a tt n − s a f e .
22. Attention Violation as Obstruction
定義:
O a t t n = ⟨ T a r g e t , I n v a r i a n t , M e c h a n i s m , S c o p e , S t r e n g t h , C e r t i f i c a t e ⟩ . \boxed{
O_{attn}
=
\left\langle
Target,
Invariant,
Mechanism,
Scope,
Strength,
Certificate
\right\rangle.
} O a tt n = ⟨ T a r g e t , I n v a r ian t , M ec hani s m , S co p e , S t r e n g t h , C er t i f i c a t e ⟩ .
可包括:
support intrusion;
protected exit;
rank inversion;
mass drift;
locality overflow;
reachability loss。
若:
O a t t n ▹ F , O_{attn}\triangleright F, O a tt n ▹ F ,
則 operator 被拒絕或要求 Release。
23. Attention Debt
定義:
Δ a t t n = { δ s u p p o r t , δ r a n k , δ m a s s , δ l o c a l i t y , δ r e a c h } . \boxed{
\Delta_{attn}
=
\left\{
\delta_{support},
\delta_{rank},
\delta_{mass},
\delta_{locality},
\delta_{reach}
\right\}.
} Δ a tt n = { δ s u pp or t , δ r ank , δ ma ss , δ l oc a l i t y , δ r e a c h } .
soft profile 可允許:
Δ a t t n ≤ B a t t n . \Delta_{attn}\le B_{attn}. Δ a tt n ≤ B a tt n .
超過 budget:
R e l e a s e R e q u i r e d = 1. \boxed{
\mathsf{ReleaseRequired}=1.
} ReleaseRequired = 1.
24. Attention Staleness
定義:
A t t n S t a l e k ( t ) = d A ( A k , B u i l d A t t e n t i o n ( S t ) ) . \boxed{
\mathsf{AttnStale}_k(t)
=
d_{\mathcal A}
(
\mathcal A_k,
\mathsf{BuildAttention}(S_t)
).
} AttnStale k ( t ) = d A ( A k , BuildAttention ( S t )) .
但:
A t t n S t a l e > 0 \mathsf{AttnStale}>0 AttnStale > 0
不等於立即非法。
合法性仍由 hard invariants 與 debt budget 決定。
25. Attention Evolution / Frame Evolution Non-Collapse
若 attention role 是 WEIGHT 或 ADVISORY:
A t ≠ A τ k \mathcal A_t\neq\mathcal A_{\tau_k} A t = A τ k
可以同時保持:
π t = π k . \pi_t=\pi_k. π t = π k .
因此:
Attention Evolution ≠ Frame Evolution . \boxed{
\text{Attention Evolution}
\neq
\text{Frame Evolution}.
} Attention Evolution = Frame Evolution .
26. Attention as Layout Driver
若:
A t t n R o l e = L A Y O U T , \mathsf{AttnRole}
=
\mathsf{LAYOUT}, AttnRole = LAYOUT ,
則 Freeze 時:
π k = B u i l d F r a m e ( S k , A k ) . \pi_k
=
\mathsf{BuildFrame}(S_k,\mathcal A_k). π k = BuildFrame ( S k , A k ) .
但 epoch 內 attention 的 bounded change 不應隱式重建 frame。
必須:
R e l e a s e → R e p r o j e c t . \boxed{
\mathsf{Release}
\rightarrow
\mathsf{Reproject}.
} Release → Reproject .
27. Attention Invariant 不等於永久 Attention
Attention Invariant ≠ Attention Permanence . \boxed{
\text{Attention Invariant}
\neq
\text{Attention Permanence}.
} Attention Invariant = Attention Permanence .
真正語義是:
Invariant within declared epoch / scope . \boxed{
\text{Invariant within declared epoch / scope}.
} Invariant within declared epoch / scope .
28. Cross-Epoch Attention Continuity
定義:
Γ A k , k + 1 = { ( c , a k ( c ) , a k + 1 ( c ) , ρ k ( c ) , ρ k + 1 ( c ) ) } . \boxed{
\Gamma_A^{k,k+1}
=
\{
(c,
a_k(c),
a_{k+1}(c),
\rho_k(c),
\rho_{k+1}(c))
\}.
} Γ A k , k + 1 = {( c , a k ( c ) , a k + 1 ( c ) , ρ k ( c ) , ρ k + 1 ( c ))} .
所以 attention change 不代表 history 消失。
29. Attention Re-certification
Release 後:
A k + 1 = B u i l d A t t e n t i o n ( S k + 1 ⋆ ) , \mathcal A_{k+1}
=
\mathsf{BuildAttention}(S_{k+1}^\star), A k + 1 = BuildAttention ( S k + 1 ⋆ ) ,
並產生:
A I C e r t k + 1 . \mathsf{AICert}_{k+1}. AICert k + 1 .
因此:
A I C e r t k ⇏ A I C e r t k + 1 . \boxed{
\mathsf{AICert}_k
\not\Rightarrow
\mathsf{AICert}_{k+1}.
} AICert k ⇒ AICert k + 1 .
30. Multi-Head Attention
若:
A = { A ( 1 ) , … , A ( h ) } , \mathcal A
=
\{
\mathcal A^{(1)},
\ldots,
\mathcal A^{(h)}
\}, A = { A ( 1 ) , … , A ( h ) } ,
不同 head 可以有不同 invariant profile。
例如:
Head 1:hard support;
Head 2:soft rank;
Head 3:advisory only。
31. Cross-Head Constraint
可以建立:
I c o v e r a g e : ∣ ⋃ r S t ( r ) ∣ ≥ K . \boxed{
I_{coverage}
:
\left|
\bigcup_r S_t^{(r)}
\right|
\ge
K.
} I co v er a g e : r ⋃ S t ( r ) ≥ K .
所以 invariant 可以作用於 attention family。
32. Multi-Layer Attention
不同 layer:
A [ ℓ ] \mathcal A^{[\ell]} A [ ℓ ]
可以具有不同 temporal semantics。
因此:
Attention temporal semantics can be layer-typed . \boxed{
\text{Attention temporal semantics can be layer-typed}.
} Attention temporal semantics can be layer-typed .
33. Attention Projection
source attention:
a : C → R a:
\mathcal C
\rightarrow\mathbb R a : C → R
投影為:
a P : P → R . a_P:
\mathcal P
\rightarrow\mathbb R. a P : P → R .
若地址一對一,可要求:
a P ( A k ( c ) ) = a ( c ) . a_P(A_k(c))
=
a(c). a P ( A k ( c )) = a ( c ) .
若 carrier aggregation,多 coordinate 共用位置,則必須顯式定義:
a P ( p ) = A g g ( { a ( c ) : A k ( c ) = p } ) . a_P(p)
=
\mathsf{Agg}
(
\{a(c):A_k(c)=p\}
). a P ( p ) = Agg ({ a ( c ) : A k ( c ) = p }) .
34. Attention Mass Conservation
聚合 carrier 可要求:
∑ p ∈ P a P ( p ) = ∑ c ∈ C a ( c ) . \boxed{
\sum_{p\in\mathcal P}
a_P(p)
=
\sum_{c\in\mathcal C}
a(c).
} p ∈ P ∑ a P ( p ) = c ∈ C ∑ a ( c ) .
但 mass conservation 不推出 support 或 rank preservation。
35. Query / Task Conditional Attention
若:
a ( c ∣ q ) a(c\mid q) a ( c ∣ q )
或:
a ( c ∣ τ ) , a(c\mid\tau), a ( c ∣ τ ) ,
則 invariant 必須綁定:
q ∈ Q σ q\in\mathcal Q_\sigma q ∈ Q σ
或 task:
τ . \tau. τ .
因此:
I a t t n = I a t t n ( q , τ , σ ) . \boxed{
I_{attn}
=
I_{attn}(q,\tau,\sigma).
} I a tt n = I a tt n ( q , τ , σ ) .
36. Attention / Observation Non-Collapse
observer 可只看:
5 % 5\% 5%
carrier,但 attention semantics 可以涵蓋整個 logical projected state。
因此:
Observed Region ≠ Attention Support . \boxed{
\text{Observed Region}
\neq
\text{Attention Support}.
} Observed Region = Attention Support .
37. Attention / Materialization Non-Collapse
Attention ≠ Materialization . \boxed{
\text{Attention}
\neq
\text{Materialization}.
} Attention = Materialization .
可先:
A t t e n t i o n S e l e c t → S c h e d u l e → P a r t i a l M a t e r i a l i z e . \mathsf{AttentionSelect}
\rightarrow
\mathsf{Schedule}
\rightarrow
\mathsf{PartialMaterialize}. AttentionSelect → Schedule → PartialMaterialize .
38. Attention / Authority Non-Collapse
a i ≫ a j ⇏ A u t h o r i t y ( c i ) > A u t h o r i t y ( c j ) . \boxed{
a_i\gg a_j
\not\Rightarrow
Authority(c_i)>Authority(c_j).
} a i ≫ a j ⇒ A u t h or i t y ( c i ) > A u t h or i t y ( c j ) .
高 attention 不自動取得 execution / commit authority。
39. Attention Invariant 與 Operator Algebra
定義 epoch-safe operator:
F k s a f e = F k s p a c e − s a f e ∩ F k a t t n − s a f e . \boxed{
\mathcal F_k^{safe}
=
\mathcal F_k^{space-safe}
\cap
\mathcal F_k^{attn-safe}.
} F k s a f e = F k s p a ce − s a f e ∩ F k a tt n − s a f e .
同時保持 spatial 與 attention contract,才可在 epoch 中合法 composition。
40. Composition
若:
F 1 , … , F m ∈ F k s a f e , F_1,\ldots,F_m
\in
\mathcal F_k^{safe}, F 1 , … , F m ∈ F k s a f e ,
且每一步:
V e r i f y S p a c e = P A S S , \mathsf{VerifySpace}
=
\mathsf{PASS}, VerifySpace = PASS ,
V e r i f y A t t n = P A S S , \mathsf{VerifyAttn}
=
\mathsf{PASS}, VerifyAttn = PASS ,
則有限 composition 保持 epoch validity。
41. Composition 不自動封閉
即使:
F 1 F_1 F 1
與:
F 2 F_2 F 2
各自對 baseline state safe,也不自動推出:
F 2 ∘ F 1 F_2\circ F_1 F 2 ∘ F 1
對所有中間 state safe。
因此:
authoritative steps require post-transform recertification . \boxed{
\text{authoritative steps require post-transform recertification}.
} authoritative steps require post-transform recertification .
42. HDSRC Stable Epoch 實驗對應
HDSRC 實驗使用:
S k t o p 32 S_k^{top32} S k t o p 32
作為 protected attention support。
已驗證兩類 violation。
42.1 Direct Protected Mutation
直接修改 protected member,系統 fail-closed。
42.2 Indirect Support Intrusion
修改:
c j ∉ S k t o p 32 c_j\notin S_k^{top32} c j ∈ / S k t o p 32
使其 weight 足以進入 Top32。
即使沒有直接修改舊 support,post-transform certificate 仍偵測:
S t + 1 t o p 32 ≠ S k t o p 32 S_{t+1}^{top32}
\neq
S_k^{top32} S t + 1 t o p 32 = S k t o p 32
並拒絕輸出。
因此:
I e n t r y is necessary . \boxed{
I_{entry}
\text{ is necessary}.
} I e n t r y is necessary .
43. Release 後合法 Attention Change
同樣的 semantic change 若先:
R e l e a s e , \mathsf{Release}, Release ,
再建立下一個 epoch:
E k + 1 , \mathcal E_{k+1}, E k + 1 ,
則:
S k + 1 t o p 32 ≠ S k t o p 32 S_{k+1}^{top32}
\neq
S_k^{top32} S k + 1 t o p 32 = S k t o p 32
可以合法,只要:
A I C e r t k + 1 = P A S S . \mathsf{AICert}_{k+1}
=
\mathsf{PASS}. AICert k + 1 = PASS .
所以:
Illegal within epoch ⇏ Illegal across epochs . \boxed{
\text{Illegal within epoch}
\not\Rightarrow
\text{Illegal across epochs}.
} Illegal within epoch ⇒ Illegal across epochs .
44. Semantic Attention / Spatial Position Non-Collapse
即使:
S k t o p = S k + 1 t o p , S_k^{top}
=
S_{k+1}^{top}, S k t o p = S k + 1 t o p ,
跨 epoch frame 改變後:
A k ( c ) ≠ A k + 1 ( c ) A_k(c)\neq A_{k+1}(c) A k ( c ) = A k + 1 ( c )
可以對全部 top- k k k coordinates 成立。
因此:
Attention Semantic Stability ≠ Attention Spatial Position Stability across epochs . \boxed{
\text{Attention Semantic Stability}
\neq
\text{Attention Spatial Position Stability across epochs}.
} Attention Semantic Stability = Attention Spatial Position Stability across epochs .
45. Attention Drift Vector
定義:
Δ A s u p p o r t = ∣ S k t o p △ S k + 1 t o p ∣ , \Delta_A^{support}
=
|S_k^{top}\triangle S_{k+1}^{top}|, Δ A s u pp or t = ∣ S k t o p △ S k + 1 t o p ∣ ,
Δ A r a n k = ∑ c ∣ ρ k ( c ) − ρ k + 1 ( c ) ∣ , \Delta_A^{rank}
=
\sum_c
|\rho_k(c)-\rho_{k+1}(c)|, Δ A r ank = c ∑ ∣ ρ k ( c ) − ρ k + 1 ( c ) ∣ ,
Δ A m a s s = ∑ R ∣ M R k − M R k + 1 ∣ , \Delta_A^{mass}
=
\sum_{\mathcal R}
|M_{\mathcal R}^k-M_{\mathcal R}^{k+1}|, Δ A ma ss = R ∑ ∣ M R k − M R k + 1 ∣ ,
以及 position drift:
Δ A p o s = ∑ c ∈ S k t o p 1 [ A k ( c ) ≠ A k + 1 ( c ) ] . \Delta_A^{pos}
=
\sum_{c\in S_k^{top}}
\mathbf 1[
A_k(c)\neq A_{k+1}(c)
]. Δ A p os = c ∈ S k t o p ∑ 1 [ A k ( c ) = A k + 1 ( c )] .
整體:
Δ A = ⟨ Δ A s u p p o r t , Δ A r a n k , Δ A m a s s , Δ A l o c a l i t y , Δ A r e a c h , Δ A p o s ⟩ . \boxed{
\mathbf\Delta_A
=
\left\langle
\Delta_A^{support},
\Delta_A^{rank},
\Delta_A^{mass},
\Delta_A^{locality},
\Delta_A^{reach},
\Delta_A^{pos}
\right\rangle.
} Δ A = ⟨ Δ A s u pp or t , Δ A r ank , Δ A ma ss , Δ A l oc a l i t y , Δ A r e a c h , Δ A p os ⟩ .
46. Attention Migration Cost
跨 epoch:
A k → A k + 1 \mathcal A_k
\rightarrow
\mathcal A_{k+1} A k → A k + 1
可能產生:
C a t t n − m i g = C r e i n d e x + C c a c h e + C r e r o u t e + C r e f e t c h + C r e v e r i f y . C_{attn-mig}
=
C_{reindex}
+
C_{cache}
+
C_{reroute}
+
C_{refetch}
+
C_{reverify}. C a tt n − mi g = C r e in d e x + C c a c h e + C r er o u t e + C r e f e t c h + C r e v er i f y .
因此 attention refresh 不是免費操作。
47. Attention Refresh Benefit
B a t t n − r e f r e s h = B t a s k + B a c c u r a c y + B l o c a l i t y + B r o u t i n g . B_{attn-refresh}
=
B_{task}
+
B_{accuracy}
+
B_{locality}
+
B_{routing}. B a tt n − r e f r es h = B t a s k + B a cc u r a cy + B l oc a l i t y + B r o u t in g .
可採用:
B a t t n − r e f r e s h > C a t t n − m i g + C r i s k B_{attn-refresh}
>
C_{attn-mig}
+
C_{risk} B a tt n − r e f r es h > C a tt n − mi g + C r i s k
作為 transition 的工程判斷之一,但 hard admissibility 必須先通過。
48. Hard / Soft Attention Profiles
可同時存在:
A P r o f i l e H \mathsf{AProfile}^{H} AProfile H
例如 exact support / reachability,
與:
A P r o f i l e S \mathsf{AProfile}^{S} AProfile S
例如:
∣ Δ r a n k ∣ ≤ 2 |\Delta rank|\le2 ∣Δ r ank ∣ ≤ 2
或:
Δ m a s s ≤ 0.01. \Delta mass\le0.01. Δ ma ss ≤ 0.01.
49. Attention Readiness
Freeze 前:
A t t e n t i o n R e a d y ( S , σ ) \mathsf{AttentionReady}(S,\sigma) AttentionReady ( S , σ )
要求所有 hard attention obligations PASS。
若 attention role 是 ADVISORY,則可不阻斷 Freeze。
所以:
Attention Readiness is role-typed . \boxed{
\text{Attention Readiness is role-typed}.
} Attention Readiness is role-typed .
50. Attention Freeze
Freeze 的不是每一個 attention scalar。
Freeze 的是:
Attention Contract . \boxed{
\text{Attention Contract}.
} Attention Contract .
可能包含:
support;
threshold;
rank constraints;
mass bounds;
locality budget;
reachability profile。
因此:
Freeze Attention Contract ≠ Freeze Every Attention Number . \boxed{
\text{Freeze Attention Contract}
\neq
\text{Freeze Every Attention Number}.
} Freeze Attention Contract = Freeze Every Attention Number .
51. Attention Release / Reopening
若合法但必要的 attention change 會破壞目前 contract,應:
R e l e a s e → R e c o m p u t e → R e − c e r t i f y . \boxed{
\mathsf{Release}
\rightarrow
\mathsf{Recompute}
\rightarrow
\mathsf{Re-certify}.
} Release → Recompute → Re − certify .
而不是強迫新 attention 回到舊狀態。
52. Attention Ledger
定義 event:
e k a t t n = ⟨ P r o f i l e O l d , P r o f i l e N e w , S u p p o r t D i f f , R a n k D i f f , M a s s D i f f , C a u s e , C e r t i f i c a t e , T i m e ⟩ . e_k^{attn}
=
\left\langle
ProfileOld,
ProfileNew,
SupportDiff,
RankDiff,
MassDiff,
Cause,
Certificate,
Time
\right\rangle. e k a tt n = ⟨ P r o f i l e O l d , P r o f i l e N e w , S u pp or t D i f f , R ank D i f f , M a ssD i f f , C a u se , C er t i f i c a t e , T im e ⟩ .
形成:
A t t n L e d g e r = { e 0 a t t n , e 1 a t t n , … } . \boxed{
\mathsf{AttnLedger}
=
\{e_0^{attn},e_1^{attn},\ldots\}.
} AttnLedger = { e 0 a tt n , e 1 a tt n , … } .
53. Attention Certificate Expiration
A I C e r t \mathsf{AICert} AICert 可以:
time-bound;
event-bound;
state-anchor-bound;
task-bound。
例如:
V a l i d U n t i l = task-change \mathsf{ValidUntil}
=
\text{task-change} ValidUntil = task-change
或:
V a l i d U n t i l = relation-version-change . \mathsf{ValidUntil}
=
\text{relation-version-change}. ValidUntil = relation-version-change .
54. Attention 與 Resource Allocation
若 attention role 為 ROUTER:
a i → r i , a_i
\rightarrow
r_i, a i → r i ,
則 attention support / rank 可能影響:
GPU block;
batch priority;
memory residency;
I/O prefetch。
因此 attention invariants 也可以成為 resource stability contract。
55. Attention 與 GCM
GCM computational configuration 可擴展為:
γ = ⟨ β , ρ C , r , χ , A ⟩ . \gamma
=
\langle
\beta,
\rho^C,
r,
\chi,
\mathcal A
\rangle. γ = ⟨ β , ρ C , r , χ , A ⟩ .
但:
A ≠ A u t h o r i t y . \boxed{
\mathcal A
\neq
Authority.
} A = A u t h or i t y .
Attention 可以影響 proposal、priority 與 routing,不自動取得 commit authority。
56. Attention 與 HDSRC Image Carrier
HDSRC image-native carrier 可以把 attention 表示為:
independent layer;
region metadata;
sparse attention page;
routing sidecar;
tile priority map。
但:
Attention Carrier ≠ Canonical Attention Semantics . \boxed{
\text{Attention Carrier}
\neq
\text{Canonical Attention Semantics}.
} Attention Carrier = Canonical Attention Semantics .
57. Attention-Safe Native Compute
理想 projected-native operator 同時滿足:
F P ∈ F k s p a c e − s a f e F_P
\in
\mathcal F_k^{space-safe} F P ∈ F k s p a ce − s a f e
與:
F P ∈ F k a t t n − s a f e . F_P
\in
\mathcal F_k^{attn-safe}. F P ∈ F k a tt n − s a f e .
因此:
F P ∈ F k e p o c h − s a f e . \boxed{
F_P
\in
\mathcal F_k^{epoch-safe}.
} F P ∈ F k e p oc h − s a f e .
58. 第一批命題
Proposition 58.1 — Support Preservation Requires Entry and Exit Checks
只檢查 protected members 未被直接修改,不足以推出:
S t t o p = S k t o p . S_t^{top}=S_k^{top}. S t t o p = S k t o p .
若同時驗證:
I e n t r y ∧ I e x i t , I_{entry}
\land
I_{exit}, I e n t r y ∧ I e x i t ,
才可得到 exact support preservation。
Proposition 58.2 — Attention Value Mutation Does Not Necessarily Violate Contract
存在:
a i ′ ≠ a i a_i'\neq a_i a i ′ = a i
但所有 hard invariants PASS。
因此:
Δ a t t e n t i o n v a l u e ⇏ epoch invalid . \boxed{
\Delta attention value
\not\Rightarrow
\text{epoch invalid}.
} Δ a tt e n t i o n v a l u e ⇒ epoch invalid .
Proposition 58.3 — Support Equality Does Not Imply Rank Equality
存在:
S t = S k S_t=S_k S t = S k
但:
ρ t ≠ ρ k . \rho_t\neq\rho_k. ρ t = ρ k .
Proposition 58.4 — Cross-Epoch Attention Change Is Admissible
即使:
S k t o p ≠ S k + 1 t o p , S_k^{top}\neq S_{k+1}^{top}, S k t o p = S k + 1 t o p ,
只要 Release 與新 certificate 合法,transition 可接受。
Proposition 58.5 — Semantic Stability Does Not Require Spatial Position Stability Across Epochs
若 support 不變但 frame 改變:
S k t o p = S k + 1 t o p S_k^{top}=S_{k+1}^{top} S k t o p = S k + 1 t o p
可同時有:
A k ( c ) ≠ A k + 1 ( c ) . A_k(c)\neq A_{k+1}(c). A k ( c ) = A k + 1 ( c ) .
59. SPET Paper 03 公理 / 規範 v0.1
SPET-AI1 — Attention Role Typing
所有 attention contract 必須宣告角色。
SPET-AI2 — Support / Rank / Mass Non-Collapse
Support、rank、mass 不得互相替代。
SPET-AI3 — Entry / Exit Completeness
Protected support 必須同時驗證 outsider entry 與 protected exit。
SPET-AI4 — Post-Transform Re-certification
Authoritative transform 後必須重新驗證 hard attention invariants。
SPET-AI5 — No Direct-Mutation Shortcut
未直接修改 protected coordinate 不代表 attention invariant 自動成立。
SPET-AI6 — Attention / Frame Non-Collapse
Attention evolution 不得隱式修改 authoritative frame。
SPET-AI7 — Attention Contract, Not Numerical Freeze
Freeze 的是 attention semantics contract,不是所有 attention scalar。
SPET-AI8 — Epoch-Bounded Attention Invariants
Attention invariant 只在宣告 epoch / scope 內成立。
SPET-AI9 — Certified Cross-Epoch Attention Change
跨 epoch attention transition 必須重新 certification。
SPET-AI10 — Attention / Authority Non-Collapse
高 attention 不自動取得 execution / commit authority。
SPET-AI11 — Attention Ledger
Authoritative attention transition 必須可回放與稽核。
SPET-AI12 — Task / Query Binding
Query-conditional / task-conditional attention 必須綁定其 scope。
60. 對 AI 原生計算的含義
SPET 不要求:
f a t t n = f p r o j e c t i o n = f f r a m e . f_{attn}
=
f_{projection}
=
f_{frame}. f a tt n = f p r o j ec t i o n = f f r am e .
可以:
f a t t n ≫ f f r a m e \boxed{
f_{attn}
\gg
f_{frame}
} f a tt n ≫ f f r am e
只要 hard attention contract 未破壞。
因此 AI 可以:
在來源空間持續更新細粒度 attention;
維持 epoch-level attention invariants;
在 projected space 中維持 stable operator semantics;
必要時 Release;
重建 attention profile;
建立下一個 epoch。
61. 對計算成本的含義
若每次 attention 微小變化都不需要 reproject:
C r e p r o j e c t C_{reproject} C r e p r o j ec t
可以被延遲。
只需維護:
C a t t n − u p d a t e + C v e r i f y . C_{attn-update}
+
C_{verify}. C a tt n − u p d a t e + C v er i f y .
因此可研究:
C e p o c h < C c o n t i n u o u s − r e p r o j e c t i o n \boxed{
C_{epoch}
<
C_{continuous-reprojection}
} C e p oc h < C co n t in u o u s − r e p r o j ec t i o n
是否對特定 workload 成立。
62. 對 Local Integrity 的接口
Attention certificate 可以 tile / region 化。
例如:
h i a t t n = H ( S u p p o r t i , M a s s i , R a n k i ) . h_i^{attn}
=
H(
Support_i,
Mass_i,
Rank_i
). h i a tt n = H ( S u pp or t i , M a s s i , R an k i ) .
上層建立 Merkle root。
因此 local attention change 可只更新:
O ( log N ) O(\log N) O ( log N )
certificate path。
這會在 projected-native runtime whitepaper 中進一步發展。
63. 未解問題
Top- k k k support 是否適合所有 attention?
Multi-head invariant composition 如何定義?
Rank 應 exact 還是 partial order?
Region mass partition 由誰決定?
Attention staleness 與 frame staleness 如何聯合最佳化?
Query-conditional certificate 如何快取?
GPU-native attention layer 如何直接參與 local certificate?
Stochastic attention 如何處理?
Continuous attention manifold 如何投影?
Attention refresh 是否交由 GCM router 自主決定?
64. 與 Paper 04 的接口
下一篇將研究:
Certified Reprojection + Release + Reopening + Epoch Transition . \boxed{
\text{Certified Reprojection}
+
\text{Release}
+
\text{Reopening}
+
\text{Epoch Transition}.
} Certified Reprojection + Release + Reopening + Epoch Transition .
核心問題是:
當 spatial / attention debt、task scope、obstruction 或新 computation state 使目前 epoch 不再適合時,如何合法地離開這個 frame、建立下一個 frame,而不破壞 history、identity 與 provenance?
65. 結論
本文將 attention 從 projection 的附屬參數提升為正式 computational contract。
核心 invariant family:
I k a t t n = { I s u p p o r t , I r a n k , I m a s s , I l o c a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } . \boxed{
\mathcal I_k^{attn}
=
\left\{
I_{support},
I_{rank},
I_{mass},
I_{locality},
I_{reach},
I_{identity},
I_{entry},
I_{exit}
\right\}.
} I k a tt n = { I s u pp or t , I r ank , I ma ss , I l oc a l i t y , I r e a c h , I i d e n t i t y , I e n t r y , I e x i t } .
其中一個最重要的非坍縮為:
No Direct Protected Mutation ⇏ Attention Preservation . \boxed{
\text{No Direct Protected Mutation}
\not\Rightarrow
\text{Attention Preservation}.
} No Direct Protected Mutation ⇒ Attention Preservation .
因此 projected-native transform 必須做 post-transform attention re-certification。
本文同時提出:
Attention Evolution ≠ Frame Evolution \boxed{
\text{Attention Evolution}
\neq
\text{Frame Evolution}
} Attention Evolution = Frame Evolution
以及:
Attention Invariant ≠ Attention Permanence . \boxed{
\text{Attention Invariant}
\neq
\text{Attention Permanence}.
} Attention Invariant = Attention Permanence .
Stable Projection Epoch 不要求 attention 永遠不變,而要求:
在明確 epoch 與 projection scope 中,被宣告為 computationally significant 的 attention semantics 必須維持 exact 或 bounded correctness。
當 task、attention regime、relation structure 或 spatial debt 合法改變時,系統可以:
R e l e a s e → R e c o m p u t e → R e − c e r t i f y → E k + 1 . \mathsf{Release}
\rightarrow
\mathsf{Recompute}
\rightarrow
\mathsf{Re-certify}
\rightarrow
\mathcal E_{k+1}. Release → Recompute → Re − certify → E k + 1 .
因此 attention 不再只是「模型現在看哪裡」,而成為一個可以被 Freeze、驗證、拒絕、更新、遷移與稽核的 projection-state contract。
內部理論血統與依賴
SPET Paper 00 — Stable Projection Epoch Theory: Formal Foundations.
SPET Paper 01 — Typed Projection Scope, Closure Readiness, and Freeze Certification.
SPET Paper 02 — Spatial Projection Invariants and Persistent Coordinate Frames.
Closure-Space Mathematics Paper 00–02.
HDSRC — High-Dimensional Symbolic Relational Compilation.
HDSRC Stable Projection Epoch Feasibility experiments.
HDSRC Native Projection State-Transform Closure experiments.
本文中的 Attention Projection Invariants 為上述理論與實驗後形成的新形式化層,不回溯宣稱舊理論已完整包含本文全部定義。