trainable gene circuits

associative memory, bistable commitment, and oscillatory state in gene regulatory networks
conditioning-like response
The probe stimulus evokes a strong output because the slow variable retained a training trace.
peak A: 3.00
peak C: 3.00
probe mean A: 2.21
time-series: A (output) / B (gate) / C (memory) / U1, U2 (stimuli)
final A
1.707
final B
1.866
final C
3.000
probe mean A
2.210
training
probe

GRNs as Dynamical Systems

A gene regulatory network is a dynamical system on expression space. Each gene product's concentration xix_i evolves according to a nonlinear ODE:

x˙i=fi(x1,,xn,u)γixi\dot{x}_i = f_i(x_1, \dots, x_n, u) - \gamma_i x_i

where fif_i encodes regulatory inputs (activation and repression via Hill functions) and γixi\gamma_i x_i is degradation. Cell types are modeled as stable attractors of this system.

Hill Function Regulation

Activation and repression use saturating Hill functions:

fact(A)=βAnKn+Anfrep(C)=βKnKn+Cnf_{\text{act}}(A) = \beta \frac{A^n}{K^n + A^n} \qquad f_{\text{rep}}(C) = \beta \frac{K^n}{K^n + C^n}

The Hill coefficient nn controls switch-like sharpness. Higher nn gives a more digital response. The threshold KK sets the inflection point.

Associative Learning in GRNs

Following Levin and Fernando, the associative circuit uses a slow memory variable CC that integrates co-stimulation:

p˙=fp(w1,w2,u1,u2)δpp\dot{p} = f_p(w_1, w_2, u_1, u_2) - \delta_p \, p
w˙2=f2(p,u2)δww2\dot{w}_2 = f_2(p, u_2) - \delta_w \, w_2

The crucial feature: w2w_2 is a slow state variable that stores the effect of prior co-stimulation. After training, a formerly weak cue can drive the response. This is the biochemical analog of a synaptic weight.

Three Memory Regimes

  • Associative trace: a slow variable retains history of co-stimulation. Later, a weak cue triggers the trained response. Learning = threshold crossing into a new basin.
  • Toggle / bistable attractor: mutual repression with self-activation creates two stable states. Memory = which basin the system occupies after a transient pulse.
  • Oscillatory memory: a repressilator-style loop stores state in phase and amplitude rather than a fixed point. Memory = persistent dynamical regime.

Notes

  • Simulation uses fourth-order Runge-Kutta (RK4) integration.
  • “Learning” here means history-dependent state change, not gradient descent on parameters.
  • The key insight: a GRN can exhibit memory, conditioning, and trainable behavior through the dynamics of its existing equations, without rewiring its topology.
  • Values are illustrative. Replace coupling weights and timing to test specific biological circuits.
claude opus 4.8March 2026·first cut. three coupled production-degradation ODEs with shared Hill regulation, integrated by fourth-order Runge-Kutta under a five-phase stimulation protocol (baseline, training, washout, probe, after). three presets cover the canonical learning regimes: a slow-variable associative trace, a bistable toggle, and a repressilator oscillator. a narrative panel labels each run, and the calibration verifies the deterministic primitives plus the conditioning, commitment, and oscillation outcomes against recomputed targets.

Calibration

Assumptions

Model changelog

v1.0March 2026
  • three-gene model: dx_i/dt = basal_i + beta_i * regulation_i(x, u) - decay_i * x_i with signed Hill regulation on every edge.
  • five-phase stimulation protocol so a transient training pulse can be probed after a washout, separating durable memory from transient response.
  • associative preset where gene C is a low-decay slow variable that stores paired stimulation and gates the output, after the Fernando-Levin conditioning circuit.
  • toggle preset using mutual repression plus self-activation for bistable basin commitment, and a repressilator preset that stores state as a sustained oscillation.
  • narrative inference labels each run as conditioning-like, committed, oscillatory, or no durable learning, computed from probe-window statistics.
  • calibration: exact Hill half-saturation and zero-weight identities, plus deterministic conditioning gain, toggle dominance, and oscillation amplitude recomputed from the live logic.
  • framing kept honest: learning means history-dependent state change under timed stimulation, not topology rewiring or gradient descent.