File size: 8,773 Bytes
b88c26d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
// BURT-IMMA Constraint Graph
// Visualize with: dot -Tpng constraint_graph.dot -o constraint_graph.png
// Or: dot -Tsvg constraint_graph.dot -o constraint_graph.svg

digraph BURT_IMMA {
    // Global graph attributes
    rankdir=TB;
    fontname="Helvetica";
    fontsize=12;
    label="BURT-IMMA Constraint Graph\nProject: BURT-IMMA | Contact: jessica@collectivekitty.com | License: BSL-1.1";
    labelloc=t;
    compound=true;
    nodesep=0.8;
    ranksep=1.0;

    // Node defaults
    node [
        shape=box,
        style="rounded,filled",
        fontname="Helvetica",
        fontsize=10,
        fillcolor="#E8F4FD",
        color="#2C3E50"
    ];

    // Edge defaults
    edge [
        fontname="Helvetica",
        fontsize=8,
        color="#34495E"
    ];

    // =============================================
    // Subgraph: Feature Extraction
    // =============================================
    subgraph cluster_feature_extraction {
        label="Feature Extraction";
        style="rounded,dashed";
        color="#3498DB";
        fontcolor="#3498DB";
        fontsize=11;

        Input [
            label="Input\n[batch, seq_len]",
            shape=ellipse,
            fillcolor="#AED6F1"
        ];

        SmoothLeaky [
            label="SmoothLeaky\nActivation\n\nk=1.0, alpha=0.01\nSmooth for EP",
            fillcolor="#D4EFDF"
        ];

        GatesNorm [
            label="GatesNorm\nNormalization\n\ngamma, beta learnable\nPer-expert dim",
            fillcolor="#D4EFDF"
        ];
    }

    // =============================================
    // Subgraph: Memory System
    // =============================================
    subgraph cluster_memory_system {
        label="Memory System";
        style="rounded,dashed";
        color="#E74C3C";
        fontcolor="#E74C3C";
        fontsize=11;

        CIFGMemory [
            label="CIFGMemory\n\nC_global: [d, d]\nC_expert: [K, d_e, d_e]\nf = sigma(W_f * [h,x])\nC_new = f*C + (1-f)*candidate",
            fillcolor="#FADBD8",
            shape=box3d
        ];
    }

    // =============================================
    // Subgraph: Routing
    // =============================================
    subgraph cluster_routing {
        label="Routing (Sparse MoE)";
        style="rounded,dashed";
        color="#F39C12";
        fontcolor="#F39C12";
        fontsize=11;

        GatesRouter [
            label="GatesRouter\n\ntop_k=2\nentropy_bound=0.20\nL1 sparsity",
            fillcolor="#FEF9E7"
        ];

        Expert1 [
            label="Expert 1\n[d_expert=256]",
            fillcolor="#FDF2E9"
        ];

        Expert2 [
            label="Expert 2\n[d_expert=256]",
            fillcolor="#FDF2E9"
        ];

        Expert3 [
            label="Expert 3\n[d_expert=256]",
            fillcolor="#FDF2E9"
        ];

        Expert4 [
            label="Expert 4\n[d_expert=256]",
            fillcolor="#FDF2E9"
        ];
    }

    // =============================================
    // Subgraph: Output Head
    // =============================================
    subgraph cluster_output_head {
        label="Output Head";
        style="rounded,dashed";
        color="#8E44AD";
        fontcolor="#8E44AD";
        fontsize=11;

        InductionHeads [
            label="Superpositioned\nInduction Heads\n\nnum_heads=8\nCopy pattern detection\nMemory superposition",
            fillcolor="#E8DAEF"
        ];

        QInterference [
            label="Quantum\nInterference\nResolver\n\nAmplitude combination\nConstructive/destructive",
            fillcolor="#E8DAEF"
        ];

        Output [
            label="Output\n[batch, seq_len, vocab]\n\nConstrained Softmax\nentropy <= 0.20",
            shape=ellipse,
            fillcolor="#D2B4DE"
        ];
    }

    // =============================================
    // Data Flow Edges
    // =============================================

    // Feature extraction flow
    Input -> SmoothLeaky [
        label="embed + pos_encode"
    ];

    SmoothLeaky -> GatesNorm [
        label="activated features"
    ];

    // Memory interaction
    GatesNorm -> CIFGMemory [
        label="h (hidden state)",
        style=bold
    ];

    CIFGMemory -> InductionHeads [
        label="memory context\nC_global @ h",
        color="#E74C3C"
    ];

    // Routing flow
    GatesNorm -> GatesRouter [
        label="routing logits"
    ];

    GatesRouter -> Expert1 [
        label="alpha_1",
        style=dashed,
        constraint=false
    ];

    GatesRouter -> Expert2 [
        label="alpha_2",
        style=dashed,
        constraint=false
    ];

    GatesRouter -> Expert3 [
        label="alpha_3",
        style=dashed,
        constraint=false
    ];

    GatesRouter -> Expert4 [
        label="alpha_4",
        style=dashed,
        constraint=false
    ];

    // Expert to interference
    Expert1 -> QInterference [
        label="out_1"
    ];

    Expert2 -> QInterference [
        label="out_2"
    ];

    Expert3 -> QInterference [
        label="out_3"
    ];

    Expert4 -> QInterference [
        label="out_4"
    ];

    // Expert memory update
    Expert1 -> CIFGMemory [
        label="update C_expert[1]",
        style=dotted,
        color="#E74C3C",
        constraint=false
    ];

    Expert2 -> CIFGMemory [
        label="update C_expert[2]",
        style=dotted,
        color="#E74C3C",
        constraint=false
    ];

    // Induction heads
    GatesNorm -> InductionHeads [
        label="Q, K, V projections"
    ];

    // Output assembly
    InductionHeads -> QInterference [
        label="attention output",
        style=bold
    ];

    QInterference -> Output [
        label="resolved output",
        style=bold
    ];

    // Feedback (memory write from output)
    Output -> CIFGMemory [
        label="memory write\n(CIFG gated)",
        style=dotted,
        color="#E74C3C",
        dir=back,
        constraint=false
    ];

    // =============================================
    // Constraint Annotations
    // =============================================

    // Constraint nodes (diamond shape)
    node [
        shape=diamond,
        fillcolor="#FDEBD0",
        color="#D35400",
        fontsize=9,
        width=1.5,
        height=0.8
    ];

    C_entropy [
        label="ENTROPY\n<= 0.20 nats"
    ];

    C_spectral [
        label="SPECTRAL\nsigma_max <= 0.95"
    ];

    C_huntington [
        label="HUNTINGTON\nPostulates"
    ];

    // Constraint edges
    C_entropy -> GatesRouter [
        style=bold,
        color="#D35400",
        label="enforced",
        dir=both
    ];

    C_entropy -> Output [
        style=bold,
        color="#D35400",
        label="enforced",
        dir=both
    ];

    C_spectral -> CIFGMemory [
        style=bold,
        color="#D35400",
        label="sigma_max(C)",
        dir=both
    ];

    C_spectral -> Expert1 [
        style=bold,
        color="#D35400",
        label="sigma_max(W)",
        dir=both
    ];

    C_spectral -> InductionHeads [
        style=bold,
        color="#D35400",
        label="sigma_max(W_QKV)",
        dir=both
    ];

    C_huntington -> QInterference [
        style=bold,
        color="#D35400",
        label="Boolean lattice",
        dir=both
    ];

    // =============================================
    // Legend
    // =============================================
    subgraph cluster_legend {
        label="Legend";
        style="rounded";
        color="#7F8C8D";
        fontcolor="#7F8C8D";
        fontsize=10;

        node [shape=plaintext, fillcolor=white, fontsize=8];

        legend [label=<
            <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
                <TR><TD COLSPAN="2"><B>Edge Styles</B></TD></TR>
                <TR><TD>Solid bold</TD><TD>Primary data flow</TD></TR>
                <TR><TD>Dashed</TD><TD>Routing decisions</TD></TR>
                <TR><TD>Dotted (red)</TD><TD>Memory updates</TD></TR>
                <TR><TD>Bold (orange)</TD><TD>Constraint enforcement</TD></TR>
                <TR><TD COLSPAN="2"><B>Constraints</B></TD></TR>
                <TR><TD>entropy_bound</TD><TD>0.20 nats</TD></TR>
                <TR><TD>lambda_max</TD><TD>0.95</TD></TR>
                <TR><TD>huntington</TD><TD>true (all postulates)</TD></TR>
            </TABLE>
        >];
    }
}