The voltage that is not a vote

Start with a patch of membrane, not a neuron icon. Its voltage is stored charge, and every open channel offers that charge a path towards a different electrical equilibrium.

A membrane behaves like a leaky capacitor

Separate positive and negative charge across a thin insulating membrane and you obtain a capacitor. The voltage across it changes when net current arrives. Lipid is the insulator; ion channels are selective conductors; concentration gradients and electric fields jointly determine the potential towards which each ionic current pulls.

For a compact single compartment, the bookkeeping begins with:

Cm dV/dt = Iext + Σ gj(t,V)(Ej - V) Cm is membrane capacitance, V is membrane voltage, Iext is externally applied current, gj is the open conductance of channel class j, and Ej is its reversal potential. The equation assumes one electrically compact compartment. Spatially extended neurons need cable or multicompartment equations.

The term g(E - V) is the key. Conductance g says how open the route is. The driving force E - V says how strongly ions move through it at the present voltage. Opening the same number of channels therefore need not deliver the same current twice. As voltage approaches the reversal potential, the current shrinks. Cross the reversal potential and the current changes direction.

Current injection and synaptic conductance ask different questions

An ideal current source supplies the requested current regardless of the membrane voltage. A synaptic conductance does not. Its current is large when voltage is far from the reversal potential and weak when voltage is near it. This distinction explains why two laboratory stimuli that produce the same initial deflection can diverge later.

Suppose a current pulse and an excitatory conductance pulse are tuned to produce the same 5 mV rise at rest. As the membrane depolarises, the current source keeps pushing with its prescribed amplitude. The conductance pulse loses driving force because the voltage is approaching its reversal potential. Add an inhibitory conductance and the two stimuli separate further: the external current is partly shunted, while the excitatory synaptic current is both shunted and reduced by its own changing driving force.

This is why a model fitted under current-clamp stimulation need not predict conductance-driven synaptic input. The input interface is part of the mechanism. Replacing conductance with injected current is an intervention, not a neutral change of notation. The replacement can be justified when voltage stays in a narrow range and the resulting current error is negligible for the decision. It fails when depolarisation, reversal, saturation or concurrent inhibition is precisely what the experiment probes.

Worked example · mental arithmetic

Where will three conductances pull the voltage?

Ignore capacitance for a moment and ask for the steady voltage at which net current is zero. Let a leak conductance of 1 unit pull towards minus 65 mV, an excitatory conductance of 1 unit pull towards 0 mV, and an inhibitory conductance of 2 units pull towards minus 70 mV. The balance point is the conductance-weighted average:

V* = [1(-65) + 1(0) + 2(-70)] / (1 + 1 + 2) = -51.25 mV

Now remove the inhibitory conductance. The balance shifts to minus 32.5 mV. The inhibitory synapse did not contribute a fixed negative number. It changed both the numerator and the total conductance in the denominator. That denominator shortens the membrane time constant, so the same excitatory charge also dissipates faster.

Conductances pull voltage towards competing reversal potentials A horizontal voltage rail from minus 80 to plus 50 millivolts. Leak, inhibition and excitation are drawn as springs attached to their reversal potentials. Their widths indicate conductance, and a marker shows the resulting equilibrium. -80 -65 -70 -51.25 0 +50 mV inhibition g=2 leak g=1 excitation g=1 balance point Voltage is pulled by open routes, not incremented by fixed signed votes.
Conductance is a state-dependent pullThe same channel opening exerts a smaller current as voltage approaches its reversal potential. Adding conductance also changes how quickly the membrane forgets charge. The geometry is therefore closer to competing springs than fixed arithmetic votes.Illustrative numerical example from the membrane current-balance equation.[1]

Thought experiment · change one causal property

Swap the battery, keep the channel

Imagine a synapse whose channel opening, timing and location are unchanged. Only the ionic gradient is altered, shifting its reversal potential from minus 70 mV to minus 40 mV. At a membrane voltage of minus 60 mV, the original event draws the cell down; the modified event pushes it up.

A fixed-weight artificial unit represents the synapse by a signed coefficient. It cannot reverse the sign of that input without changing the coefficient or adding state. The biological event reverses because the environment behind the channel changed. Input sign is not an intrinsic label on the synapse; it is a relation among channel selectivity, ionic gradients and present voltage.

The experiment asks a practical question. Will the system ever face changes in reversal potential, conductance saturation or membrane state? If yes, a fixed additive weight has discarded a variable that the intervention will move.

Why shunting inhibition can be a silent veto

Suppose an inhibitory conductance reverses near the resting voltage. Opening it alone causes little current because EI - V is small. Yet total conductance increases, so the effective membrane resistance falls. When excitation arrives, part of its current leaves through the newly open inhibitory route. The membrane charges less and decays faster.

This is more than a linguistic correction. Mitchell and Silver found that shunting inhibition in cerebellar granule cells could divisively alter the input-output relation under particular conductance and noise regimes.[5] It does not follow that every inhibitory synapse performs pure division. Location, reversal potential, background conductance and stimulus statistics matter. The safer conclusion is narrower: inhibition can change gain through conductance even when its immediate voltage signature looks small.

Evidence boundary

What the membrane equation establishes

Established mechanism Conservation of charge and ionic driving forces support the current-balance formulation. Conductance-based models reproduce central features of excitable membrane.[1]

Model interpretation Calling the membrane a calculator, voter or dynamical computer is an explanatory choice. Those words are useful only when the preserved input, state and output relations are stated.

Practitioner synthesis Treat a fixed synaptic weight as adequate only when reversal potentials and relevant membrane state are effectively constant over the question being asked.

The argument in one pass
Chart · flow
flowchart TD
  A["The inhibitory input that<br/>hardly moved the voltage"] --> B["The voltage that is not a vote"]
  B --> C["A spike is a trajectory"]
  C --> D["The branch changes the computation"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#B96D00,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through The neuron from membrane to computation: from The inhibitory input that hardly moved… to Escalate detail only when the…. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

A spike is a trajectory

The membrane does not wait passively for a sum to cross a line. Voltage opens and closes channels, those channels reshape current, and the resulting current changes voltage again.

The threshold moves because the state moves

In a threshold unit, activation is usually computed from the present inputs and fixed parameters. The output changes when the weighted sum crosses a boundary. In an excitable membrane, the apparent boundary is produced by interacting state variables. Sodium activation, sodium inactivation and potassium activation evolve at different rates. Their history determines whether a small depolarisation decays, triggers a spike or arrives during refractoriness.

Hodgkin and Huxley represented these processes with conductances controlled by gating variables. In compact form:

CmdV/dt = I - ḡNam³h(V-ENa) - ḡKn⁴(V-EK) - gL(V-EL) m opens rapidly with depolarisation, h inactivates sodium current more slowly, and n activates potassium current. Each gate has its own voltage-dependent transition rates. The exponents are empirical features of the original squid-axon model, not universal molecular counts.

A small rise in voltage increases sodium activation. Inward sodium current then raises voltage further, creating regenerative positive feedback. Slower sodium inactivation and potassium activation reverse the movement. The spike is the resulting excursion through a state space. It is not a single comparison operation hidden inside a biological casing.[1]

Threshold is a surface through hidden state

A voltage value such as minus 50 mV is often called “the threshold”. That shorthand is useful for spike detection, but it can mislead as a causal account. Picture two membranes at exactly minus 50 mV. In the first, many sodium channels are available and potassium activation is low. In the second, sodium channels are partly inactivated and potassium conductance remains elevated after a recent spike. The first state may accelerate into an action potential; the second may fall back.

In the full state space, voltage is one coordinate among several. The boundary separating returning trajectories from spiking trajectories is therefore a surface whose position changes with channel state, temperature, neuromodulation and recent input. A fixed voltage threshold projects that surface onto one axis. The projection can work well under a restricted regime while failing under adaptation or closely spaced stimulation.

This gives a clean role to simplified spiking models. An integrate-and-fire model keeps voltage-like state and an event boundary while replacing the spike waveform with a reset. Models such as Izhikevich's retain a small number of dynamical variables to reproduce multiple firing patterns at low computational cost.[13] They are not halfway points on a universal realism scale. Each preserves a different set of trajectories. The right simplification is the one whose hidden state still distinguishes the histories your experiment will compare.

Voltage and conductance form a feedback system A circular causal diagram shows membrane voltage opening sodium activation gates, which increase inward current and further depolarise voltage. Slower sodium inactivation and potassium activation provide opposing feedback. Dashed intervention arrows show channel block and temperature changes. membrane voltage V fast Na activation m opens Na inactivation h closes K activation n opens inward Na current depolarises regenerative loop recovery loops Na-channel block kinetic-rate change
The spike-generating feedback systemFast inward feedback creates the upstroke; slower opposing processes terminate it and create refractoriness. A voltage threshold summarises this geometry only under a limited range of recent histories.Mechanism diagram based on Hodgkin and Huxley's conductance model.[1] Dashed paths denote interventions.

Real neurons distribute channel classes unevenly. In many cortical pyramidal neurons, the axon initial segment has a specialised channel arrangement that favours spike initiation. Kole and colleagues showed that high sodium-channel density there is required for action-potential generation in the neurons they studied.[4] This matters because the neuron's decisive comparison is not necessarily made at the soma, and the path from dendrite to axon initial segment is itself stateful.

One action potential as a coupled voltage and conductance trajectory The upper chart shows a simulated Hodgkin-Huxley voltage spike after a brief current pulse. The lower chart shows sodium conductance rising first and potassium conductance rising later. This timing creates the spike and recovery. +50-40-80g02550 ms voltageNa conductanceK conductance brief current pulse
An action potential is an ordered excursionIn this simulation, sodium conductance rises rapidly and potassium conductance follows. The output event exists because the hidden variables traverse this sequence. A binary spike marker retains the event time but not the mechanism that made it possible.Illustrative simulation of the classic Hodgkin-Huxley squid-axon equations with a brief current pulse.[1]

Thought experiment · preserve charge, change time

The same charge in two rhythms

Deliver one unit of charge as a strong 1 ms pulse. Then deliver the same charge as a ten-times weaker 10 ms pulse. A pure accumulator should end in the same state. A leaky membrane does not, because charge delivered early has more time to escape. Active channels can magnify the difference further by recruiting regenerative current in one case but not the other.

Now repeat the strong pulse shortly after a spike. Sodium channels remain partly inactivated and potassium conductance remains elevated. The same pulse that previously fired the cell may fail. Identical present input does not imply identical response when recent history occupies hidden channel state.

Worked example · smallest useful dynamics

Same charge, different peak voltage

Take a passive membrane with resistance 100 MΩ and time constant 10 ms. A 1 nA pulse lasting 1 ms raises voltage by RI(1-e-t/τ), about 9.5 mV. Spread the same charge over 10 ms at 0.1 nA and the rise at the end is about 6.3 mV. The slower delivery loses more charge while it is still arriving.

The calculation assumes a linear single compartment. It leaves out channel gating and dendritic space. Its value is precisely that narrowness: timing sensitivity appears before any sophisticated biophysics is added.

Equal charge delivered through two leaky capacitors Two membrane reservoirs receive the same total charge. The fast reservoir receives it in one brief stream and ends at 9.5 millivolts. The slow reservoir receives it over ten milliseconds, loses more through a leak while filling and ends at 6.3 millivolts. fast delivery · 1 ms slow delivery · 10 ms same total charge arrives together same total charge spread through time 9.5 mV 6.3 mV little charge leaks during delivery leak operates while the input is still arriving leak more lost
Timing changes the result before spiking beginsBoth inputs carry the same charge, but the brief pulse produces a larger peak because the membrane leaks throughout the longer delivery. A model that retains only total input charge cannot answer this timing intervention.Illustrative passive RC calculation with R = 100 MΩ and τ = 10 ms.

Boundary condition

Do not infer intelligence from biophysical detail

A more detailed neuron model is not automatically a better model of a cognitive task. Hodgkin-Huxley dynamics describe membrane excitability, not concepts, deliberation or consciousness. Conversely, a simplified spiking or rate model can answer a network-level question without reproducing every ion channel. Detail earns its cost only when it preserves a relation the question depends upon.

The branch changes the computation

A neuron is not normally one electrical point. Signals travel through branching cable, meet local conductances and can be combined differently before they reach the axon.

Move a synapse and you change its transfer function

Rall's cable-theoretic work made a basic fact mathematically tractable: voltage spreads through dendrites with attenuation and delay that depend on membrane and axial properties, branch diameters and path length.[2] Two identical synapses on different branches therefore need not have identical influence at the soma or axon initial segment.

Passive attenuation is only the beginning. Dendrites can contain voltage-gated sodium, calcium, potassium and NMDA-receptor conductances. Local depolarisation can recruit these mechanisms, creating branch-specific amplification, plateaus or spikes. In rat pyramidal neurons, Branco and Häusser found systematic integration gradients: proximal inputs summed more nearly linearly and demanded tighter coincidence, while distal inputs showed stronger amplification over broader intervals in the preparation studied.[7]

Relocating identical synapses changes their local interaction Two dendritic trees receive the same four synapses. In the left tree the inputs are split across branches and remain below local nonlinear thresholds. In the right tree the same inputs are clustered on one branch, producing a local dendritic event and a larger somatic response. same inputs, splitsame inputs, clustered modest somatic responselocal event amplifies response branch assignment is part of the inputweights alone do not record it
The synapse-relocation interventionKeep synaptic strength and timing fixed, but move the contacts from separate branches onto one excitable branch. The local voltage can now recruit a nonlinear dendritic event. A point unit with the same four weights predicts no change unless branch identity is explicitly represented.Illustrative intervention motivated by dendritic integration experiments and models.[7][8]

Thought experiment · preserve weights, move space

Move the synapses

Take four excitatory synapses with fixed release, timing and receptor conductance. In the first neuron, place two on each of two branches. In the second, cluster all four on one branch. Nothing in a flat weight vector changes except a variable the vector does not contain: spatial grouping.

If the branch is passive and linear, the two arrangements may differ mainly by attenuation. If it supports a local regenerative event, clustering can change the qualitative response. The experiment identifies the missing variable without claiming every dendrite implements the same operation. Morphology matters when relocation changes the causal pathway from input to output.

A branch can act like a conditional subunit

Poirazi, Brannon and Mel showed that a detailed model of a pyramidal neuron could be approximated, for the rate-based task they examined, by a two-layer network whose hidden units corresponded to dendritic subunits.[8] This is a useful functional compression. It is not evidence that a dendrite literally contains an artificial hidden layer, nor that all neurons require the same abstraction.

Worked example · toy branch logic

A point sum confuses two patterns that branches separate

Let inputs A and B land on one branch, while C and D land on another. Each active input contributes one local unit. A branch emits a plateau only when both of its inputs are active. The soma spikes when either branch plateaus. The resulting toy rule is (A ∧ B) ∨ (C ∧ D).

Patterns A+B and A+C both contain two active synapses. A point unit with equal weights sees the same sum of two. The branch model separates them because co-location determines whether a local threshold is reached. This example shows an expressivity difference, not a universal biological code.

A branch-structured toy neuron separates equal-count patterns Four input patterns each have two active synapses. A point sum assigns them the same value. A two-branch model activates only when both active inputs share branch one or branch two, implementing an illustrative OR of two local AND operations. four patterns, each with two active inputsresponses A+B A+C C+D B+D branch 1: A, Bbranch 2: C, D point sumbranch model 2spike2silent2spike2silent
Local grouping can add a hidden computational layerA flat equal-weight sum maps all four patterns to two. The branch-structured toy model distinguishes co-located pairs from cross-branch pairs. The figure demonstrates a possible preserved relation, not a claim that dendrites implement literal Boolean gates.Illustrative worked example inspired by two-layer abstractions of pyramidal-neuron models.[8]

Order can matter without changing the input set

Dendritic geometry also turns temporal order into a spatial variable. Branco, Clark and Häusser demonstrated sequence discrimination in cortical dendrites: activating the same set of locations in opposite orders could produce different somatic responses because propagation and local nonlinearities differed along the branch.[6] A bag of active synapses cannot express this distinction. A model needs at least location, timing and the relevant propagation rule.

Human cortical neurons add further reasons for restraint. Studies of ex vivo human tissue have reported enhanced compartmentalisation and dendritic calcium action potentials with properties that differ from common rodent examples.[10][9] These findings are important but tissue-, cell-type- and protocol-bounded. They do not licence a generic claim that “the human neuron” performs a single exotic operation.

Compartmentalisation can hide as well as amplify

Dendritic nonlinearity is often described as extra computing power, but isolation can also prevent a local event from dominating the soma. A branch may support a calcium or NMDA event that changes local integration or plasticity while producing only a modest somatic voltage. Other branch geometry can favour strong coupling. The same tree therefore contains several observation points with different answers to “did the neuron respond?”

This matters for measurement. A somatic electrode can miss a local dendritic event; a calcium signal can reveal local activation without proving that the axon changed its output; a spike count can preserve the final event while hiding which branch caused it. The candidate output must be named at the scale where the mechanism is claimed. A soma-to-spike model cannot be used to explain a branch-specific intervention merely because its final firing rate fits.

Failure case

When the branch model is unnecessary

If the task asks only for average firing rate under a narrow, stationary input distribution, a fitted point-neuron or even a static nonlinearity may predict sufficiently well. Adding compartments can increase parameters and uncertainty without changing the decision. The branch becomes necessary when location-specific perturbations, coincidence, sequence, local plasticity or channel modulation enter the question.

How the claim changes under pressure
Chart · state
stateDiagram-v2
  [*] --> Claim
  state "A membrane behaves like a<br/>leaky capacitor" as Claim
  state "Current injection and synaptic<br/>conductance ask different<br/>questions" as Test
  state "Where will three conductances<br/>pull the voltage?" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with A membrane behaves like a leaky capacitor and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

The abstraction contract

The right question is not whether an artificial unit is “really” a neuron. It is which relation the unit promises to preserve, under which inputs and interventions.

The artificial neuron was designed to forget

McCulloch and Pitts deliberately abstracted nervous activity into threshold logic.[3] Modern artificial units usually compute a weighted sum followed by a nonlinearity:

y = φ(Σ wixi + b) xi are selected input features, wi are learned coefficients, b is a bias and φ is an activation function. Unless recurrence or explicit state is added, this map has no membrane history, ionic reversal potential, branch location or refractory trajectory.

That forgetting is often the point. A network trained for image classification does not need to simulate sodium current to be useful. The danger begins when success on one projected relation is treated as evidence that the discarded mechanism has also been captured.

Beniaguev, Segev and London trained deep networks to approximate the input-output behaviour of a detailed cortical-neuron model.[11] The result shows that a sufficiently expressive artificial network can emulate that configured model over sampled spatiotemporal inputs. It does not collapse the distinction between emulator and target. The mapping is evidence for functional approximation under a test distribution, not identity of substrate, state or counterfactual response.

Three meanings of “the same computation”

Claims of sameness often slide among three standards. Under decision equivalence, two systems return the same class, rate or action on a specified input set. Under trajectory equivalence, relevant intermediate states and timings also correspond. Under intervention equivalence, manipulating a named cause in either system changes the matched outcome in the corresponding way.

Decision equivalence is usually the cheapest to establish and often all an application needs. Trajectory equivalence is stronger but representation-dependent: two systems can reach the same decision through different paths. Intervention equivalence is the demanding standard for a mechanistic substitute because it asks the model to preserve what happens when the world, rather than only the observed input, is changed.

These standards should not be collapsed into a single similarity score. A model can have excellent decision equivalence and poor intervention equivalence, as Figure 10 will show. It can also preserve a useful intervention while using different microscopic variables, provided a tested mapping connects the manipulated cause and effect. “Same computation” becomes informative only after the equivalence standard and its test distribution are declared.

Thought experiment · same outputs, new intervention

The perfect baseline emulator

Train a black-box network until it reproduces every observed spike of a conductance model under one laboratory regime. On held-out examples from that regime, the traces are indistinguishable. Now change only the excitatory reversal potential by altering the ionic gradient.

The conductance model changes because each excitatory current contains EE-V. The emulator changes only if that variable, or enough evidence about it, entered its training and representation. Perfect baseline prediction therefore leaves a counterfactual question unanswered.

Output agreement licenses only the interventions represented in the agreement test. This is the boundary between behavioural compression and mechanistic substitution.

A five-level causal fidelity ladder

Instead of asking for a universally realistic neuron, match the model to the intervention burden. The following ladder is a practitioner synthesis developed here. Higher levels add obligations; they are not moral rankings, and a lower level may be the correct engineering choice.

The causal fidelity ladderA model can be excellent at one level and invalid at the next. A rate unit may preserve a classification decision; a spiking model may preserve timing; a conductance model may preserve channel interventions; a multicompartment model may preserve relocation. The final level is always named relative to a concrete intervention set.Practitioner synthesis introduced in this paper.

Worked example · configured model choice

Four questions, four different neurons

For a vision system that needs only category accuracy, begin with a standard artificial activation. For a neuromorphic controller whose latency depends on spike order, use a temporal spiking model. For a pharmacology experiment that blocks sodium or potassium channels, use a conductance model with the manipulated channel state. For a study that relocates synapses or tests branch-specific plasticity, use a multicompartment model with morphology.

The decision rule is economical: include the cheapest state description that remains closed under the interventions you intend to perform. “Closed” means the intervention can be expressed within the model and produces a response for the right causal reason, rather than through an unrelated refit.

Biological inspiration is not biological validation

Dendrite-inspired artificial architectures can be valuable even when they are not biophysical models. Recent work has reported accuracy, robustness or parameter-efficiency gains from structured dendritic components in particular artificial-network tasks.[14] Such results support an architectural hypothesis: local subunits and sparse receptive fields can impose useful inductive bias. They do not show that the network has reproduced a cortical neuron's membrane mechanism.

The distinction protects both fields. Machine learning can borrow branch-like factorisation without pretending to simulate ion channels. Neuroscience can use artificial networks as approximators without treating trainability as a biological explanation. A responsible comparison names the preserved relation, such as local conjunction or sparse routing, then tests where the relation breaks.

QuestionMinimum candidateMust preserveFailure trigger
Static task decisionArtificial activationDecision boundary on the intended distributionTiming or state changes the decision
Spike timing and refractorinessSpiking dynamical unitTemporal integration, event and recovery stateChannel-specific perturbation matters
Channel or reversal interventionConductance modelVoltage, relevant gates, reversal potentialsLocation changes the response
Branch relocation or local eventMulticompartment modelMorphology, cable coupling, local conductancesMissing molecular or stochastic mechanism matters

Executable lab

Conductance, timing and the silent veto

Run a classic single-compartment Hodgkin-Huxley model with current injection, excitatory conductance and inhibitory conductance. The chart is computed locally in your browser.

An interactive chart of membrane voltage, excitatory conductance and inhibitory conductance over sixty milliseconds. Controls change current, conductance, inhibition timing and inhibitory reversal potential.

Interactive conductance simulationCompare the excitation preset with the silent-veto preset. Inhibition begins near the resting voltage, so it may add little initial hyperpolarisation while still preventing the excitatory train from producing a spike.Illustrative browser implementation of the classic Hodgkin-Huxley equations with synthetic synaptic conductances.[1]
Spikes0
Peak voltage-65.0 mV
Voltage at inhibition-65.0 mV

How to read the lab

The current pulse preset adds a fixed external current. The excitatory conductance preset opens three decaying conductance pulses whose current falls as voltage approaches 0 mV. The silent veto adds inhibition with a reversal near rest before excitation. The late inhibition moves the same conductance after the first decisive excursion.

A positive result is not “the neuron is intelligent”. It is a visible dependency: changing conductance, reversal potential or onset changes the trajectory in a way a context-free input sum would not predict. A negative result means the chosen perturbation was too weak, mistimed or outside the model's sensitive regime. It does not show conductance is generally irrelevant.

The lab encodes a single isopotential compartment, classic squid-axon channel kinetics and synthetic synaptic pulses. It omits dendritic cable, stochastic release, temperature corrections, ion concentration dynamics, channel diversity and cell-type calibration. It is an intuition instrument, not a fitted model of a named cortical neuron.

Python reference implementation and run instructions

Save the code as conductance_lab.py, install NumPy and Matplotlib, then run python conductance_lab.py. Edit the preset dictionary to compare interventions. The script prints spike count and plots voltage and synaptic conductances.

Python · Hodgkin-Huxley conductance lab
from __future__ import annotations

from dataclasses import dataclass
from typing import NamedTuple

import matplotlib.pyplot as plt
import numpy as np


@dataclass(frozen=True)
class Config:
    duration_ms: float = 60.0
    dt_ms: float = 0.01
    current_uA_cm2: float = 0.0
    g_exc_mS_cm2: float = 0.06
    g_inh_mS_cm2: float = 0.20
    inhibition_onset_ms: float = 9.0
    e_exc_mV: float = 0.0
    e_inh_mV: float = -65.0


class Trace(NamedTuple):
    time_ms: np.ndarray
    voltage_mV: np.ndarray
    g_exc_mS_cm2: np.ndarray
    g_inh_mS_cm2: np.ndarray


PRESETS: dict[str, Config] = {
    "current": Config(current_uA_cm2=10.0, g_exc_mS_cm2=0.0, g_inh_mS_cm2=0.0),
    "excitation": Config(g_inh_mS_cm2=0.0),
    "silent_veto": Config(),
    "late_inhibition": Config(inhibition_onset_ms=18.0),
}


def _safe_ratio(x: float, scale: float) -> float:
    return scale if abs(x) < 1e-9 else x / (1.0 - np.exp(-x / scale))


def alpha_n(v: float) -> float:
    return 0.01 * _safe_ratio(v + 55.0, 10.0)


def beta_n(v: float) -> float:
    return 0.125 * np.exp(-(v + 65.0) / 80.0)


def alpha_m(v: float) -> float:
    return 0.1 * _safe_ratio(v + 40.0, 10.0)


def beta_m(v: float) -> float:
    return 4.0 * np.exp(-(v + 65.0) / 18.0)


def alpha_h(v: float) -> float:
    return 0.07 * np.exp(-(v + 65.0) / 20.0)


def beta_h(v: float) -> float:
    return 1.0 / (1.0 + np.exp(-(v + 35.0) / 10.0))


def exp_pulse(time: np.ndarray, onset: float, tau: float) -> np.ndarray:
    return np.where(time >= onset, np.exp(-(time - onset) / tau), 0.0)


def simulate(config: Config) -> Trace:
    """Run a deterministic, single-compartment Hodgkin-Huxley simulation."""
    time = np.arange(0.0, config.duration_ms + config.dt_ms, config.dt_ms)
    voltage = np.full(time.shape, -65.0)
    g_exc = config.g_exc_mS_cm2 * sum(
        exp_pulse(time, onset, 5.0) for onset in (10.0, 15.0, 20.0)
    )
    g_inh = config.g_inh_mS_cm2 * exp_pulse(
        time, config.inhibition_onset_ms, 8.0
    )

    m = alpha_m(-65.0) / (alpha_m(-65.0) + beta_m(-65.0))
    h = alpha_h(-65.0) / (alpha_h(-65.0) + beta_h(-65.0))
    n = alpha_n(-65.0) / (alpha_n(-65.0) + beta_n(-65.0))

    for i in range(1, time.size):
        v = voltage[i - 1]
        dt = config.dt_ms
        m += dt * (alpha_m(v) * (1.0 - m) - beta_m(v) * m)
        h += dt * (alpha_h(v) * (1.0 - h) - beta_h(v) * h)
        n += dt * (alpha_n(v) * (1.0 - n) - beta_n(v) * n)

        i_na = 120.0 * m**3 * h * (v - 50.0)
        i_k = 36.0 * n**4 * (v + 77.0)
        i_leak = 0.3 * (v + 54.387)
        i_syn = g_exc[i] * (config.e_exc_mV - v)
        i_syn += g_inh[i] * (config.e_inh_mV - v)
        i_external = (
            config.current_uA_cm2 if 10.0 <= time[i] < 40.0 else 0.0
        )

        voltage[i] = v + dt * (i_external + i_syn - i_na - i_k - i_leak)

    return Trace(time, voltage, g_exc, g_inh)


def spike_count(voltage: np.ndarray) -> int:
    return int(np.count_nonzero((voltage[:-1] < 0.0) & (voltage[1:] >= 0.0)))


def plot(trace: Trace, title: str) -> None:
    fig, axes = plt.subplots(2, 1, sharex=True, figsize=(9, 6))
    axes[0].plot(trace.time_ms, trace.voltage_mV)
    axes[0].set_ylabel("Voltage (mV)")
    axes[0].set_title(title)
    axes[1].plot(trace.time_ms, trace.g_exc_mS_cm2, label="gE")
    axes[1].plot(trace.time_ms, trace.g_inh_mS_cm2, label="gI")
    axes[1].set_xlabel("Time (ms)")
    axes[1].set_ylabel("Conductance (mS/cm²)")
    axes[1].legend()
    fig.tight_layout()
    plt.show()


if __name__ == "__main__":
    preset = "silent_veto"
    trace = simulate(PRESETS[preset])
    print(f"Preset: {preset}")
    print(f"Spikes: {spike_count(trace.voltage_mV)}")
    print(f"Peak voltage: {trace.voltage_mV.max():.2f} mV")
    plot(trace, "Conductance intervention")
A baseline fit can fail under an unseen ionic intervention At baseline, both a conductance model and a fitted point proxy predict a spike. After excitatory reversal potential moves from zero to minus ten millivolts, the conductance model becomes subthreshold while the point proxy remains unchanged because it has no reversal-potential variable. baseline: Eₑ = 0 mVintervention: Eₑ = -10 mV conductancepoint proxyconductancepoint proxy spikespikeno spikespike The proxy matched the observed decision but lacked the manipulated cause. fit regimeout-of-contract test
Prediction equivalence is intervention-relativeBoth models match the baseline spike. Changing only excitatory reversal potential removes the spike in the conductance simulation, while a proxy without that variable cannot respond. The failure is not that the proxy is simple; it was asked a question outside its abstraction contract.Illustrative result from the executable model: gE = 0.06 mS/cm² produces one spike at Eₑ = 0 mV and none at Eₑ = -10 mV. The point proxy is deliberately invariant.

Open research hypothesis

Intervention-matched selection will outperform baseline-fit selection

When candidate neuron abstractions have similar predictive error on ordinary data, selecting by the causal fidelity ladder should improve transfer to the named perturbations. Evidence would strengthen this proposal if models chosen by intervention coverage predict held-out channel, timing or relocation experiments better than equally accurate baseline models. It would weaken the proposal if baseline fit alone performs as well across genuinely unseen interventions.

A rival explanation is model capacity: a larger model may transfer better without representing the intended mechanism. The smallest useful test is therefore a matched-capacity comparison with preregistered interventions and internal variables. Do not apply the ladder where no perturbation claim is made and only a stable operational decision matters.

Decision instrument

The abstraction-preservation contract

Before choosing a neuron model, write five fields: decision output, input regime, state variables allowed to move, interventions to be answered, and failure consequence. A candidate passes only when each intervention is expressible in its variables and its response has been checked against a stronger model or experiment.

Consequence

The evidence conversation
Chart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: The inhibitory input that hardly moved the voltage
  M->>E: A membrane behaves like a leaky capacitor
  E-->>M: compare rival explanations
  E->>D: Escalate detail only when the abstraction breaks
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in The neuron from membrane to computation. Reading use: follow the relation, then return to the surrounding argument for evidence and limits.

Escalate detail only when the abstraction breaks

The picture of a neuron as a weighted sum followed by a threshold is neither false nor complete. It is a compressed answer to a particular question. It can preserve a useful decision boundary while omitting conductance, hidden channel state, spike trajectory, branch geometry and ionic context.

The practical mistake is to choose detail by resemblance. A model with biological labels may still miss the causal variable under study. A plain artificial unit may be exactly right for a stable classification task. The decisive test is whether the abstraction remains valid when the variable you intend to manipulate is changed.

For network optimisation, begin with the cheapest unit that achieves the operational objective. For spike timing, retain temporal state. For adaptation, channel perturbation or pharmacology, retain the relevant conductances and gates. For synapse relocation, local dendritic events or branch-specific plasticity, retain morphology. Escalate only when a lower model breaks the intervention contract.

This changes how biological and machine intelligence should be compared. Do not ask whether one artificial activation “is” one neuron. Ask which projection links them, what was deliberately discarded, and which counterfactual would expose that loss. That language makes strong analogies testable and modest abstractions defensible.

A neuron is not complicated because biology failed to discover a cleaner activation function. Its computation is the organised evolution of material state. An artificial activation becomes scientifically informative when we name the slice of that evolution it preserves and refuse to smuggle the rest back in.

Glossary

Membrane potential
The electrical potential difference across the cell membrane, produced by separated charge and ionic gradients.
Conductance
How readily current flows through an open population of channels, commonly measured in siemens or area-normalised units.
Reversal potential
The membrane voltage at which a particular ionic current has zero net driving force and changes direction.
Driving force
The difference between a channel's reversal potential and the present membrane voltage.
Gating variable
A dynamical state summarising the fraction or probability of channel gates in an activating or inactivating condition.
Action potential
A regenerative voltage excursion created by ordered changes in membrane conductances.
Shunting inhibition
Inhibition that increases membrane conductance and reduces the impact of concurrent excitation, sometimes with little initial hyperpolarisation.
Isopotential compartment
A model region assumed to have one membrane voltage at each instant.
Cable filtering
Attenuation and delay as voltage spreads through dendritic or axonal structure.
Causal fidelity
The set of decision-relevant interventions and internal relations that an abstraction preserves.

References

  1. Hodgkin, A. L. and Huxley, A. F. (1952). A quantitative description of membrane current and its application to conduction and excitation in nerve. The Journal of Physiology, 117(4), 500-544.
  2. Rall, W. (1959). Branching dendritic trees and motoneuron membrane resistivity. Experimental Neurology, 1, 491-527.
  3. McCulloch, W. S. and Pitts, W. (1943). A logical calculus of the ideas immanent in nervous activity. Bulletin of Mathematical Biophysics, 5, 115-133.
  4. Kole, M. H. P. et al. (2008). Action potential generation requires a high sodium channel density in the axon initial segment. Nature Neuroscience, 11, 178-186.
  5. Mitchell, S. J. and Silver, R. A. (2003). Shunting inhibition modulates neuronal gain during synaptic excitation. Neuron, 38(3), 433-445.
  6. Branco, T., Clark, B. A. and Häusser, M. (2010). Dendritic discrimination of temporal input sequences in cortical neurons. Science, 329(5999), 1671-1675.
  7. Branco, T. and Häusser, M. (2011). Synaptic integration gradients in single cortical pyramidal cell dendrites. Neuron, 69(5), 885-892.
  8. Poirazi, P., Brannon, T. and Mel, B. W. (2003). Pyramidal neuron as two-layer neural network. Neuron, 37(6), 989-999.
  9. Gidon, A. et al. (2020). Dendritic action potentials and computation in human layer 2/3 cortical neurons. Science, 367(6473), 83-87.
  10. Beaulieu-Laroche, L. et al. (2018). Enhanced dendritic compartmentalization in human cortical neurons. Cell, 175(3), 643-651.e14.
  11. Beniaguev, D., Segev, I. and London, M. (2021). Single cortical neurons as deep artificial neural networks. Neuron, 109(17), 2727-2739.e3.
  12. Fischer, L. et al. (2022). Dendritic mechanisms for in vivo neural computations and behavior. The Journal of Neuroscience, 42(45), 8460-8467.
  13. Izhikevich, E. M. (2003). Simple model of spiking neurons. IEEE Transactions on Neural Networks, 14(6), 1569-1572.
  14. Chavlis, S. et al. (2025). Dendrites endow artificial neural networks with accurate, robust and parameter-efficient learning. Nature Communications, 16, 943.