Bilinear gating methodology linking dendritic coincidence detection to motor primitive encoding. Burst fraction encodes goal information selectively, bilinear gate G(g)·Y(s) enables zero-shot generalization in RL agents. Activation: bilinear gating, motor primitives, dendritic computation, burst fraction, goal-directed adaptation, coincidence detection, motor cortex, reinforcement learning agent.
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill bilinear-gating-motor-primitives-dendritic-computation --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Bilinear Gating Motor Primitives Dendritic Computation?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-bilinear-gating-motor-primitives-dendritic-computa-ai-collection)More formats (shields.io, HTML) on the badges page.
---
name: bilinear-gating-motor-primitives-dendritic-computation
description: "Bilinear gating methodology linking dendritic coincidence detection to motor primitive encoding. Burst fraction encodes goal information selectively, bilinear gate G(g)·Y(s) enables zero-shot generalization in RL agents. Activation: bilinear gating, motor primitives, dendritic computation, burst fraction, goal-directed adaptation, coincidence detection, motor cortex, reinforcement learning agent."
category: neuroscience
---
## Context
**arXiv Paper**: [2606.10891](https://arxiv.org/abs/2606.10891) - Bilinear gating of motor primitives: a principle linking dendritic computation to rapid goal-directed adaptation
**Authors**: Cristiano Capone, Luca Falorsi, Andrea Ciardiello, Luca Manneschi
**Submitted**: 2026-06-09
**Core Discovery**: Movement requires motor cortex to specify both **what** action to produce and **which goal** it serves. The **burst fraction** (proportion of spikes in high-frequency bursts) encodes reach direction far more selectively than overall firing rate. This dissociation is consistent across 12 recording sessions spanning 3 animals and 2 laboratories (all p<10^-12).
**Key Innovation**: Goal information is concentrated specifically in bursts via dendritic coincidence detection. When goal-related apical input coincides with state-related basal drive, the neuron bursts — computing the product G(g)·Y(s), a **bilinear gate**.
## Core Methodology
### 1. Burst Fraction Encoding Analysis
**Problem**: How does motor cortex separate action specification (what) from goal selection (which)?
**Solution**: Measure burst fraction vs. firing rate:
- **Burst fraction** = proportion of spikes emitted in high-frequency bursts
- **Firing rate** = total spike count over time window
- Compare selectivity for reach direction encoding
**Validation**:
- 12 recording sessions, 3 animals, 2 independent laboratories
- Statistical significance: p<10^-12 for all sessions
- Firing rate controls to isolate burst-specific encoding
### 2. Dendritic Coincidence Detection Mechanism
**Two-Compartment Model**:
```
Neuron compartments:
1. Apical dendrite: receives goal-related input G(g)
2. Basal dendrite: receives state-related drive Y(s)
Coincidence detection:
- When G(g) ∩ Y(s) → neuron bursts
- Burst probability = G(g) · Y(s) (bilinear gate)
```
**Cellular Implementation**:
- Layer-5 pyramidal neurons in motor cortex
- Apical inputs carry goal information (cortical feedback)
- Basal inputs carry state information (sensorimotor drive)
- Burst occurs when both coincide → multiplicative gating
### 3. Spiking Model Implementation
**Minimal Two-Compartment Model**:
```python
class BilinearGatedNeuron:
def __init__(self):
self.apical_compartment = 0 # Goal input
self.basal_compartment = 0 # State input
self.threshold = 1.0
def update(self, goal_signal, state_signal):
# Apical input integration
self.apical_compartment += goal_signal
# Basal input integration
self.basal_compartment += state_signal
# Bilinear gating: coincidence detection
coincidence = self.apical_compartment * self.basal_compartment
# Burst when coincidence exceeds threshold
if coincidence > self.threshold:
return 'burst', coincidence
else:
return 'regular_spike', coincidence
```
### 4. Reinforcement Learning Agent Integration
**Zero-Shot Generalization**:
```python
class BilinearGatedRLAgent:
def __init__(self, n_goals, n_states):
self.goal_encoder = GoalEncoder(n_goals)
self.state_encoder = StateEncoder(n_states)
self.bilinear_gate = BilinearGatedNeuron()
def select_action(self, goal, state):
g = self.goal_encoder.encode(goal)
s = self.state_encoder.encode(state)
# Bilinear gate computes goal-state product
burst_type, activation = self.bilinear_gate.update(g, s)
if burst_type == 'burst':
# Goal-directed action selection
action = self.goal_policy(goal, state)
else:
# Default action selection
action = self.default_policy(state)
return action
def adapt_online(self, new_goal):
# Rapid adaptation: update goal encoder only
self.goal_encoder.add_goal(new_goal)
# State encoder unchanged → zero-shot generalization
```
**Computational Advantage**:
- Segregating goal information into bursts enables rapid online adaptation
- New goals require only goal encoder update, not full policy retraining
- Zero-shot generalization: same bilinear gate works for unseen goal-state combinations
## Implementation Steps
### Step 1: Burst Fraction Analysis Pipeline
```python
def compute_burst_fraction(spike_train, burst_threshold=50):
"""
Compute burst fraction from spike train
Args:
spike_train: array of spike times (ms)
burst_threshold: ISI threshold for burst definition (ms)
Returns:
burst_fraction: proportion of spikes in bursts
"""
import numpy as np
# Compute inter-spike intervals (ISIs)
isis = np.diff(spike_train)
# Identify bursts: consecutive spikes with ISI < threshold
burst_mask = isis < burst_threshold
# Count spikes in bursts
total_spikes = len(spike_train)
burst_spikes = np.sum(burst_mask) + 1 # +1 for burst initiation spike
burst_fraction = burst_spikes / total_spikes
return burst_fraction
```
### Step 2: Goal Selectivity Analysis
```python
def analyze_goal_selectivity(spike_data, reach_directions):
"""
Compare burst fraction vs. firing rate selectivity
Args:
spike_data: dict {direction: spike_train}
reach_directions: list of reach directions
Returns:
selectivity_metrics: {metric: {direction: value}}
"""
import numpy as np
from scipy.stats import f_oneway
burst_fractions = {}
firing_rates = {}
for direction in reach_directions:
spikes = spike_data[direction]
# Burst fraction
burst_fractions[direction] = compute_burst_fraction(spikes)
# Firing rate (spikes/sec)
duration = (spikes[-1] - spikes[0]) / 1000 # Convert to seconds
firing_rates[direction] = len(spikes) / duration
# ANOVA test for selectivity
bf_values = list(burst_fractions.values())
fr_values = list(firing_rates.values())
f_bf, p_bf = f_oneway(*[spike_data[d] for d in reach_directions])
f_fr, p_fr = f_oneway(*[spike_data[d] for d in reach_directions])
return {
'burst_fraction': {'f_stat': f_bf, 'p_value': p_bf, 'values': burst_fractions},
'firing_rate': {'f_stat': f_fr, 'p_value': p_fr, 'values': firing_rates}
}
```
### Step 3: Bilinear Gate Network
```python
import torch
import torch.nn as nn
class BilinearGateLayer(nn.Module):
"""
Neural network layer implementing bilinear gating
"""
def __init__(self, goal_dim, state_dim, hidden_dim=64):
super().__init__()
self.goal_proj = nn.Linear(goal_dim, hidden_dim)
self.state_proj = nn.Linear(state_dim, hidden_dim)
self.gate_threshold = nn.Parameter(torch.tensor(1.0))
def forward(self, goal_input, state_input):
# Project goal and state
g = self.goal_proj(goal_input)
s = self.state_proj(state_input)
# Bilinear gate: element-wise product
coincidence = g * s
# Burst activation: ReLU with threshold
burst_activation = torch.relu(coincidence - self.gate_threshold)
return burst_activation, coincidence
```
### Step 4: Motor Primitive RL Agent
```python
class MotorPrimitiveAgent:
"""
RL agent using bilinear gating for motor primitives
"""
def __init__(self, n_goals, n_states, n_actions):
self.goal_encoder = nn.Embedding(n_goals, 32)
self.state_encoder = nn.Linear(n_states, 32)
self.bilinear_gate = BilinearGateLayer(32, 32, 64)
self.action_head = nn.Linear(64, n_actions)
def forward(self, goal_id, state_vector):
# Encode goal and state
goal_emb = self.goal_encoder(goal_id)
state_emb = self.state_encoder(state_vector)
# Bilinear gate
burst_activation, coincidence = self.bilinear_gate(goal_emb, state_emb)
# Action selection
action_logits = self.action_head(burst_activation)
return action_logits, burst_activation
def adapt_to_new_goal(self, new_goal_id, n_episodes=10):
"""
Rapid online adaptation: fine-tune goal encoder only
"""
# Freeze state encoder and action head
for param in self.state_encoder.parameters():
param.requires_grad = False
for param in self.action_head.parameters():
param.requires_grad = False
# Train goal encoder for new goal
optimizer = torch.optim.Adam(self.goal_encoder.parameters(), lr=0.01)
for episode in range(n_episodes):
# Quick adaptation episodes
loss = self._train_episode(new_goal_id)
optimizer.step()
# Unfreeze all parameters
for param in self.parameters():
param.requires_grad = True
```
## Pitfalls
### 1. Burst Definition Variability
**Problem**: Burst threshold varies across neuron types and recording conditions.
**Solution**: Use adaptive threshold based on ISI distribution:
```python
def adaptive_burst_threshold(spike_train):
isis = np.diff(spike_train)
threshold = np.percentile(isis, 10) # Use 10th percentile ISI
return threshold
```
### 2. Firing Rate-Burst Fraction Confound
**Problem**: High firing rate neurons naturally produce more bursts.
**Solution**: Normalize burst fraction by firing rate:
```python
normalized_bf = burst_fraction / (firing_rate ** 0.5)
```
### 3. Goal-State Ambiguity
**Problem**: In complex tasks, goal and state signals may overlap.
**Solution**: Use temporal separation — goal signals precede movement initiation:
```python
# Separate goal epoch (pre-movement) from state epoch (movement)
goal_window = spikes[-500:-200] # Pre-movement
state_window = spikes[-200:] # Movement
```
### 4. RL Agent Overfitting to Goal Encoder
**Problem**: Agent becomes dependent on specific goal encoder representations.
**Solution**: Use dropout in goal encoder during adaptation:
```python
self.goal_encoder = nn.Sequential(
nn.Embedding(n_goals, 32),
nn.Dropout(0.3) # Prevent overfitting
)
```
## Verification
### 1. Burst Fraction Selectivity Test
```python
# Generate synthetic spike trains for different goals
spike_data = {
'goal_1': generate_spikes(burst_fraction=0.8),
'goal_2': generate_spikes(burst_fraction=0.3),
}
results = analyze_goal_selectivity(spike_data, ['goal_1', 'goal_2'])
assert results['burst_fraction']['p_value'] < 0.01 # Significant selectivity
```
### 2. Bilinear Gate Output Test
```python
gate = BilinearGateLayer(32, 32)
g = torch.randn(32)
s = torch.randn(32)
burst_activation, coincidence = gate(g, s)
assert torch.all(burst_activation >= 0) # Non-negative activation
assert torch.allclose(coincidence, g * s) # Bilinear product
```
### 3. RL Agent Zero-Shot Test
```python
agent = MotorPrimitiveAgent(n_goals=10, n_states=100, n_actions=5)
# Train on goals 1-9
train_agent(agent, goal_ids=[1,2,3,4,5,6,7,8,9])
# Test zero-shot on goal 10
action, burst = agent.forward(goal_id=10, state_vector=test_state)
assert action is not None # Agent generalizes to unseen goal
```
## Key Results
- **Burst fraction selectivity**: p<10^-12 across 12 sessions, 3 animals, 2 labs
- **Firing rate controls**: Goal encoding survives firing rate removal → burst-specific
- **Two-compartment model**: Reproduces burst fraction effect
- **RL agent**: Zero-shot generalization to new goals, rapid online adaptation
## Theoretical Implications
1. **Dendritic Computation**: Layer-5 pyramidal neurons implement bilinear gating via dendritic coincidence detection
2. **Motor Primitive Encoding**: Burst fraction encodes goal-specific motor primitives separately from action execution
3. **Learning Advantage**: Segregating goal information into bursts enables rapid adaptation without full policy retraining
4. **Neural Decoding**: Burst fraction provides more selective goal information than firing rate
## Practical Applications
- **BCI systems**: Rapid recalibration to new goals using bilinear gating
- **Motor rehabilitation**: Goal-directed adaptation for movement recovery
- **Robotics**: Motor primitive learning with online adaptation
- **Neural prosthetics**: Goal-specific action selection
## References
- Paper: arXiv:2606.10891
- Related: Dendritic coincidence detection, motor cortex burst coding, RL zero-shot generalization
- Keywords: bilinear gating, motor primitives, dendritic computation, burst fraction, goal-directed adaptationIs this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!