MaduRox commited on
Commit
67081eb
Β·
1 Parent(s): 930e291

feat: deploy Kalpana RIF O(1) Studio with Needle-in-a-Haystack benchmarks, layer architecture, and Swagger API

Browse files
Files changed (2) hide show
  1. README.md +4 -2
  2. index.html +42 -25
README.md CHANGED
@@ -21,9 +21,11 @@ license: apache-2.0
21
 
22
  ## πŸ›οΈ Architecture Overview
23
 
24
- Kalpana RIF replaces standard linear $O(N)$ Key-Value tensor caching in Transformer LLMs with continuous wave interference states governed by:
25
 
26
- $$\Psi(t) = \Psi(t-1) + \kappa \sum_{b=1}^{B} \Big[ \cos(\omega_b t + \phi_b) + i \sin(\omega_b t + \phi_b) \Big] \mathbf{v}_t$$
 
 
27
 
28
  ---
29
 
 
21
 
22
  ## πŸ›οΈ Architecture Overview
23
 
24
+ Kalpana RIF replaces standard linear $O(N)$ Key-Value tensor caching in Transformer LLMs across all 32 hidden layers with proprietary bounded-memory continuous state matrices:
25
 
26
+ - **Drop-in Attention Layer Replacement:** Intercepts Key ($K$) and Value ($V$) states across all attention heads.
27
+ - **Strict $O(1)$ Invariant Footprint:** Preserves constant memory whether processing 2K or 3,000,000 tokens.
28
+ - **Zero Prompt Recomputation:** Instant multi-turn recall with bounded compute cost.
29
 
30
  ---
31
 
index.html CHANGED
@@ -283,7 +283,7 @@
283
  <div class="diagram-arrow">β–Ό</div>
284
 
285
  <div class="diagram-block block-transformer">
286
- <div class="block-title">2. Transformer Hidden Layers ($L = 0 \dots 31$)</div>
287
  <div class="block-desc">Every layer contains Multi-Head Self Attention (32 parallel heads). Each head projects Query ($Q_t$), Key ($K_t$), and Value ($V_t$).</div>
288
 
289
  <!-- Inner Interception Layer -->
@@ -292,14 +292,14 @@
292
 
293
  <div class="interception-grid">
294
  <div class="sub-block">
295
- <strong>Standard KV (Eliminated):</strong>
296
  <code>torch.cat([Buffer_{t-1}, K_t], dim=-2)</code>
297
- <span class="val-rose">❌ O(N) Unbounded VRAM</span>
298
  </div>
299
  <div class="sub-block">
300
- <strong>Kalpana RIF (Active):</strong>
301
- <code>\Psi(t) += \kappa \cos(\omega_b t + \phi_b) \mathbf{v}_t</code>
302
- <span class="val-emerald">βœ… Strict O(1) 6.00 MB</span>
303
  </div>
304
  </div>
305
  </div>
@@ -308,41 +308,58 @@
308
  <div class="diagram-arrow">β–Ό</div>
309
 
310
  <div class="diagram-block block-sweep">
311
- <div class="block-title">3. Holographic Phase Reconstruction & Attention</div>
312
  <div class="block-desc">
313
- When Query attends to context, continuous harmonic frequencies reconstruct $\hat{K}$ and $\hat{V}$ via phase resonance:
314
- $$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{Q \hat{K}^T}{\sqrt{d}}\right) \hat{V}$$
315
  </div>
316
  </div>
317
 
318
  <div class="diagram-arrow">β–Ό</div>
319
 
320
  <div class="diagram-block block-output">
321
- <div class="block-title">4. Autoregressive Output Token</div>
322
- <div class="block-desc">Next token prediction with zero context length recomputation tax.</div>
323
  </div>
324
  </div>
325
  </div>
326
 
327
- <!-- Mathematical Formulation Card -->
328
  <div class="content-card" style="margin-top: 1.5rem;">
329
  <div class="card-head">
330
- <h3>πŸ“ Mathematical Physics Formulation</h3>
331
  </div>
332
- <div style="font-size: 0.95rem; line-height: 1.8; color: var(--text-secondary);">
333
- <p>Let incoming token sequence be represented by embedding vectors $\mathbf{v}_t \in \mathbb{R}^d$ at coordinate $t$. The $O(1)$ continuous state matrix $\Psi \in \mathbb{C}^{B \times d}$ evolves according to:</p>
334
-
335
- <div class="formula-box">
336
- $$\Psi(t) = \Psi(t-1) + \kappa \sum_{b=1}^{B} \Big[ \cos(\omega_b t + \phi_b) + i \sin(\omega_b t + \phi_b) \Big] \mathbf{v}_t$$
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  </div>
338
 
339
- <p>Where:</p>
340
- <ul style="padding-left: 1.5rem; margin-top: 0.5rem;">
341
- <li>$B = 2,048$: Number of continuous harmonic frequency bands.</li>
342
- <li>$\omega_b = \frac{2\pi b}{B}$: Characteristic angular frequency of band $b$.</li>
343
- <li>$\phi_b$: Deterministic phase displacement ensuring orthogonality.</li>
344
- <li>$\kappa = 1.0$: Coupling constant regulating energy distribution.</li>
345
- </ul>
346
  </div>
347
  </div>
348
  </div>
 
283
  <div class="diagram-arrow">β–Ό</div>
284
 
285
  <div class="diagram-block block-transformer">
286
+ <div class="block-title">2. Transformer Hidden Layer Stack ($L = 0 \dots 31$)</div>
287
  <div class="block-desc">Every layer contains Multi-Head Self Attention (32 parallel heads). Each head projects Query ($Q_t$), Key ($K_t$), and Value ($V_t$).</div>
288
 
289
  <!-- Inner Interception Layer -->
 
292
 
293
  <div class="interception-grid">
294
  <div class="sub-block">
295
+ <strong>Standard Transformers KV:</strong>
296
  <code>torch.cat([Buffer_{t-1}, K_t], dim=-2)</code>
297
+ <span class="val-rose">❌ Linear O(N) Unbounded VRAM</span>
298
  </div>
299
  <div class="sub-block">
300
+ <strong>Kalpana RIF Attention Substrate:</strong>
301
+ <code>KalpanaCacheLayer(Past Key-Values)</code>
302
+ <span class="val-emerald">βœ… Strict O(1) Constant Memory</span>
303
  </div>
304
  </div>
305
  </div>
 
308
  <div class="diagram-arrow">β–Ό</div>
309
 
310
  <div class="diagram-block block-sweep">
311
+ <div class="block-title">3. Holographic Phase Reconstruction & Attention Output</div>
312
  <div class="block-desc">
313
+ When Query attends to context, continuous harmonic wave channels reconstruct Key and Value states deterministically for attention synthesis.
 
314
  </div>
315
  </div>
316
 
317
  <div class="diagram-arrow">β–Ό</div>
318
 
319
  <div class="diagram-block block-output">
320
+ <div class="block-title">4. Autoregressive Output Token Generation</div>
321
+ <div class="block-desc">Generates tokens at constant memory footprint with zero context re-transmission overhead.</div>
322
  </div>
323
  </div>
324
  </div>
325
 
326
+ <!-- 32-Layer Stack Visual Diagram Card -->
327
  <div class="content-card" style="margin-top: 1.5rem;">
328
  <div class="card-head">
329
+ <h3>πŸ“ 32-Layer Transformer Stack & O(1) Cache Interception Architecture</h3>
330
  </div>
331
+
332
+ <div style="display: flex; flex-direction: column; gap: 0.8rem;">
333
+ <div style="background: rgba(0, 240, 255, 0.05); border: 1px solid var(--border-cyan); border-radius: 10px; padding: 0.8rem 1.2rem; display: flex; justify-content: space-between; align-items: center;">
334
+ <span style="font-weight: 700; font-size: 0.95rem;">STACK: 32 TRANSFORMER HIDDEN LAYERS (Layer 00 – Layer 31)</span>
335
+ <span class="status-tag tag-pass">ALL 32 LAYERS INTERCEPTED BY KALPANA</span>
336
+ </div>
337
+
338
+ <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem;">
339
+ <div style="background: #090d1a; border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem;">
340
+ <div style="font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); font-weight: 700;">LAYER 00 – 07 (Early Syntax & Tokens)</div>
341
+ <div style="font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem;">32 Attention Heads βž” KalpanaCacheLayer (O(1))</div>
342
+ </div>
343
+
344
+ <div style="background: #090d1a; border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem;">
345
+ <div style="font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); font-weight: 700;">LAYER 08 – 15 (Syntactic & Binding)</div>
346
+ <div style="font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem;">32 Attention Heads βž” KalpanaCacheLayer (O(1))</div>
347
+ </div>
348
+
349
+ <div style="background: #090d1a; border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem;">
350
+ <div style="font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); font-weight: 700;">LAYER 16 – 23 (Semantic Context & Entity)</div>
351
+ <div style="font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem;">32 Attention Heads βž” KalpanaCacheLayer (O(1))</div>
352
+ </div>
353
+
354
+ <div style="background: #090d1a; border: 1px solid var(--border); border-radius: 8px; padding: 0.8rem;">
355
+ <div style="font-family: var(--font-mono); font-size: 0.8rem; color: var(--cyan); font-weight: 700;">LAYER 24 – 31 (Deep Reasoning & Recall)</div>
356
+ <div style="font-size: 0.8rem; color: var(--text-muted); margin-top: 0.3rem;">32 Attention Heads βž” KalpanaCacheLayer (O(1))</div>
357
+ </div>
358
  </div>
359
 
360
+ <div style="background: #080c18; border-radius: 8px; padding: 1rem; font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; border: 1px solid var(--border);">
361
+ <strong>πŸ”’ Proprietary Architecture:</strong> Kalpana RIF replaces the linear KV cache across all layers with proprietary continuous state matrix compilation (International Patent Pending <code>LK/P/1/24089</code>).
362
+ </div>
 
 
 
 
363
  </div>
364
  </div>
365
  </div>