Spaces:
Running
Running
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- README.md +4 -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
|
| 25 |
|
| 26 |
-
|
|
|
|
|
|
|
| 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
|
| 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
|
| 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
|
| 301 |
-
<code>
|
| 302 |
-
<span class="val-emerald">β
Strict O(1)
|
| 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
|
| 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">
|
| 323 |
</div>
|
| 324 |
</div>
|
| 325 |
</div>
|
| 326 |
|
| 327 |
-
<!--
|
| 328 |
<div class="content-card" style="margin-top: 1.5rem;">
|
| 329 |
<div class="card-head">
|
| 330 |
-
<h3>π
|
| 331 |
</div>
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
</div>
|
| 338 |
|
| 339 |
-
<
|
| 340 |
-
|
| 341 |
-
|
| 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>
|