You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

🧠 LivingBrain-4D (Optimus Cognitive Architecture V25 Ultra)

Creator & Lead Architect: ZEEMAX
Pair-Programming AI: Antigravity (Google DeepMind)
License: GNU General Public License v3.0 (GNU GPLv3)
Milestone Checkpoint: Step 39,642 (~760 Million Cumulative Ingested Tokens)
Architecture Scale: ~151.43 Million Parameters (Native BFloat16 with FP32 Synaptic Shielding)
Hardware Footprint: 319.91 MB VRAM Flat Across 16k+ Tokens


πŸ“– The Origin Story

Project LivingBrain began with a simple, defiant question:
Why should an artificial intelligence model require an ever-growing memory cache just to remember longer conversations?

In modern Transformers (GPT-4, LLaMA-3), memory explodes linearly with sequence length because of the Key-Value (KV) cache. As context expands, consumer hardware runs out of memory, and multi-million dollar server farms become mandatory.

This project was conceived and built from scratch by an independent **16-year-old student researcher (ZEEMAX)**β€”who started this journey at age 15 on an old dual-core Dell Latitude laptop, experimenting with character-level matrix recurrence directly on CPU.

Without corporate funding, supercomputer clusters, or taking standard transformer shortcuts, the project pushed through months of daily debugging, math refactoring, and numerical collapse crises:

  • The Subword Leap: Eliminated character bottlenecks -> scaled to BPE on Kaggle Dual Tesla T4 GPUs.
  • The Tri-Memory Formulation: Replaced global self-attention with three biological tiers: raw sensory windows, continuous 4D synaptic manifolds, and neocortical Hopfield banks.
  • The Systems Breakthrough: Engineered a 32-Chunked Parallel Associative Scan to eliminate CUDA kernel latency.
  • Cloud Scaling: Scaled onto a dedicated Google Cloud NVIDIA L4 GPU, crossing ~760 Million tokens at Step 39,642.

πŸ“Œ Executive Architecture Summary

LivingBrain-4D is an experimental non-Transformer cognitive architecture designed to overcome the fundamental scalability ceiling of modern Large Language Models: the O(N) KV-Cache memory explosion.

While conventional Transformers require linearly expanding memory to store key-value vectors across expanding token sequences:

KV-Cache Memory = 2 * Layers * Heads * Head_Dim * Sequence_Length * Bytes_per_Param

LivingBrain-4D replaces the global quadratic self-attention matrix with a Tri-Memory Hierarchy and an Intermediate Layer 6 Bicameral Global Workspace (M-GWT).

A bounded-memory neural system can achieve unbounded context reasoning if it:

  1. Separates working memory into specialized temporal tiers (Sensory, Synaptic, Hopfield).
  2. Maintains an O(1) continuous state manifold across infinite horizons.
  3. Deliberates internally in a global latent workspace before emitting language.

🧩 Why "4D"? The 2D+2D Factorized Manifold vs. The Naive 4D Memory Trap

A fundamental question researchers ask is: What does "4D" actually mean, and why doesn't it blow up your GPU memory?

The Naive 4D Trap (Rank-4 Tensor Explosion)

If you naively build a true rank-4 weight tensor in neural memory:

W_naive in R^(d * d * d * d) = d^4 parameters per head

For a modest head dimension of d = 64:

64^4 = 16,777,216 parameters PER SINGLE HEAD

A 12-layer, 12-head model would require over 2.4 Billion parameters just to store the raw matrix, instantly triggering Out-Of-Memory (OOM) crashes and stalling training speed.

The LivingBrain Solution: The Factorized 2D + 2D Manifold

LivingBrain-4D avoids this trap by factorizing the 4D relational space into a dual 2D+2D tensor topology:

Active Synaptic State Tensor Shape: [Batch, Heads, d_mem, d_mem]
  1. The 2D Spatial Plane (Outer-Product Associative Matrix): Inside each head, memory forms a 2D associative outer-product matrix:
    dW = K^T (x) V   --> Shape: [d_mem, d_mem]  (64 x 64)
    
    This captures the 2-way relationship between Token Feature Dimensions and Semantic Value Projections.
  2. The 2D Relational-Channel Plane (Multi-Head Orthogonal Coordination): The ensemble of H = 12 heads across 12 layers forms the orthogonal coordinate translation plane:
    [Layers, Heads] Coordinate Translation Bridge
    
    This captures multi-hop subject-to-object predicate binding across hops.

By coupling the 2D associative outer-product plane with the 2D multi-head coordination plane, LivingBrain-4D captures 4-way hyper-relational interactions (Subject x Predicate x Object x Context-Trajectory) while consuming only O(H * d_mem^2) memory instead of catastrophic O(d^4).

This is the exact reason why the active working state across all 12 layers occupies only 4.172 MB across 16,000+ tokens!


πŸ“Š Empirical Hardware Benchmarks (NVIDIA L4 24GB GPU)

The table below documents live memory telemetry recorded on an NVIDIA L4 GPU during continuous streaming inference across sequence lengths from 512 tokens to 16,384 tokens:

Stream Horizon (Tokens) LivingBrain-4D VRAM (MB) Working State Cache (MB) Standard Transformer KV (MB) Memory Scaling Behavior
512 319.91 MB 4.172 MB 16.50 MB STRICTLY FLAT O(1)
1,024 319.91 MB 4.172 MB 33.00 MB STRICTLY FLAT O(1)
2,048 319.91 MB 4.172 MB 66.00 MB STRICTLY FLAT O(1)
4,096 319.91 MB 4.172 MB 132.00 MB STRICTLY FLAT O(1)
8,192 319.91 MB 4.172 MB 264.00 MB STRICTLY FLAT O(1)
16,384 319.91 MB 4.172 MB 528.00 MB STRICTLY FLAT O(1)

Key Systems Observations:

  1. Bounded Working State: Across all 16,384 tokens, the recurrent working memory state remained strictly locked at 4.172 MB (11 layers of 4D M matrices + 16 workspace slots) with zero allocation growth.
  2. Transformer Divergence: Over the same sequence, a standard Transformer's theoretical KV-cache grows from 16.5 MB to 528.0 MB (+3,100% expansion), while its self-attention activation matrix would require over 35 GB of VRAM.
  3. Hardware Throughput: Steady 1,625 to 2,663 tokens/second sustained on a single NVIDIA L4 Tensor Core GPU.

πŸ›οΈ Tri-Memory Architecture Deep Dive (Mathematical Formulation)

Unlike linear RNNs that compress past context into a single 1D vector h_t in R^d (causing catastrophic interference), each of the 12 master layers in LivingBrain-4D processes input representations through three biologically inspired memory tiers operating in parallel:

[Input Token Stream]
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        TRI-MEMORY MASTER BLOCK                         β”‚
β”‚                                                                        β”‚
β”‚  [Tier 1: Sensory Sliding Window]                                      β”‚
β”‚   β€’ Causal Local Attention Window (W = 128 tokens) with RoPE           β”‚
β”‚   β€’ Exact token-order fidelity & local syntactic binding               β”‚
β”‚                                                                        β”‚
β”‚  [Tier 2: Continuous Recurrent Synaptic Manifold]                      β”‚
β”‚   β€’ 4D Factorized Synaptic Matrix: M_t in R^(H x dm x dm)              β”‚
β”‚   β€’ 32-Chunked Parallel Associative Scan (32x CUDA kernel reduction)   β”‚
β”‚   β€’ Titans Dynamic Neural Surprise Gating (eta, alpha)                 β”‚
β”‚   β€’ FP32 Synaptic Shielding & Frobenius Norm Homeostatic Clamping      β”‚
β”‚                                                                        β”‚
β”‚  [Tier 3: Partitioned Neocortical Hopfield Bank]                       β”‚
β”‚   β€’ 512 Quarantine Slots (High-surprise, unverified episodic facts)    β”‚
β”‚   β€’ 1,536 Semantic Slots (Permanent consolidated associative concepts) β”‚
β”‚   β€’ Dynamic Shannon Attention Entropy Gating (H_norm > 0.65)           β”‚
β”‚                                                                        β”‚
β”‚  [Tri-Branch Dynamic Fusion Gate]                                      β”‚
β”‚   β€’ Softmax gate dynamically blending Tier 1, Tier 2, and Tier 3       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1. Tier 1: Local Causal Sensory Window

Preserves short-term syntactic binding and local grammatical coherence. Given input tokens x, query and key projections are rotary-embedded (RoPE):

Q = RoPE(W_Q * x)
K = RoPE(W_K * x)
V = W_V * x

Attention scores are computed with a causal band-mask restricted to local window W = 128:

Attn_Scores = (Q * K^T) / sqrt(d_mem) + Band_Mask(W=128)
Y_Tier1 = Softmax(Attn_Scores) * V

2. Tier 2: Continuous Recurrent Synaptic Manifold

Maintains continuous associative representations over thousands of tokens in constant O(1) memory.

  • 4D Factorized State Tensor: Each head maintains a synaptic matrix M_t in R^(d_mem x d_mem).
  • Titans Dynamic Surprise Gating: Neural surprise scales the write magnitude, filtering fillers and stopwords:
    g_event = sigmoid(2.0 * W_event * x_t)
    alpha_t = 0.85 + 0.149 * sigmoid(W_alpha * x_t)    [Range: 0.85 to 0.999]
    
  • 32-Chunked Parallel Associative Scan: Sequences are decomposed into chunks of size C = 32. Intra-chunk interactions are computed via a causal decay matrix, while inter-chunk states accumulate recurrently:
    M_c = (Product_t alpha_t) * M_(c-1) + (1 / sqrt(d_mem)) * K_c^T * (V_c * g_event)
    
  • Frobenius Norm Homeostatic Clamping: To prevent runaway numerical expansion across infinite horizons:
    M_c = M_c * min(1.0, beta / ||M_c||_F)             [Homeostatic Threshold: beta = 2.5 * d_mem]
    
  • The FP32 Synaptic Shield: All synaptic updates and state accumulators are strictly maintained in IEEE 754 32-bit floating point (torch.float32), immune to FP16 underflow/overflow.

3. Tier 3: Partitioned Neocortical Hopfield Bank

Acts as a discrete associative memory containing 2,048 slots (512 Quarantine + 1,536 Semantic):

  • Dynamic Shannon Attention Entropy Routing: Evaluates the normalized entropy of Tier 1 attention:
    H(A_t) = - sum_j (A_tj * ln(A_tj + 1e-9))
    H_norm = H(A_t) / ln(min(t, W))
    Gate_entropy = sigmoid(10.0 * (H_norm - 0.65))
    
  • High entropy (H_norm > 0.65, indicating dispersed, uncertain attention) routes queries to the Quarantine Bank (isolated episodic novel facts). Focused attention routes to the Semantic Bank (consolidated knowledge). Top-k associative retrieval (k = 4) returns the memory context Y_Tier3:
    Y_Tier3 = Gate_entropy * Mem_Quarantine + (1.0 - Gate_entropy) * Mem_Semantic
    

4. Tri-Branch Dynamic Fusion Gate

A head-wise learned softmax router dynamically balances the three representations based on input context:

[g1, g2, g3] = Softmax(W_fusion * x_t)               [Per-head 3-way distribution]
Y_fused = g1 * Y_Tier1 + g2 * Y_Tier2 + g3 * Y_Tier3

Layer 6: Bicameral Global Workspace & The Senior Council (M-GWT)

At the midpoint of the network (Layer 6), the model shifts from sensory perception to System 2 Executive Deliberation:

[Input Tokens] ──> [Layers 1-5: Sensory Perception & Synaptic Tracking]
                         β”‚
                         β–Ό
           =============================================
             THE SENIOR COUNCIL (Layer 6 Global Workspace)
           =============================================
             β€’ 16 Latent Workspace Slots (16 x 768)
             β€’ Cross-Attention Sensory Read / Write
             β€’ K=2 Recurrent Latent Deliberation Cycles (JEPA)
             β€’ Epistemic Truth Arbiter (Priors vs Deliberation)
           =============================================
              β”‚                                      β”‚
              β–Ό                                      β–Ό
    [Token Generation]                     [Motor Action Head]
     (Layers 7-12)                          β€’ Speak [Direct Dialogue]
                                            β€’ Python [Math/Code Engine]
                                            β€’ Web Search [Truth Retrieval]
  1. Latent Deliberation (K = 2): Before speaking, 16 workspace slots execute recurrent self-attention and non-linear SwiGLU transition passes entirely in latent space without emitting tokens.
  2. Epistemic Truth Arbiter: Evaluates parametric priors against deliberated context:
    alpha_arbiter = sigmoid(W_arbiter * [prior, deliberated_ctx])
    Synthetic_Output = alpha_arbiter * deliberated_ctx + W_proj * [prior, deliberated_ctx]
    
  3. Deliberation-Conditioned Cognitive Action Head: Evaluates epistemic uncertainty to dynamically route cognitive intent across three modalities:
    • Speak: Conversational dialogue and creative generation.
    • Python: Mathematical calculation, algorithmic deduction, and code execution.
    • Web Search: High-entropy factual queries requiring external epistemic grounding.

βš–οΈ Adversarial Peer Review & System Defense

To maintain scientific integrity, we subject LivingBrain-4D to rigorous peer-review scrutiny, addressing core architectural critiques directly:

πŸ” Critique 1: "Isn't Tier 2 just another linear RNN (like Mamba or RWKV)? Linear associative memories cannot perform non-linear associative recall or in-context induction heads."

  • System Defense: Standard linear RNNs compress past tokens into a 1D vector h in R^d, which inevitably suffers from catastrophic token collision. LivingBrain-4D maintains a 4D factorized outer-product matrix M in R^(H x d_mem x d_mem) (12 x 64 x 64), providing an order-of-magnitude higher capacity. More importantly, Tier 2 does not operate alone: it works in hybrid parallel with Tier 1 (which handles exact non-linear syntactic attention) and Tier 3 (which performs non-linear top-k Hopfield retrieval).

πŸ” Critique 2: "Why did memory spike to 14 GB at 16k tokens in your early benchmark if you claim O(1) constant memory?"

  • System Defense (Transparent Post-Mortem): In early evaluation scripts, Tier 1 used a parallel causal mask across the entire prompt sequence to mirror training backprop. When evaluated as a single monolithic batch tensor at 16,384 tokens, PyTorch materialized a temporary 16k x 16k activation matrix. In real-world streaming inference (Mode 2), tokens enter through a true rolling window (W = 128), locking memory permanently at strictly 319.91 MB VRAM and 4.172 MB state cache across 512 to 16,384 tokens.

πŸ” Critique 3: "Why does the model struggle with one-shot isolated fact recall (e.g., 'My dog is Bingo') after long conversational turns?"

  • System Defense (The Chalkboard vs. Locker Insight): Tier 2 is a continuous associative manifold that accumulates outer-products. While this is ideal for tracking continuous themes and conceptual momentum, it acts like a chalkboard: subsequent assistant response tokens can write over faint 1-shot factual embeddings. In V25 Ultra, Tier 3 Hopfield memory was loaded with static weights with a read-only pass during inference.
    The Version 26 Upgrade: We have engineered a Dynamic Runtime Write Gate into Tier 3 Quarantine slots. High-surprise factual tokens take a direct fast-path from Tier 1 into an isolated Hopfield slot at inference time, completely preventing associative smearing.

πŸ” Critique 4: "Why does the model sometimes output mixed formatting or continue text instead of behaving like a polished chatbot?"

  • System Defense: Step 39,642 is a pure, foundational pre-training base checkpoint that has ingested ~760M tokens of raw frontier corpus. Instruction-following, chat turn discipline, and strict prompt adherence are the domain of Supervised Fine-Tuning (SFT), scheduled once pre-training reaches Step 75,000. Despite having no SFT yet, the Senior Council's cognitive action head already demonstrates emergent cognitive routing.

πŸ§ͺ Multi-Domain Outputs Gallery: Witnessing the Architecture in Action

The samples below are genuine, unedited outputs produced by the architecture at various evolutionary milestones:

1. English Syntax & Narrative Dialogue (Frontier V5/V8 Milestone)

Perplexity dropped from 22,026 down to 28.03 within 800 steps on Kaggle Cloud:

Prompt: "Once upon a time, Lily found a "
LivingBrain-4D Output:
"Once upon a time, Lily found a named Buddy and wanted to do not like your friends. They played with the park, they did it was very happy and went to play outside his mom would not stop. A small, let him cat said 'I am a big so much fun things she decided to the park. She went outside and were best friends than being little girl's dad smiled in her room like a fun day, but happy. A boy and jumped the little bird said: 'I am too much fun things that sharing was so excited to get out of his tail and Dad were playing with the cat. They both..."

2. Emergence of Code, JSON & LaTeX (SmolTalk Shard Transition)

Within 1,000 steps of ingesting technical data, the model autonomously began structuring output into Python classes, JSON schemas, and LaTeX math:

Prompt: "What is our core mission today?"
LivingBrain-4D Output:
Theorem. As we can be explored the main points, they've also have a sense of possibilities for the inequality. To find the dataset of the relationship between the @example. However, but not only used to make the process that the property.", "is_list
self $R the value. It, or "I with your own for you a methods-[1 {"name": these in this is not an ' all of culture to ensure as it's their research and 0. self. For example, or "6 $R the be a tag by(n + 1: The-

3. Cognitive Agency & Epistemic Action Routing (Step 39,642 L4 Telemetry)

Live evaluation of Layer 6 Senior Council cognitive motor actions:

  • Case A: Conversational Greeting

    • Input: "hello"
    • Motor Distribution: 100% Routed to Speak [Direct Conversation]
    • Behavior: The Epistemic Truth Arbiter recognized low parametric surprise and answered directly without invoking external tools.
  • Case B: Scientific / Physics Inquiry

    • Input: "Why does time slow down near a massive black hole?"
    • Motor Distribution: 53.1% Routed to Web Search [Truth Retrieval] (68 / 128 tokens)
    • Behavior: The Epistemic Truth Arbiter detected high parametric entropy and autonomously triggered external truth-retrieval routing rather than hallucinating facts.

πŸš€ The Road Ahead: Conviction & Open Call

We make no wild commercial guarantees, but I carry a deep, unshakeable trust in the physics of this architecture. With relentless iteration and first-principles engineering, this system will succeed.

What Comes Next:

  1. Crossing 1.0 Billion Cumulative Tokens: Pushing through Step 50,000 toward the 75,000-step pre-training milestone.
  2. Tier 3 Dynamic Runtime Write Gates (V26 Ultra): Enabling isolated one-trial episodic fact locking without decay.
  3. Instruction Alignment (SFT): Fine-tuning on conversational task pairs to achieve sharp instruction adherence.
  4. Context Horizon Expansion: Scaling verification beyond 32,000 to 64,000 tokens on consumer hardware.

"If you are a student, researcher, or engineer who believes AI should run with human-like memory efficiency on everyday hardware, you are warmly invited to collaborate, test, or contribute."

πŸ“¬ Contact & Research Inquiries

For research collaboration, independent replication, academic access requests, or licensing:


πŸ”’ Gated Access & Evaluation Protocol

This repository is Gated with Manual Approval. Anyone on the internet can read this documentation and inspect the benchmarks. However, access to the raw model weights (living_brain_v25_step39642.pt) requires manual author approval.

To Request Access:

  1. Log in to your Hugging Face account.
  2. Click "Request Access" above.
  3. Once approved by the author (ZEEMAX), you can load the model directly in Python:
from huggingface_hub import hf_hub_download
import torch

# 1. Download checkpoint
model_file = hf_hub_download(
    repo_id="ZEEMAX/LivingBrain4D",
    filename="living_brain_v25_step39642.pt",
    token="YOUR_HF_TOKEN"
)

# 2. Inspect checkpoint structure
checkpoint = torch.load(model_file, map_location="cpu", weights_only=False)
print("Restored Step:", checkpoint.get("step"))
print("Parameter Tensors:", len(checkpoint.get("model_state_dict", {})))

πŸ“œ Intellectual Property & License

Copyright (c) 2026 ZEEMAX.

This project is licensed under the GNU General Public License v3.0 (GPLv3).

  • You are free to inspect, research, and replicate this architecture for academic and open-source purposes.
  • Any derivative works or extensions must remain open-source under GPLv3.
  • Proprietary, closed-source, or commercial deployments require an explicit commercial license from the author (Dual-Licensing Model).
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support