Biochemical computation underlying behavioral decision-making

Computations in the brain are broadly assumed to emerge from patterns of fast electrical activity. Challenging this view, we show that a male fly’s decision to persist in mating, even through a potentially lethal threat, hinges on biochemical computations that enable processing over minutes to hours. Each neuron in a recurrent network measuring time into mating contains slightly different internal molecular estimates of elapsed time. Protein Kinase A (PKA) activity contrasts this internal measurement with input from the other neurons to represent evidence that the network’s goal has been achieved. When consensus is reached, PKA pushes the network toward a large-scale and synchronized burst of calcium influx, which we call an eruption. The eruption functions like an action potential at the level of the network, transforming deliberation within the network into an all-or-nothing output, after which the male will no longer sacrifice his life to continue mating. We detail the continuous transformation between interwoven molecular and electrical information over long timescales in this system, showing how biochemical activity, invisible to most large scale recording techniques, is the key computational currency directing a life-or-death decision.


INTRODUCTION
threshold, we re-imposed optogenetic inhibition between two, independently insufficient, switch and suggests the accumulation and storage of a biochemical signal within the 182 network. The accumulated signal often survived even 3 minutes of intervening inhibition, 183 but 10 minutes of inhibition completely erased the effect of the first window ( Figure 2C).

184
We conclude that depolarization of the Crz neurons drives the accumulation of a long-185 lasting, likely biochemical, signal that slowly degrades in the absence of electrical

243
To gain more precise control of cAMP dynamics we employed the photoactivatable

348
The behavioral outputs of the Crz network are discrete events (a motivational switch and 349 sperm transfer), while the voltage-dependent period of cAMP accumulation appears 350 continuous. We speculated that this system might employ an accumulate-to-threshold

378
Consistent with accumulation to a threshold, when 500 ms pulses of bPAC stimulation 379 were applied every 100 seconds (allowing calcium levels to return to baseline) we 380 observed steadily increasing cAMP levels over successive pulses ( Figure 4E). Our 381 measurements were often confounded by saturation of the cAMP sensor ( Figure S6),

382
but accumulation was evident as lingering cAMP just before the next stimulation, when 383 cAMP returns to values within the sensor's dynamic range (residual cAMP, Figure 4E).

465
The above experiments, together with our earlier demonstration that CaMKII is active for

508
Network activity drives cAMP accumulation, while CaMKII opposes it. cAMP signaling 509 serves as a common medium for representing evidence that the interval has elapsed.

510
Elevation of cAMP signaling, corresponding to increasing confidence that the interval 511 has elapsed, increases the electrical activity of the neuron, applying pressure to the rest

518
We noticed during earlier experiments that the fluorescence lifetime of cADDis Green-Down 519 changes alongside fluorescence when the sensor binds cAMP ( Figure S6E).

520
Fluorescence lifetime imaging permits absolute measurements of cAMP levels, instead   Figure 6G).

544
The Crz neurons can accumulate evidence over a wide range of timescales

546
Evidence accumulation is a broad framework that can describe many systems, unified

639
Like action potentials in individual neurons, the system described here rapidly resets

663
Eruption-like mechanisms seem well suited for diverse long-timescale computations.

664
Linearity of evidence accumulation and dissipation allows undistorted evaluation, 665 whether the system is near or far from its threshold. The magnitude of network activation 666 distinguishes the information-gathering phase from the decisive output, allowing 667 evidence to accumulate without triggering the downstream consequences. The 668 accumulated signal persists even in the total absence of electrical input, enabling activity-silent memory 48 that imparts the system with a history dependence that could not be discerned from purely electrophysiological measurements. In some network models, dimensions of neural activity, but no mechanism has been proposed to control the switch buffering network-level computations against malfunction of individual components, as 675 demonstrated by our mosaic silencing experiments.

677
Though we know of no previous description of anything closely resembling an eruption,

678
there are conceptual similarities with several well-studied phenomena in neuroscience.

679
Much of cortex has been hypothesized to operate at near-criticality, giving rise to brief

692
We propose to define an eruption as a thresholded jump in recurrent network activity 693 that engages downstream processes that were blind to intra-network accumulation of

903
Supplementary Video 1 | The Crz neurons require over 60 seconds of electrical 904 activity to permit a normal copulation duration

906
Flies expressing GtACR1 in the Crz neurons are exposed to green light until 10 minutes 907 into mating, when inhibition is relieved for either 30 seconds (top row) or 90 seconds 908 (bottom row). All flies exposed to 90 seconds of relief terminate mating around 18 909 minutes later, while those exposed to 30 seconds of relief all persist in mating for much  Table. 951 952

954
A pair of flies was scored as "mating" when they adopted a stereotyped mating posture

997
During the screen:

999
Individual pairs of males and females were placed in single wells of 32 well arenas (see 1000 Thornquist et al. 6 ) recorded from a height of ~9" using a Canon camera (VIXIA HF 1001 R600). Arenas were illuminated from below using a diffuse white light source (Artograph

1006
Heat threat experiments

1008
Heat threat experiments were performed as in 6 :

1009
A similar device to the one described above was constructed, with the addition of a ¼"

1040
Analysis was performed using custom Python3 code.

1041
When analyzing multiple neurons simultaneously, rectangular ROIs were drawn around 1042 identified cells or processes and the same analysis as above was performed.

1043
Experiments using only GCaMP6s used a 920 nm excitation wavelength, while those 1044 performed in conjunction with cADDis Red-Up used a 1000 nm excitation beam.

1045
Experiments using cADDis Green-Down also used a 1000 nm excitation wavelength.

1051
The probability that a photon will be detected at time t is then described by the relation: where f ! refers to the proportion of excited fluorophores in state n with time constant τ ! .

1053
The two convolved distributions are corresponding to the probability of a given instrumentation induced shift in the detected 1055 arrival time and We can evaluate this integral by completing the square inside the exponential:

1065
We used the obtained estimate for t ! to compute the "empirical lifetime" τ, the mean 1066 arrival time of a photon 12 . τ is defined as The typical value for t ! was approximately 2.9+/-0.1 nanoseconds. τ ! values ranged  All samples were fixed in PBS with Triton X-100 and 4% paraformaldehyde for 20 minutes, then washed three times with PBS/Triton X-100 for 20 minutes each before days, washed three times with PBS/ITriton X-100 for 20 minutes each, incubated with the secondary antibody for two days, then washed three times as before and mounted on coverslips using VectaShield (Vector Labs). Antibodies used are as follows: (Olympus PLAN-APOCHROMAT) controlled by Zen software, and analyzed using ImageJ.  model (e.g. in our data, the probability of terminating the mating in response to some 1111 stimulus), rather than consistency of a data set with a particular value that the model might take. With this approach, we can make statistical claims about our belief in the magnitude of effects, rather than simply reporting their deviation from that produced by a null hypothesis. We do, however, recognize that the frequentist approach is more 1115 commonplace, and so present our data in a manner that is as consistent as possible

Generation of transgenic flies
1149 with ! and ! ! the mean and variance of the "no light" condition, and ! and ! ! the 1150 mean and variance of the "light at start" condition, and likewise ! the corresponding 1151 size of those samples. The prior on ! was a Beta distribution with = = 0.5, the 1152 Jeffrey's prior, and we used MCMC to estimate the posterior distribution of ! .We then 1153 plotted the maximum a posteriori value for ! along with 68% credible intervals.

1155
A similar model was used for the "relief from inhibition" experiments in which inhibition 1156 was relieved after 10 minutes of mating. These flies would mate for ~18 minutes longer 1157 (in contrast to those flies in which inhibition was not relieved, that would typically mate 1158 for at least another hour). The flies in which inhibition was removed at 10 minutes were used instead of the "no light" condition for generating the priors on ! and ! ! , as in Figure 7A.
of the matrix was fit to a Gaussian mixture model with two components, and then each 1167 pulse response was classified as having most likely been produced by one of the two those in the other cluster were labeled "non-eruptions." We then measured the mutual 1170 information using the columns ∈ 0,1 ! to estimate the mutual information ! ; ! 1171 with ! the !" row of each . The mutual information was normalized to create the matrix !,! = ! ; ! ( ! ) and the upper triangle (excluding the diagonal) of this matrix (i.e. the normalized mutual 1173 information between each pair of cells) was plotted in Figure 5C. This was compared to 1174 all permutations of the above in which each row of was circularly permutated (that is, was replaced by ! where !,! ! = !,!"! ! !!! ! with a different ! for each row) to generate a shuffled sequence that had the same overall patterning as but in which the 1177 relationship between peak responses across cells is scrambled.

1179
All code for these analyses (and corresponding hypothesis testing) was written using the 1180 freely available Python packages numpy and pymc and is available on Github at 1181 https://github.com/CrickmoreRoguljaLabs.

1183
Hypothesis testing on proportions: To test the hypothesis that two sample proportions 1184 were drawn from the same Bernoulli process, we used Fisher's exact test.

1186
Credible intervals on means: We use the standard SEM estimator for variability of 1187 sample means = with ! the unbiased estimator of sample variance and 1188 the sample size, which corresponds to the 68% credible interval for the sample mean 1189 using the "improper" uniform prior.

1191
Hypothesis testing on distributions: We use the nonparametric Mann-Whitney U test on 1192 rank sums for differences in distributions of copulation duration. We then correct for

Analysis of mutual information between elapsed time and CaMKII activity:
We use the standard definition for the entropy of a random variable with domain and

1206
We can then define the conditional entropy to rewrite this as: or, evaluating the integral over :  green-Camuiα was within ! and dividing that by the total frames being considered (e.g.

1223
Analysis of mutual information between elapsed time and behavior:

1225
We use the same expression as for the analysis of green-Camuiα data, except now 1226 ∈ Long mating, normal mating . The value of > ) was computed using the mean 1227 from the Bayesian analysis described above when ∈ 0,1,5,6,7,8,10 (in minutes), the 1228 values for which we performed experiments and a linear interpolation between those 1229 values was used for otherwise.

1231
Evidence accumulation: We model the accumulation within cycle as ! = ! − ! where ! is the positive evidence accumulated (when the light is off), ! is the negative exponentially distributed, with the mean of ! being and the mean of ! being /(1 − ), with the duty cycle (the proportion of a cycle, on average, that the light is 1238 on). Exponential distributions were chosen because they are the maximum entropy 1239 distribution when the mean is specified, and so in a sense are maximally disordered.

1240
More explicitly: Then the evidence accumulated in a trial, ! , has the distribution 1242 where Θ( ) is the Heaviside theta function, Θ = 0 if < 0 and Θ = 1 otherwise.

1243
The above can be written as If < 0, then the is just 1 and we have that but if ≥ 0 we change the bounds of the integral to find We define = ! !!! so that the above expression simplifies to We then set a threshold and numerically approximated the distribution of the 1254 random variable !""#$ = inf | ! ≥ by generating 1,000 values of ! for each 1255 simulated fly according to the probability distribution above and measuring !""#$ for 1256 each fly. The simulated copulation duration was estimated with: 1257 = 6 + !""#$ + 18 where ~ 0,9 a normal random variable estimated from the data in Figure 7A, 18 1258 corresponds to the mean latency between the eruption and the termination of mating, 9 1259 = 3 2 the mean from Figure 7A, and 6 corresponds to the time for CaMKII to decay to 1260 baseline. This approximation was performed for 1000 flies for each parameter pairing

1261
, with = 4 to generate the predicted distributions in Figure 7E. If ! < for all ,

1262
was drawn from the Gaussian in Figure 1A,