21 KiB
Table of Contents
include_toc
| include_toc |
|---|
| true |
Intro
Description of the pseudocode.
Global state: what each compartment tracks
The three compartments maintain distinct but coupled state variables across three time horizons.
At the fast scale:
- the presynapse tracks residual calcium and its readily-releasable vesicle pool — both of which encode the very recent history of firing.
- the postsynapse tracks membrane voltage and the amplitude and speed of its calcium rise, which together encode the instruction for future change.
- the astrocyte tracks glutamate concentration both inside and outside the cleft, its own local and global calcium state, and its fuel output.
At the intermediate scale, the shared signal layer tracks whether the mGluR overflow sensors have fired, and whether the neuromodulatory context gate has been set — specifically whether PKA has primed the AMPA insertion machinery, silenced the forgetting phosphatase, and enabled gene expression in the nucleus.
At the slow scale, all three compartments track their own physical architecture:
- the postsynapse its receptor count and spine size
- the presynapse its docking slot count and vesicle channel clustering
- the astrocyte its wall distance from the synapse, its matrix density, and its baseline co-agonist supply.
Fast scale: what happens spike by spike
Every action potential sets off a precise sequence across all three compartments simultaneously.
The presynapse converts the electrical event into a chemical wavefront: calcium floods in, drives probabilistic vesicle release from the readily-releasable pool, and leaves a residual trace that biases the next release upward if spikes keep arriving and downward if they stop. The amount of glutamate released fills the cleft and begins diffusing outward.
The astrocyte responds in two parallel arms the moment glutamate spills beyond the cleft boundary. The first arm activates astrocytic mGluR5 receptors via a Gq cascade, triggering an internal calcium rise that is directly proportional to how much glutamate has escaped — this calcium rise drives D-serine release, widening the postsynaptic NMDA detection window. The second arm simultaneously activates presynaptic mGluR2/3 receptors via Gi, suppressing adenylyl cyclase and reducing vesicle release probability — a direct autoinhibitory brake on the very source of the overflow. These two arms run in opposite directions from the same trigger: the astrocyte brakes the presynapse while amplifying the postsynaptic learning window at the same time. The functional logic of this arrangement is also worth noting. At the moment of spillover, the synapse is already releasing at high volume — the presynapse does not need to be told to release more, it needs to be prevented from exhausting itself. Simultaneously, the postsynapse is receiving a large wavefront and is exactly the right moment to maximize its coincidence detection sensitivity. The push-pull architecture serves both needs with a single signal, without requiring any separate coordination mechanism.
The postsynapse responds to the glutamate wavefront through its AMPA receptors, depolarizing the membrane. But full calcium entry through NMDA receptors only occurs if two conditions are met simultaneously: the membrane must be sufficiently depolarized to eject the magnesium block, and D-serine released by the astrocyte must be present as a co-agonist. This is the coincidence detection step — both conditions are required, and the astrocyte's D-serine supply is what makes it a three-party coincidence rather than a two-party one.
Once the spike is complete, the astrocyte vacuums up residual glutamate via its transporter proteins, and the harder it works at this clearance the faster it runs its glycolysis engine, converting blood glucose into lactate and pumping it into the extracellular space. Both the presynapse and postsynapse absorb this lactate to power their reset pumps — refilling the vesicle pool and restoring the resting membrane potential respectively. The energy supply is therefore coupled to activity: busier synapses generate more demand on the astrocyte, which in turn fuels faster recovery.
Intermediate scale: temporary tuning between spikes
If firing is sustained rather than isolated, the system begins temporary adjustments that do not yet commit to structural change. In the presynapse, sustained high-frequency firing keeps residual calcium elevated, progressively increasing release probability and mobilizing vesicles from deep reserve storage into the readily-releasable pool — a priming of the launchpad without permanently expanding it. If frequency is low and sparse, the reverse happens: the pool depletes faster than it refills and release probability falls.
In the postsynapse, sustained high-frequency input keeps the membrane depolarized long enough to hold the magnesium block off continuously, allowing calcium to accumulate gradually rather than in isolated pulses. This accumulation is the early signal for plasticity, but it is not yet sufficient on its own to commit a structural change.
In the astrocyte, sustained activity keeps mGluR5 activated and D-serine release elevated above its baseline pulse level, maintaining a wider NMDA detection window for as long as the high-frequency drive continues.
The neuromodulatory broadcast then sets the critical context gate. If dopamine or norepinephrine levels cross their respective thresholds — signaling that the current activity pattern is behaviorally significant — PKA activity rises and phosphorylates three targets in sequence. It lowers the threshold for AMPA receptor insertion by priming the GluA1 subunit at Ser845. It silences the LTD phosphatase PP1 by phosphorylating DARPP-32, effectively blocking the forgetting machinery from running while the save signal is present. And it translocates to the nucleus to phosphorylate CREB, enabling the gene expression needed to build new structural proteins. Acetylcholine from the basal forebrain acts in parallel, lowering the global LTP threshold — making the entire system more sensitive to incoming patterns during periods of high attention.
Slow scale: the commit decision and structural rewriting
Once the fast and intermediate dynamics have run, the system evaluates a three-layer filter to decide whether to permanently rewrite its architecture. The first layer asks whether a genuine event occurred — specifically whether postsynaptic calcium rose above the high threshold at sufficient speed to activate the LTP kinase pathway. The second layer asks whether that event was excessive enough to saturate the cleft and trigger mGluR5 on the astrocyte. The third layer asks whether the neuromodulatory context validated the event as worth saving — whether PKA has primed the insertion machinery and silenced the forgetting machinery.
Only when all three conditions align does structural rewriting proceed, and when it does, all three compartments are rewritten simultaneously and in the same direction.
In the potentiation branch, the postsynapse anchors new AMPA receptors into the membrane via CaMKII — a process made easier because PKA has already lowered the insertion threshold — and the spine itself physically enlarges. The presynapse expands its active zone, clusters more calcium channels directly beneath the docking area to tighten the coupling between electrical events and vesicle release, and increases its baseline release probability. The astrocyte retracts its process walls inward toward the synapse, secretes structural matrix proteins to seal and stabilize the channel, upregulates its baseline D-serine synthesis for chronic NMDA priming, and reduces its glutamate clearance rate — meaning future signals will linger longer in the cleft rather than being vacuumed away immediately.
In the depression branch, the phosphatase PP1 wins instead of CaMKII, and all three changes run in reverse simultaneously. The postsynapse internalizes receptors and the spine shrinks. The presynapse removes docking slots, scatters its calcium channels away from the active zone, and pulls vesicles back into deep reserve storage. The astrocyte secretes matrix metalloproteinases to dissolve the structural scaffold, cuts its D-serine supply to starve the NMDA gate chronically, and extends its process walls outward away from the synapse, loosening the diffusion barrier so that future glutamate bleeds away faster rather than concentrating at the cleft.
If the calcium event occurred but the neuromodulatory save signal did not arrive, only transient changes happen — early receptor insertion and brief facilitation — both of which reverse within minutes without trace. If no threshold was crossed at all, nothing changes and the current structural state is simply held.
The critical asymmetry
The astrocyte's perisynaptic wall distance is the variable that makes both outcomes self-reinforcing rather than merely additive. When it moves inward during potentiation, it concentrates glutamate at the cleft, maintains D-serine near the postsynapse, and tightens the presynaptic feedback loop — making future high-frequency events even more likely to cross the threshold. When it moves outward during depression, it dilutes the signal, starves the NMDA gate, and loosens the presynaptic feedback — making future events even less likely to reach threshold. The astrocyte therefore does not simply mirror what the neurons decide: it actively deepens the valley the synapse has already rolled into, in whichever direction that happens to be.
Pseudocode
## global state variables
// ── Fast (ms–s): wave propagation ─────────────────────────────
// Presynapse
pre_Ca_residual // leftover Ca²⁺ between spikes — short-term trace
vesicle_release_prob // P(0.1–1.0) per docking slot
RRP_pool // readily-releasable vesicle pool
reserve_pool // chained vesicles in deep storage
// Postsynapse
membrane_potential // Vm — depolarization state
NMDA_Mg_block // bool — mechanical clamp on/off
post_Ca_amplitude // peak [Ca²⁺] rise in spine
post_Ca_rise_speed // d(Ca)/dt — fast=LTP signal, slow=LTD signal
// Astrocyte
glutamate_cleft // [glu] in synaptic cleft
glutamate_spillover // extrasynaptic [glu] — saturates mGluRs
astro_Ca_local // IP3-triggered local rise near synapse
astro_Ca_global // soma-wide wave — network overload flag
D_serine_release // gliotransmitter — NMDA co-agonist pulse
lactate_output // fuel export rate to pre and post
// ── Intermediate (s–min): temporary tuning ────────────────────
mGluR2_3_activation // presynaptic Gi — autoinhibitory brake
mGluR5_activation // astrocytic Gq — IP3→Ca²⁺→D-serine cascade
cAMP_level // set by dopamine/NE via Gs → adenylyl cyclase
PKA_activity // downstream of cAMP
GluA1_Ser845_primed // bool — AMPA insertion threshold lowered by PKA
DARPP32_phospho // bool — PP1 (LTD phosphatase) silenced by PKA
CREB_active // bool — structural gene expression enabled
// ── Slow (h–weeks): structural architecture ───────────────────
AMPA_count // surface receptors — postsynaptic sensitivity
spine_volume // physical size of dendritic spine
active_zone_size // docking slot count
RRP_pool_capacity // max readily-releasable pool
VGCC_clustering // Ca²⁺ channels beneath active zone
perisynaptic_distance // how close astrocyte walls are to synapse
ECM_integrity // extracellular matrix density
D_serine_tonic_level // baseline co-agonist supply (sustained)
glutamate_clearance_rate // EAAT transporter density
## fast time scale — wave propagation (ms → s)
function fire_action_potential(input_freq):
// Presynapse: launch wavefront
pre_Ca_residual += spike_influx(input_freq)
pre_Ca_residual *= decay(τ ≈ 100ms) // fades unless spikes keep arriving
vesicle_release_prob *= facilitation(pre_Ca_residual)
released_vesicles = binomial(RRP_pool, vesicle_release_prob)
glutamate_cleft = released_vesicles × quantal_content
RRP_pool -= released_vesicles
// Astrocyte: overflow sensing and co-agonist release
glutamate_spillover = extrasynaptic_diffusion(glutamate_cleft)
if glutamate_spillover > spillover_threshold:
mGluR5_activation = True // Gq arm → IP3 → Ca²⁺ → D-serine
astro_Ca_local += IP3_cascade(PLC)
D_serine_release += proportional_to(astro_Ca_local)
mGluR2_3_activation = True // Gi arm → brake presynapse
cAMP_level -= Gi_inhibition(adenylyl_cyclase)
vesicle_release_prob -= VGCC_suppression() // autoinhibitory brake
// Astrocyte: check for network overload
astro_Ca_global = soma_wave(astro_Ca_local > OVERLOAD_threshold)
if astro_Ca_global: trigger(shockwave_lockdown)
// Postsynapse: wavefront strikes resonator
AMPA_current = glutamate_cleft × AMPA_count
membrane_potential += AMPA_current
// NMDA gate: coincidence check
if membrane_potential > -40mV and D_serine_release > threshold:
NMDA_Mg_block = False // Mg²⁺ ejected
post_Ca_amplitude += NMDA_influx(glutamate_cleft)
post_Ca_rise_speed = d(post_Ca_amplitude) / dt
// Astrocyte: vacuum trailing echoes + fuel pipeline
glutamate_cleft -= glutamate_clearance_rate × Δt
lactate_output += glycolysis_rate(glutamate_clearance_rate)
membrane_potential restored by NaK_ATPase(lactate_output)
RRP_pool refilled by VATPase(lactate_output)
## intermediate time scale — temporary tuning (s → min)
function short_term_plasticity(input_freq, duration):
// Presynapse: facilitate or depress based on Ca²⁺ history
if input_freq > 20Hz:
vesicle_release_prob *= 1.3 // residual Ca²⁺ primes launchpad
mobilize(reserve_pool → RRP_pool) // break storage chains
elif input_freq < 5Hz:
vesicle_release_prob *= 0.7 // RRP depleted faster than refill
// Postsynapse: NMDA gate primed if frequency sustained
if input_freq >= 50Hz and duration > 1s:
NMDA_Mg_block = False // sustained depolarization
post_Ca_amplitude accumulates // early-LTP signal rises
// Astrocyte: sustained volume → escalate co-agonist
if astro_Ca_local > local_threshold:
D_serine_release += gliotransmitter_pulse() // widens NMDA window
// Neuromodulators: set context gate via Gs protein
if dopamine_level > D1_threshold or NE_level > β_threshold:
cAMP_level += Gs_activation(adenylyl_cyclase)
PKA_activity = proportional_to(cAMP_level)
phosphorylate(GluA1, site=Ser845)
GluA1_Ser845_primed = True // lowers CaMKII threshold
phosphorylate(DARPP32)
DARPP32_phospho = True // silences PP1 — blocks LTD
translocate(PKA → nucleus) → phosphorylate(CREB)
CREB_active = True // enables structural gene expression
// Acetylcholine: lower LTP threshold globally
LTP_threshold *= (1 / (1 + ACh_level × mAChR_gain))
## slow time scale — structural commit (h → weeks)
function commit_to_structural_change():
// Hierarchical filter: three conditions must align
event_detected = post_Ca_amplitude > Ca_HIGH // layer 1: did something happen?
overflow_sensed = mGluR5_activation == True // layer 2: was it excessive?
context_validated = DARPP32_phospho and GluA1_Ser845_primed // layer 3: worth saving?
// ── Branch 1: LTP — potentiation ──────────────────────────────
if event_detected and overflow_sensed and context_validated:
// Postsynapse: anchor receptors, enlarge spine
activate(CaMKII)
AMPA_count += receptor_insertion(CaMKII, GluA1_Ser845_primed)
spine_volume *= 1.5
// Presynapse: expand launchpad, increase output reliability
active_zone_size *= 1.4 // more docking slots
RRP_pool_capacity += pool_expansion(active_zone_size)
VGCC_clustering += cluster_beneath_AZ() // tighter Ca²⁺ coupling
vesicle_release_prob += 0.1 // driven by VGCC clustering
// Astrocyte: seal and insulate the channel
perisynaptic_distance -= process_retraction() // walls move IN → tighter wrap
ECM_integrity += secrete(Glypicans, Thrombospondins)
D_serine_tonic_level += upregulate_synthesis() // sustained NMDA priming
glutamate_clearance_rate *= 0.85 // tighter wrap → slower diffusion away
return "potentiated"
// ── Branch 2: temporary only — Ca²⁺ rose, no save signal ─────
elif event_detected and not context_validated:
AMPA_count += transient_insertion() // early-LTP only — reverses in minutes
vesicle_release_prob += transient_facilitation()
// No astrocyte structural change
return "temporary facilitation only"
// ── Branch 3: LTD — active forgetting ─────────────────────────
elif event_detected and not overflow_sensed and not context_validated:
// Postsynapse: internalize receptors, shrink spine
activate(PP1)
AMPA_count -= receptor_internalization(PP1)
spine_volume *= 0.7
// Presynapse: dismantle launchpad
active_zone_size -= docking_slot_removal()
RRP_pool_capacity -= pool_contraction()
VGCC_clustering -= scatter_VGCCs() // decouple Ca²⁺ from AZ
vesicle_release_prob *= 0.6
// Astrocyte: dissolve matrix, pull away, cut support
ECM_integrity -= secrete(MMPs) // molecular scissors
D_serine_tonic_level = 0 // co-agonist supply cut
perisynaptic_distance += process_extension() // walls move OUT → loose wrap
glutamate_clearance_rate *= 1.2 // looser wrap → faster spillover
return "depressed"
// ── Branch 4: baseline ────────────────────────────────────────
else:
// All structural variables unchanged — system holds current state
return "baseline — no change"
## special case — shockwave lockdown (>100Hz uncoordinated)
function shockwave_lockdown():
astro_Ca_global = GLOBAL_WAVE // soma-level flood
release(GABA, ATP) // gel floods postsynapse
AMPA_count -= mass_internalization()
membrane_potential = HYPERPOLARIZED
cluster(VGCC → beneath_active_zone) // ensures signal survives chaos
## energy supply chain — metabolic gating (continuous)
function metabolic_loop(Δt):
// Astrocyte: glucose → lactate pipeline
glucose_uptake = blood_capillary_supply()
lactate_output = glycolysis(glucose_uptake, glutamate_clearance_rate)
lactate_output *= load_factor(glutamate_clearance_rate)
// Pre + post absorb lactate → power their pumps
RRP_pool refill rate ∝ VATPase(lactate_output)
membrane_potential reset ∝ NaK_ATPase(lactate_output)
## key asymmetry — perisynaptic distance is bidirectional
// LTP: astrocyte moves IN → tighter diffusion barrier
// → glutamate_clearance_rate ↓ (signal contained, not diluted)
// → D_serine_tonic_level ↑ (NMDA gate chronically primed)
// LTD: astrocyte moves OUT → looser diffusion barrier
// → glutamate_clearance_rate ↑ (signal bleeds away faster)
// → D_serine_tonic_level = 0 (NMDA gate chronically starved)
// Result: astrocyte amplifies both directions simultaneously
// potentiation becomes self-reinforcing; depression becomes self-reinforcing
Neuromodulators
These are produced by small, anatomically concentrated nuclei that broadcast widely across the brain:
dopamine_level // "save button" — validates LTP norepinephrine_level // arousal / signal-to-noise gain acetylcholine_level // attention — lowers LTP threshold
Dopamine
Dopamine is produced primarily by neurons in the Substantia Nigra pars compacta (projecting to the striatum, relevant for motor learning and habit formation) and the Ventral Tegmental Area (VTA) (projecting to the prefrontal cortex and limbic system via the mesolimbic and mesocortical pathways, relevant for reward, motivation, and the "save button" function in your model).
Norepinephrine
Norepinephrine is produced almost exclusively by the Locus Coeruleus, a tiny nucleus in the brainstem pons. Despite its small size it projects diffusely across virtually the entire brain — cortex, hippocampus, cerebellum, spinal cord. It's essentially the brain's arousal and signal-to-noise broadcaster, firing tonically at low rates during calm wakefulness and phasically during novel or stressful events.
Acetylcholine
Acetylcholine has two main sources: the basal forebrain nuclei (including the nucleus basalis of Meynert) projecting to the cortex and hippocampus — relevant for attention and learning gating — and the medial septum projecting specifically to the hippocampus, where it strongly modulates theta rhythms and memory encoding.
What's striking in the context of your model is that all three systems share the same architectural logic: a tiny, localized cell population broadcasts a global contextual signal that shifts the operational threshold of millions of synapses simultaneously — none of them carrying specific content, all of them modulating how content gets written.