| name | ember-hybrid-snn-llm-architecture |
| description | EMBER (Experience-Modulated Biologically-inspired Emergent Reasoning) - Hybrid cognitive architecture combining Spiking Neural Networks (SNN) with Large Language Models (LLM). SNN serves as persistent associative substrate, LLM as replaceable reasoning engine. Activation: EMBER, hybrid SNN LLM, cognitive architecture, emergent reasoning, spiking neural network LLM, biologically inspired AI. |
EMBER: Hybrid SNN-LLM Cognitive Architecture
Overview
EMBER (Experience-Modulated Biologically-inspired Emergent Reasoning) represents a paradigm shift in cognitive AI architecture. Rather than augmenting LLMs with retrieval tools, EMBER places the LLM as a replaceable reasoning engine within a persistent, biologically-grounded associative substrate implemented as a Spiking Neural Network (SNN).
Key Innovation
Traditional Approach: LLM + Retrieval/RAG tools
EMBER Approach: Persistent SNN substrate + Replaceable LLM reasoning
The SNN determines when to act and what associations to surface, while the LLM selects the action type and generates content.
Architecture Components
1. Spiking Neural Network Substrate (220,000 neurons)
Four-Layer Hierarchical Organization:
Layer 4: Meta-Pattern Layer (highest abstraction)
Layer 3: Category Layer (concept categories)
Layer 2: Concept Layer (semantic concepts)
Layer 1: Sensory Layer (raw input encoding)
Key Features:
- STDP Learning: Spike-timing-dependent plasticity for associative learning
- E/I Balance: Excitatory/inhibitory balance for stable dynamics
- Reward Modulation: Dopamine-like reinforcement signals
- Lateral Propagation: Association chains trigger without external input
2. Text Embedding Encoding
Z-Score Standardized Top-K Population Code:
- Converts text embeddings to sparse spike patterns
- Dimension-independent by construction (works with any embedding size)
- 82.2% discrimination retention across embedding dimensionalities
3. LLM Integration Interface
- Receives triggered associations from SNN
- Generates contextual responses/actions
- Stateless with respect to the substrate (can be swapped)
Implementation
EMBER Architecture
import torch
import torch.nn as nn
import numpy as np
from typing import List, Tuple, Optional
class EMBERArchitecture:
"""
EMBER: Hybrid SNN-LLM Cognitive Architecture
The SNN serves as a persistent associative memory substrate,
while the LLM acts as a stateless reasoning engine.
"""
def __init__(
self,
embedding_dim: int = 384,
num_sensory: int = 50000,
num_concept: int = 100000,
num_category: int = 50000,
num_meta: int = 20000,
llm_backend: str = "gpt-4"
):
self.embedding_dim = embedding_dim
self.layer_sizes = {
'sensory': num_sensory,
'concept': num_concept,
'category': num_category,
'meta': num_meta
}
self.total_neurons = sum(self.layer_sizes.values())
self.snn = HierarchicalSNN(
layer_sizes=list(self.layer_sizes.values()),
embedding_dim=embedding_dim
)
.llm_backend = llm_backend
.learned_weights =
.idle_spike_history = []
() -> torch.Tensor:
z_scores = (embedding - embedding.mean()) / (embedding.std() + )
top_k_indices = np.argsort(np.(z_scores))[-k:]
sensory_pattern = torch.zeros(.layer_sizes[])
step = .layer_sizes[] // k
i, idx (top_k_indices):
start = i * step
end = (i + ) * step
sensory_pattern[start:end] = z_scores[idx]
sensory_pattern = torch.sigmoid(sensory_pattern)
sensory_pattern
(nn.Module):
():
().__init__()
.layer_sizes = layer_sizes
.num_layers = (layer_sizes)
.layers = nn.ModuleList()
i, size (layer_sizes):
.layers.append(SpikingLayer(size))
.ff_weights = nn.ParameterList()
i (.num_layers - ):
w = torch.randn(layer_sizes[i+], layer_sizes[i]) *
.ff_weights.append(nn.Parameter(w))
.lat_weights = nn.ParameterList()
size layer_sizes:
w = torch.randn(size, size) *
w.fill_diagonal_(-)
.lat_weights.append(nn.Parameter(w))
.stdp = STDPModule()
.register_buffer(, )
.register_buffer(, )
() -> [torch.Tensor, [torch.Tensor]]:
batch_size = sensory_input.size()
V = [torch.zeros(batch_size, size) size .layer_sizes]
spikes_history = [[] _ (.num_layers)]
t (num_steps):
t == :
V[] = V[] + sensory_input
layer_spikes = []
i (.num_layers):
s = (V[i] >= ).()
layer_spikes.append(s)
V[i] = V[i] * ( - s)
spikes_history[i].append(s)
i (.num_layers):
dV = -V[i] /
.lat_weights[i] :
lat_input = torch.matmul(layer_spikes[i], .lat_weights[i].t())
dV = dV + lat_input
i > :
ff_input = torch.matmul(layer_spikes[i-], .ff_weights[i-].t())
dV = dV + * ff_input
i < .num_layers - :
ff_output = torch.matmul(layer_spikes[i+], .ff_weights[i])
dV = dV + * ff_output
V[i] = V[i] + dV
output = torch.stack([torch.stack(h).(dim=) h spikes_history])
output, spikes_history
:
():
.A_plus = A_plus
.A_minus = A_minus
.tau_plus = tau_plus
.tau_minus = tau_minus
():
T = pre_spikes.size()
delta_w = torch.zeros_like(weights)
t_post (T):
post_spikes[t_post].() == :
t_pre (T):
pre_spikes[t_pre].() == :
dt = t_post - t_pre
dt > :
factor = .A_plus * np.exp(-dt / .tau_plus)
dt < :
factor = -.A_minus * np.exp(dt / .tau_minus)
:
update = torch.outer(post_spikes[t_post], pre_spikes[t_pre])
delta_w += factor * update
delta_w = delta_w * reward
torch.no_grad():
weights += delta_w
weights.clamp_(-, )
Autonomous Action Triggering
class EMBERController:
"""
Controller for autonomous cognitive behavior via EMBER
"""
def __init__(self, ember: EMBERArchitecture):
self.ember = ember
self.llm = LLMInterface(ember.llm_backend)
self.conversation_count = 0
self.last_action_time = 0
self.idle_start_time = None
def process_message(self, message: str, user_id: str):
"""
Process incoming message and update SNN substrate
"""
embedding = self.llm.get_embedding(message)
spike_pattern = self.ember.encode_embedding(embedding)
activations, spike_history = self.ember.snn.forward(
spike_pattern.unsqueeze(0),
num_steps=10
)
self.ember.snn.stdp.apply_stdp(
weights=self.ember.snn.lat_weights[0],
pre_spikes=spike_history[0],
post_spikes=spike_history[1],
reward=1.0
)
self.conversation_count += 1
triggered_concepts = ._get_triggered_concepts(activations)
triggered_concepts
():
.idle_start_time = time.time()
_ ((duration_hours * )):
noise = torch.randn(, .ember.layer_sizes[]) *
activations, spikes = .ember.snn.forward(noise, num_steps=)
activations[].() > :
triggered = ._get_triggered_concepts(activations)
triggered ._should_act():
._initiate_action(triggered)
() -> []:
concept_activations = activations[]
top_neurons = torch.topk(concept_activations, k=).indices
concepts = []
neuron_idx top_neurons[]:
concept = ._neuron_to_concept(neuron_idx.item())
concept:
concepts.append(concept)
concepts
():
context =
prompt =
response = .llm.generate(prompt)
response
() -> :
.conversation_count >=
Training and Learning
From Clean Start to First Action
Based on paper findings:
- 0 messages: Clean slate, zero learned weights
- 7 exchanges (14 messages): First SNN-triggered LLM action
- 8-hour idle: Demonstrated autonomous contact initiation
Learning Dynamics
def train_ember_interaction(
ember: EMBERArchitecture,
messages: List[Tuple[str, str]],
rewards: List[float]
):
"""
Train EMBER on conversation history
Args:
messages: List of (user, assistant) message pairs
rewards: Reward signal for each exchange
"""
for (user_msg, assistant_msg), reward in zip(messages, rewards):
user_emb = get_embedding(user_msg)
assistant_emb = get_embedding(assistant_msg)
combined_spikes = []
user_pattern = ember.encode_embedding(user_emb)
_, user_spikes = ember.snn.forward(user_pattern.unsqueeze(0), num_steps=5)
combined_spikes.extend(user_spikes)
assistant_pattern = ember.encode_embedding(assistant_emb)
_, assistant_spikes = ember.snn.forward(assistant_pattern.unsqueeze(0), num_steps=5)
combined_spikes.extend(assistant_spikes)
for i in range(len(combined_spikes) - 1):
ember.snn.stdp.apply_stdp(
weights=ember.snn.lat_weights[0],
pre_spikes=combined_spikes[i],
post_spikes=combined_spikes[i+1],
reward=reward
)
Key Results
| Metric | Value | Notes |
|---|
| Embedding retention | 82.2% | Across embedding dimensionalities |
| First autonomous action | 7 exchanges | From clean start |
| Autonomous contact | Yes | After 8-hour idle period |
| Neuron count | 220,000 | Hierarchical organization |
Advantages Over Traditional RAG
| Aspect | RAG | EMBER |
|---|
| Memory | External database | Embedded in SNN substrate |
| When to retrieve | Explicit query | Emergent from dynamics |
| What to retrieve | Similarity-based | Association chains |
| LLM role | Primary + augmented | Reasoning engine only |
| Persistence | Database | Learned weights |
Use Cases
- Personal AI Assistants: Proactive behavior based on learned patterns
- Conversational Agents: Context-aware without explicit context windows
- Cognitive Companions: Long-term relationship building
- Research Tools: Autonomous information surfacing
References
- Paper: "EMBER: Autonomous Cognitive Behaviour from Learned Spiking Neural Network Dynamics in a Hybrid LLM Architecture" (arXiv:2604.12167)
- Author: William Savage, 2026
- Categories: cs.AI, cs.NE
Related Skills
adaptive-spiking-neuron-asn: General spiking neuron designs
dual-timescale-memory-spiking-neuron-astrocyte: Working memory mechanisms
neuro-inspired-memory-ai-agents: Memory systems for AI agents
Last updated: 2026-04-27