Manuscript Offprint
arXiv:2610.09114A Connectome Test of the Fly Hashing Algorithm
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Sebastian Senge
Independent Researcher
Abstract—Dasgupta, Stevens and Navlakha (2017) showed that the Drosophila olfactory circuit, modelled as a random sparse projection followed by winner-take-all, is a locality-sensitive hash that beats classical LSH. The projection was random because the wiring was unknown. We test it against four electron-microscopy connectomes (MaleCNS, hemibrain, FlyWire, BANC; four animals, seven hemispheres) and report three findings. First, the 2017 pattern holds in a reimplementation of its protocol on SIFT, MNIST and odour mixtures (GloVe is near chance at short codes for every method): the fly hash beats k Gaussian projections at short hash lengths (3.1× in AP@200 on MNIST at k = 4). Second, against the tested real-valued Gaussian baseline that advantage is per active cell, not per operation: Gaussian projections given the same projection arithmetic retrieve better on every dataset and at every input dimension tested. Third, across four connectomes the measured pairing of glomeruli gives no consistent retrieval advantage over degree-preserving rewiring: retrieval is slightly lower (median -1.6%), and the small odour deficits depend on how missing odour responses are treated. Separately, equalising glomerular fan-out at fixed connection count improves retrieval in the model in every hemisphere, while equalising inputs per cell lowers it on average. Yet the fan-out profile is similar across the four sampled animals (median between-animal ), structural synapse counts do not offset it, and its relation to odour tuning is weak. In the sampled animals the circuit thus allocates Kenyon cells unevenly in a similar way, and in the model that unevenness costs retrieval. For practice: in the tested connectomes, measured wiring gives no consistent retrieval advantage over degree-preserving random wiring, so a fly hash needs no connectome data, and its advantage is per active unit, which may suit hardware where active units rather than arithmetic are the binding cost, a hypothesis we do not test.
Index Terms—connectomics, locality-sensitive hashing, similarity search, replication
I. INTRODUCTION
Locality-sensitive hashing (LSH) maps items to short codes under which similar items collide with high probability [1], [2]. Dasgupta et al. [3] noticed that the fly olfactory circuit computes a related transform (Fig. 1a; Section II). On SIFT, GloVe and MNIST this fly hash beat classical LSH by up to about . The projection was random, following the account that the wiring is effectively random [4].
That account has since been revised: projection-neuron input to Kenyon cells is structured [5], and four connectomes now give the complete projection [6], [10], [11], [13]. We ask whether the random matrix was a harmless idealisation for the task that motivated it; [5] studied odour discrimination, not retrieval. Our contributions:
-
a reimplementation of the 2017 protocol with documented provenance, extended with odour mixtures, that recovers the published pattern;
-
a budget analysis showing that, against real-valued Gaussian projections, the fly hash’s advantage is per active cell and not per operation;
-
a comparison of the fly hash across four connectomes and seven hemispheres, on the 2017 benchmarks and on measured odour responses, against degree-preserving rewiring and against controls that change one degree sequence at a time at equal connection count;
-
the observation that the fan-out skew that costs retrieval in the model is similar across the four sampled animals, is not offset by structural synapse counts, and is only weakly related to odour tuning.
The fly olfactory pathway. An odour activates olfactory receptor neurons in the antennae. Neurons that express the same receptor type all converge onto one small, anatomically identifiable structure in the antennal lobe, a glomerulus; the fly has about 50 olfactory glomeruli, so an odour is first represented as a vector of about 50 glomerular activities. Projection neurons carry each glomerulus's signal to the mushroom body, where about 2,000 Kenyon cells per hemisphere each receive input from a handful of glomeruli. A single inhibitory neuron (APL) feeds back onto all Kenyon cells, so that only the most strongly driven few percent fire. This sparse set of active Kenyon cells is the fly's code for the odour and the basis of associative memory [3], [4]. In this paper M is the glomerulus-to-Kenyon-cell part of that pathway: which glomeruli each Kenyon cell receives input from.
Similarity search and hashing. Nearest-neighbour search asks, for a query item, which stored items are most similar to it. Exhaustive comparison is expensive for large collections, so approximate methods first map items to short hashes and compare those instead. A hash is locality-sensitive if similar items receive similar hashes with high probability [1]. The classical construction multiplies the input by a random Gaussian matrix and keeps the k projected values, or their signs, as the hash [2]. The fly hash of [3] replaces the dense matrix with the sparse binary glomerulus-to-Kenyon-cell matrix, expands rather than compresses the dimension, and keeps as the hash the identities of the k most active Kenyon cells (Fig. 1a). Retrieval quality
(a) fly hash
glomeruli (d) Kenyon cells (m) tag

(b) fan-out, 7 hemispheres

49 glomeruli, by mean fan-out
(c) inputs per cell

Fig. 1. (a) The fly hash: glomerular input x is expanded through a binary projection M onto Kenyon cells and the k most active cells form the tag. (b) Glomeruli reach very different numbers of Kenyon cells, and the profile is similar across the sampled hemispheres: relative fan-out of the 49 shared glomeruli in all seven, ordered by the mean; the dashed line is even fan-out. (c) Inputs per Kenyon cell, against the six of the 2017 construction.
is the agreement between the neighbours found through the hashes and the true neighbours.
III. RELATED WORK
The fly hash has been extended with dense pseudo-hashes and multi-probe binning [20], and with projections learned by local plasticity rules [14], [15]; these change the algorithm, whereas we keep it and change only the matrix. On the biological side, random convergence of projection-neuron input was reported from anatomical tracing [4]; electron microscopy later mapped the mushroom body completely in the larva [16] and in the adult hemibrain [17], and found structured sampling in FAFB, where simulated odour discrimination was worse than with random wiring [5]. None of these studies evaluated similarity search, the task behind the hashing interpretation. Theory of expansion layers predicts that a small number of inputs per cell is optimal for the mushroom body and the cerebellum [19]; our controls instead vary how evenly inputs and outputs are distributed at a fixed total.
IV. METHODS
A. Connectomes and matrices
Let with iff glomerulus j connects to Kenyon cell i. For every connectome the same rule applies: uniglomerular olfactory projection neurons are assigned to glomeruli by cell type (multiglomerular, thermo- and hygrosensory types excluded), Kenyon cells are those annotated on the same side, every reconstructed connection counts (no synapse threshold), and cells without olfactory input are dropped. Hemibrain glomerulus names are mapped to current nomenclature via the cross-dataset matches of [12]. We use MaleCNS v1.0 (male, both hemispheres), hemibrain v1.2 (female, right), FlyWire v783 and BANC v888 (female, both). All share 49 glomeruli; they have 1,761 to 2,406 Kenyon cells with 5.00 to 6.05 inputs per cell. The datasets differ in imaging, synapse detection and proofreading, so part of any difference between them is technical. The primary connectome is MaleCNS right (d = 51, m = 1,886).
Only M changes between conditions. The null is uniform over binary matrices with the same row and column sums as M, sampled by curveball trades [7], [8] (30 per cell; co-occurrence is stable from 1 sweep on); it keeps both degree sequences and randomises which glomeruli share a cell, and tests against it are approximate Monte Carlo randomization tests. Equal-connection controls have exactly nnz(M) ones with inputs per cell made even, fan-out made even, or both, and random pairing. The 2017 construction gives each cell six uniform inputs, changing both degree sequences and the connection count.
B. Hash, scores and budgets
The fly hash computes and sets the largest entries of to one; cells tied at the threshold drive are taken in index order (a random tie priority is a sensitivity analysis). Retrieval is scored by over the true neighbours, so neighbours never retrieved count as misses, together with recall@ . LSH computes Gaussian projections kept as real values, as in the 2017 comparison, or their signs for bit codes. Budgets are per active cell ( projections for winners), per stored bit, and per operation, counted as projection arithmetic as in [3]: multiplications and additions per projection, one addition per non-zero of ; winner selection, retrieval and any PCA fit are excluded.
C. Approach 1: the 2017 protocol
Table I gives the protocol and the source of each element; we add 10,000 mixtures of DoOR odour profiles as a fourth dataset. The 2017 paper reports “mean average precision” without a formula. Precision averaged over retrieved true neighbours only, a convention in parts of the hashing literature, reproduces its LSH baseline (MNIST, k = 4: 0.159 against 0.160) but not its fly score (0.365 against 0.448). That score ignores misses, so we report AP@200 and recall@200 and compare with the paper through orderings and ratios. With a connectome, M accepts only its own glomeruli: odours use the glomeruli DoOR covers, and SIFT, GloVe and MNIST are reduced by PCA to one component per glomerulus of
TABLE I PROVENANCE OF THE PROTOCOL: 2017 MAIN TEXT [3], 2018 FLYLSH CODE [20], OR OUR CHOICE.
| element | choice | source |
|---|---|---|
| data | 10,000 vectors: SIFT-small base, GloVe 6B 300d and MNIST train (seeded subsets) | 2017 (size); ours |
| queries, truth | 1,000 queries; top 2% by Euclidean distance on raw features | 2017 |
| preprocessing | each vector centred by its own mean | 2017 |
| fly | or ; top- winners | 2017 |
| sampling | each cell samples 10% of inputs | 2018 code |
| tag | binary; Hamming distance, random tie-break | 2018 code; ours |
| LSH | real-valued Gaussian projections | 2017 |
| score | AP@200 and recall@200 | ours (2017: unde-fined “mAP”) |
| trials | 50; matrices and queries redrawn | 2017 |
that connectome (49 or 51), assigned to glomeruli by a fresh random permutation in each trial, so these datasets test the wiring's statistics, not its odour-specific pairing. Each connectome is scored against 50 nulls and one draw of each control per trial.
D. Approach 2: odour analysis
Responses are the DoOR 2.0 consensus matrix [9] (commit db323a4). Coverage is uneven: 35 glomeruli are measured for 51 or more odorants, eleven for 12 to 24, five for none. We keep the 35 (our threshold of 40 odorants falls in that gap) and odorants measured on at least 12 of them: 172 odorants, of entries unmeasured and set to zero. The benchmark is 4,000 linear mixtures of two to five profiles, normalised to unit mean as in the circuit, with the nearest items on raw responses as ground truth. The primary size (5% of cells) and secondary sizes were fixed in an earlier revision, after first results had been seen; this is not a preregistration. MaleCNS is tested against 200 nulls with a two-stage bootstrap (resampled odorants, regenerated mixtures, 20 nulls drawn from the same pool per replicate, 200 replicates) and a equivalence margin; every hemisphere is tested against 2000 nulls on its own DoOR glomeruli and against 100 on the 34 shared ones. Null ensembles of this size, and the audit of weak connections below, were pre-registered (experiments/PREREGISTRATION_2026-09-28.md) after an earlier version of this analysis had used 100 nulls.
V. RESULTS
A. The 2017 pattern holds
With random matrices the published ordering is recovered on SIFT, MNIST and odours (Fig. 2): random tag selection performs like LSH, as [3] argue it must, winner-take-all at beats both, and does better still. The advantage is largest at short hash lengths (3.1× on MNIST at ; recall 1.7×; 1.7× on odours) and shrinks with ; on odours and GloVe LSH overtakes the fly hash from . Scoring against neighbours on centred input, as the FlyLSH code does, leaves the MNIST ratio at 3.1×. GloVe is close to chance at small for every method.
TABLE II ODOUR ANALYSIS, MALECNS: AP@10 OF THE FLY HASH AND OF ONE-BIT GAUSSIAN CODES (BITS IN PARENtheses).
| k | fly | sign, k bits | storage-matched | operation-matched |
|---|---|---|---|---|
| 8 | 0.197 | 0.019 | 0.264 (72) | 0.305 (102) |
| 16 | 0.288 | 0.069 | 0.340 (130) | 0.305 (102) |
| 32 | 0.353 | 0.151 | 0.394 (229) | 0.305 (102) |
| 64 | 0.396 | 0.249 | 0.436 (397) | 0.305 (102) |
| 92 | 0.406 | 0.296 | 0.454 (523) | 0.305 (102) |
TABLE III ODOUR ANALYSIS, MALECNS: CONNECTOME AGAINST THE NULL (B = 200) AND COMPARISON MATRICES (RELATIVE TO THE NULL MEAN, %). *PRIMARY.
| k | conn. | null | Δ% | p | fan flat | 6 unif. | balanced | |
|---|---|---|---|---|---|---|---|---|
| 8 | 0.1973 | 0.2034 ± 0.0085 | -3.0 | 0.468 | 1.000 | +3.7 | +26.7 | +3.2 |
| 16 | 0.2879 | 0.2933 ± 0.0062 | -1.8 | 0.438 | 1.000 | +2.7 | +9.7 | +3.2 |
| 32 | 0.3531 | 0.3575 ± 0.0045 | -1.2 | 0.338 | 1.000 | +3.3 | +3.0 | +3.6 |
| 64 | 0.3963 | 0.4001 ± 0.0039 | -0.9 | 0.348 | 1.000 | +3.4 | +0.7 | +3.4 |
| 92* | 0.4063 | 0.4148 ± 0.0035 | -2.1 | 0.020 | - | +3.2 | +0.1 | +3.2 |
B. Against real-valued LSH, the advantage is per active cell, not per operation
The 2017 comparison sets active cells against projections, which equates projection arithmetic only at . The headline network has cells sampling about inputs each: roughly additions against for LSH, a factor near (98× on MNIST at ). Varying the input dimension of one dataset (Fig. 3a) shows both sides: per active cell, the fly hash trails LSH at , ties at 16 and leads from 32 on, though not monotonically; given equal arithmetic, real-valued LSH leads at every . With a random tie priority among Kenyon cells the fly/LSH ratio at is 0.07 at and 1.04 at (index order: 0.31 and 1.01): the fly hash trails at and reaches parity by under both rules, but the value at depends on the rule. The same holds on all four datasets (Fig. 3b, c), for random matrices (LSH 0.31–0.81 AP) and for the connectome, whose nnz() additions buy 98 projections on image and word input and 102 on odours; these beat it on 4 of 4 datasets. “Best” is the best over the tested hash lengths.
One-bit codes are weaker than real-valued projections, and against them the comparison is closer (Table II): on odours the fly hash beats sign codes of bits ( at the primary size), trails at matched storage (), and at matched operations trails for small and leads from ().
C. Connectomes behave like degree-preserving random matrices
Substituting a connectome for the random matrix keeps the fly hash's advantage: it leads LSH on MNIST at by in every hemisphere (Table V). Against its own null it is close but slightly worse (Fig. 4b): across 168 hemisphere, dataset and size combinations the median difference is (interquartile range to ), negative in 134, below every null draw in 59 and above every draw in 2, with a negative mean in 4 of 4 animals. These are descriptive counts

LSH, k projections
random selection,
fly hash,
fly hash,
Fig. 2. The 2017 protocol with random matrices: AP@200 against hash length, mean SD of 50 trials. Random tag selection performs like LSH; winner-take-all at and beats both at short hash lengths.
(a) varying , one dataset

(b) random matrices

(c) MaleCNS connectome

Fig. 3. (a) One dataset at several input dimensions (MNIST reduced by PCA to ; PCA also changes the retained information and the integer sampling rate), : the fly hash's lead over LSH per active cell grows with , but LSH given the same projection arithmetic as the fly leads at every . (b, c) Best AP of the fly hash over the tested hash lengths against real-valued LSH with the same projection arithmetic: (b) random matrices on the original inputs, (c) the MaleCNS connectome on its own inputs. Inputs and ground truth differ between (b) and (c); only pairs within a panel are comparable.
TABLE IV ODOUR ANALYSIS, MALECNS, PRIMARY SIZE, ONE-FACTOR VARIATIONS (B = 40 NULLS EACH): RELATIVE DIFFERENCE (%) AND TWO-SIDED p.
| variation | Δ% | p |
|---|---|---|
| Baseline | -2.2 | 0.049 |
| Left hemisphere | -1.1 | 0.244 |
| ≥5-synapse threshold | -2.3 | 0.098 |
| Missing data (3 imputations) | -0.7 to +0.6 | 0.439–0.780 |
| Coverage thresholds (2) | -1.7 to -1.4 | 0.049–0.341 |
| All 46 glomeruli with data, imputed | -0.0 | 1.000 |
| Mixture seeds (4) | -2.4 to -1.6 | 0.049–0.244 |
| Mixture size 2 / 2–10 | -2.0 to -0.9 | 0.146–0.195 |
| Measured odorants only | -3.9 | 0.049 |
| Normalised / angular metric | -2.4 to -1.7 | 0.049 |
| Tie rules (index, include, 2 seeds) | -2.4 to -2.1 | 0.049 |
| Synapse-weighted | -1.1 | 0.488 |
| Synthetic inputs (3) | -3.1 to +0.8 | 0.049–0.244 |
over dependent conditions, not independent replications. Seven hemispheres come from four animals and are not independent; one male cannot separate sex from individual or reconstruction differences.
On odours (Fig. 4c) the difference at the primary size is negative in all 7 hemispheres, -3.1% to -0.7%, and -3.0% to -0.0% on the shared glomeruli. The sign is consistent: 4 unadjusted p-values are below 0.05, and after Holm adjustment across the seven hemispheres 2 remain, FlyWire R and BANC R (smallest adjusted ; on the shared glomeruli, with the smaller ensemble, the smallest is 0.139). In the full MaleCNS analysis (Fig. 4a, Table III) the connectome scores 0.4063 against , -2.06% (two-sided ; 0.100 with all five sizes as one family); the bootstrap 90% interval is -3.1% to -0.8%, which lies within the chosen margin but not within ; in a simulation from one fitted generator, this interval covered the true value in 100% of 100 datasets, which calibrates it for that generator only, and the two-sided test has 80% power at 2.5% downward and 3.0% upward. Across 26 one-factor variations (Table IV) the deficit ranges from -3.9% to +0.8%, and it depends on the input: imputing unmeasured responses gives -0.7% to +0.6% (), and all 46 glomeruli with data give no difference.
By Q the pairing departs from its null in 6 of 7 hemispheres (Q z from 0.0 to 17.8; 6 after Holm adjustment over seven, adjusted ), consistent with [5]. The hemibrain is indistinguishable from its null when every connection is counted, but not once single-synapse connections are removed: at two or more synapses per glomerulus–cell pair its Q is above the null ( , p = 0.002), as it is in all 7 hemispheres. Its apparent exception is a property of its weakest connections. Under these protocols the observed structure did not coincide with a consistent retrieval advantage; seven


Fig. 4. Connectome against its own null (AP relative to the null mean). (a) Odour analysis, MaleCNS right: orange, 200 null matrices; blue, the connectome. (b) The 2017 protocol in seven hemispheres: four datasets × six hash lengths each, bar at the median. (c) Odour analysis at the primary size in every hemisphere, on its own DoOR glomeruli and on the 34 all share.
TABLE V SEVEN HEMISPHERES OF FOUR ANIMALS: KENYON CELLS, MEAN INPUTS PER CELL, FAN-OUT COEFFICIENT OF VARIATION, CO-OCCURRENCE Q AS z AGAINST 1000 NULLS; ODOUR ANALYSIS AT THE PRIMARY SIZE ON OWN GLOMERULI (2000 NULLS, FLOOR 0.001) AND ON SHARED GLOMERULI (100 NULLS) (RELATIVE DIFFERENCE %, UNADJUSTED p); MEDIAN OVER THE 2017-PROTOCOL RUNS (4 DATASETS × 6 SIZES, B = 50, 5 TRIALS); FLY HASH OVER LSH ON MNIST AT k = 4.
| hemisphere | sex | cells | inputs | fan CV | Q z | odours Δ% (p) | shared Δ% (p) | protocol median Δ% | fly/LSH |
|---|---|---|---|---|---|---|---|---|---|
| MaleCNS R | m | 1,886 | 5.28 | 0.53 | +2.7 | -2.2 (0.015) | -2.6 (0.020) | -1.3 | 2.3 |
| MaleCNS L | m | 1,865 | 5.30 | 0.54 | +4.8 | -0.9 (0.294) | -0.8 (0.376) | -1.0 | 2.2 |
| Hemibrain R | f | 1,761 | 6.05 | 0.50 | +0.0 | -0.7 (0.491) | -0.0 (0.990) | -1.1 | 2.3 |
| FlyWire R | f | 2,406 | 5.00 | 0.47 | +11.3 | -2.7 (0.001) | -2.7 (0.020) | -0.7 | 2.4 |
| FlyWire L | f | 2,378 | 5.12 | 0.49 | +17.8 | -1.6 (0.037) | -1.6 (0.079) | -2.0 | 2.9 |
| BANC R | f | 2,046 | 5.03 | 0.57 | +6.2 | -3.1 (0.003) | -3.0 (0.020) | -3.2 | 2.3 |
| BANC L | f | 2,089 | 5.18 | 0.55 | +8.7 | -1.3 (0.168) | -2.2 (0.059) | -3.1 | 2.3 |
hemispheres do not allow a general statement about structure and retrieval.
D. Equalising fan-out improves retrieval in the model
The comparison with the null concerns the pairing alone: connectome and null share both degree sequences, so neither sequence can explain the difference between them. We asked separately whether the measured degree sequences limit retrieval relative to more regular random matrices at the same connection count, changing one sequence at a time (Fig. 5). These are interventions within the model, compared with each trial's own null mean.
In MaleCNS right, making fan-out even, so that every glomerulus reaches the same number of Kenyon cells, raises AP on image and word input by +3% to +17% across datasets and hash sizes, with the interval above zero in 17 of 18 cases, and on odours by +1% to +3% (4 of 6). Making inputs per cell even has mixed effects: -7% to +8% on image and word input (interval above zero in 2, below in 11), and -3% to +19% on odours, largest at the smallest hash sizes. Averaged over datasets and sizes (Fig. 5b), even fan-out raises AP in all 7 hemispheres (+3.9% to +6.4%, every interval above zero), whereas even inputs per cell lowers it in all 7 (-4.2% to -1.1%, every interval below zero); its gains are confined to some small hash sizes. The six-input construction of 2017 behaves like the even-fan-out control. The measured fan-out is strongly skewed (up to 473 cells for DC1 in MaleCNS right, against a mean near 195). This shows that more even fan-out would retrieve better at equal cost in this model, not that the skew is a biological cost: it may serve other ends.
TABLE VI NOVELTY DETECTION AND NEAREST-NEIGHBOUR CLASSIFICATION (MALECNS RIGHT, 10 TRIALS): NULL MEAN, AND DIFFERENCE TO IT FOR THE CONNECTOME, THE EQUAL-CONNECTION CONTROLS AND THE SIX-INPUT CONSTRUCTION. 95% INTERVAL EXCLUDES ZERO.
| task | null | conn. | fan-out even | inputs even | both | six |
|---|---|---|---|---|---|---|
| Novelty, MNIST (AUC) | 0.741 | -0.006 | +0.003 | -0.009 | ||
| FlyNN-style, MNIST (accuracy) | 0.700 | -0.001 | ||||
| Novelty, odours (AUC) | 0.560 | -0.003 | -0.001 | -0.002 |
Row-centring, part of the 2017 protocol, alters winner order only when inputs per cell differ. Removing it changes the connectome's AP on image and word input by -7% to -5% at the smallest hash size and by at most 2% at the largest, and changes the odour results strongly at small k, where drive on non-negative input then tracks the number of inputs (supplement).
(a) MaleCNS R, largest k

(b) every hemisphere, all datasets and k

Fig. 5. Equal-connection degree controls, AP@200 relative to the null mean (ratio of trial means), with 95% bootstrap intervals over trials, each trial paired with its own null mean. (a) MaleCNS right at the largest hash size (20 trials, 10 nulls). (b) All hemispheres, averaged over the four datasets and six hash sizes.
E. Novelty detection and nearest-neighbour classification
The fly hash has also been proposed as a novelty detector, a Bloom filter whose Kenyon-cell output synapses are depressed by stored items [24], and as a nearest-neighbour classifier with one such filter per class [18]. We use a static graded surrogate of that filter, not a reproduction of its dynamics: after storing n items, cell j's output weight is with the number of stored items that activated it, and a query's novelty is the mean over its k active cells (the binary filter saturates at these sizes); the classifier predicts the class whose filter finds the query least novel. This analysis is exploratory: MaleCNS right, 10 trials, 10 null matrices reused across trials, unadjusted 95% intervals of the difference to each trial's null mean. Protocol: MNIST uses 6,000 images per trial, PCA to one component per glomerulus with a random component-to-glomerulus assignment, row-centred, 4,000 for storing and 2,000 held out as queries, (5% of the cells); odours use 3,000 stored mixtures and 500 familiar plus 500 novel queries on the measured glomeruli, . With these settings, the connectome differs from its null by -0.006 [-0.016, +0.003] in MNIST novelty AUC (null 0.741; digits 0–4 stored, held-out 0–4 familiar, 5–9 novel), -0.009 [-0.017, -0.000] in ten-class accuracy (null 0.700) and -0.003 [-0.007, +0.001] in odour novelty AUC (null 0.560; mixtures of half of the odorants stored, mixtures of the other half novel). Even fan-out gives +0.003 [-0.010, +0.017], +0.010 [+0.004, +0.017] and -0.007 [-0.014, -0.001]; even inputs -0.015 [-0.023, -0.008], -0.009 [-0.013, -0.003] and -0.001 [-0.005, +0.003] (Table VI). The pairing again gives no advantage. Even fan-out raises MNIST classification accuracy, has no resolvable effect on MNIST novelty, and lowers odour novelty in this experiment.
F. The fan-out profile is similar across the sampled animals
Across the four sampled connectomes the fan-out profile is similar (Fig. 1b): over the 49 glomeruli all hemispheres share, relative fan-out correlates between animals at Spearman to 0.95 (median 0.86) and between the two hemispheres of one animal at 0.80 to 0.94; it spans a factor of about 17, from DP1m, DM1, DC1, DM2, VA2 at the top to DA4m, DA3, VL1 at the bottom. This is a descriptive comparison of four animals, not a population estimate, and shared cell-type definitions, nomenclature mapping or systematic reconstruction biases could contribute to the similarity. That some glomeruli are over-represented was reported by [4] and, as structured sampling of food-related types, by [5]; new here is the comparison across reconstructions and its retrieval cost in the model. A separate anatomical observation is that structural synapse counts do not offset the skew: the mean number of synapses per connection correlates positively with fan-out in 6 of 7 hemispheres ( from -0.13 to +0.66, nominal in 2, unadjusted), so in those hemispheres the summed synapse count per glomerulus is even more uneven than fan-out. These are counts of reconstructed synapses, not physiological efficacies, and the retrieval model is binary and does not use them; the retrieval cost above was shown for binary fan-out only. Its relation to odour tuning in DoOR is weak: over measured odorants, fan-out correlates with response breadth at to +0.30 (smallest ) and with response SD at +0.24 to +0.40 (nominal in 2). These seven dependent correlations per measure share one odour panel and similar fan-out profiles; we treat them as descriptive, uncorrected associations rather than independent replications.
VI. Discussion
Under these retrieval protocols, the measured pairing gives no consistent advantage over degree-preserving random wiring: four connectomes keep the fly hash's per-cell advantage and retrieve within a few percent of their rewirings, slightly lower, in the direction reported for odour discrimination by [5]; the small odour deficits depend on the input model. The 2017 construction, which differs from both in its degree sequences, retrieves better than either, and the controls attribute that mainly to its even fan-out. The measured skew in fan-out may serve other ends, such as innate valence [5] or novelty detection [24], which we do not test.
The algorithmic claim needs a qualifier. Against the tested real-valued Gaussian baseline the fly hash's advantage is per active cell: Gaussian projections given the same projection arithmetic retrieve better on every dataset and input dimension we tested. Against one-bit codes, and at the circuit's own scale, the comparison is closer. The random construction of 2017 already has nearly even fan-out, so the fan-out result is not an improvement over the standard fly hash; it locates where the circuit departs from it. That departure looks similar in all four sampled animals, and structural synapse counts do not offset it. In the binary model, a circuit that gives more Kenyon cells to the same glomeruli pays for it in generic similarity search under these protocols (that most sampled hemispheres also place more synapses per connection on those glomeruli is an anatomical observation the model does not use); what it gains in return, for instance in innate or learned valence of the food-related glomeruli near the top of the ranking [5], is a question these results raise but do not answer.
VII. LIMITATIONS
Four animals, one male; differences between connectomes mix biology and reconstruction. Our reimplementation recovers the published pattern but not its absolute values, and two protocol details come from later code. Image and word input is compressed to one PCA component per glomerulus and assigned to glomeruli arbitrarily. The cross-connectome protocol runs use 50 nulls and are effect estimates. The odour deficit depends on treating unmeasured DoOR entries as zero. The model is binary and rate-free and ignores inhibition beyond winner-take-all.
VIII. Conclusion
In a documented reimplementation, sparse winner-take-all codes outperform equally many real Gaussian projections at short hash lengths. Across four connectomes, measured wiring gives no consistent retrieval advantage over degree-preserving random wiring, and is slightly worse on average under the tested inputs. Separately, in the model, the circuit's skewed glomerular fan-out, which is similar across the sampled animals, costs retrieval relative to even fan-out at equal connection count. A fly hash therefore needs no connectome data, and in the tested generic-retrieval model random sparse wiring with even fan-out does at least as well as the measured wiring. The algorithm's advantage over real-valued LSH is per active unit, not per operation: where arithmetic is cheap, dense Gaussian projections retrieve better; where active units are the binding cost, as may hold for sparse or neuromorphic hardware, the fly hash could be the better choice, which direct hardware measurement would have to show. The pre-registration that fixed the null ensembles of Section IV-D also contained three algorithmic and theory experiments outside this comparison; none met its registered criterion, and experiments/OUTCOMES_2026-09-28.md reports them. Code, data checksums, results and a supplement are at https://github.com/ssenge/FlyHash-Connectome.
ACKNOWLEDGMENT
Claude (by Anthropic) was used as a coding and analysis assistant; the author designed the study.
REFERENCES
[1] P. Indyk and R. Motwani, “Approximate nearest neighbors: towards removing the curse of dimensionality,” in Proc. 30th ACM STOC, 1998, pp. 604–613.
[2] M. S. Charikar, “Similarity estimation techniques from rounding algorithms,” in Proc. 34th ACM STOC, 2002, pp. 380–388.
[3] S. Dasgupta, C. F. Stevens, and S. Navlakha, “A neural algorithm for a fundamental computing problem,” Science, vol. 358, no. 6364, pp. 793–796, 2017.
[4] S. J. C. Caron, V. Ruta, L. F. Abbott, and R. Axel, “Random convergence of olfactory inputs in the Drosophila mushroom body,” Nature, vol. 497, pp. 113–117, 2013.
[5] Z. Zheng et al., “Structured sampling of olfactory input by the fly mushroom body,” Current Biology, vol. 32, no. 15, pp. 3334–3349, 2022.
[6] S. Berg, I. R. Beckett, M. Costa, P. Schlegel, M. Januszewski, E. C. Marin, et al., “Sexual dimorphism in the complete Drosophila male central nervous system connectome,” Cell, 2026, doi:10.1016/j.cell.2026.08.015.
[7] G. Strona, D. Nappo, F. Boccacci, S. Fattorini, and J. San-Miguel-Ayanz, "A fast and unbiased procedure to randomize ecological matrices with fixed row and column totals," Nature Communications, vol. 5, art. 4114, 2014.
[8] C. J. Carstens, “Proof of uniform sampling of binary matrices with fixed row sums and column sums for the fast Curveball algorithm,” Physical Review E, vol. 91, art. 042812, 2015.
[9] D. Münch and C. G. Galizia, “DoOR 2.0 — comprehensive mapping of Drosophila melanogaster odorant responses,” Scientific Reports, vol. 6, art. 21841, 2016.
[10] L. K. Scheffer et al., “A connectome and analysis of the adult Drosophila central brain,” eLife, vol. 9, e57443, 2020.
[11] S. Dorkenwald et al., “Neuronal wiring diagram of an adult brain,” Nature, vol. 634, pp. 124–138, 2024.
[12] P. Schlegel et al., “Whole-brain annotation and multi-connectome cell typing of Drosophila,” Nature, vol. 634, pp. 139–152, 2024.
[13] A. S. Bates et al., “Distributed control circuits across a brain-and-cord connectome,” Nature, 2026, doi:10.1038/s41586-026-10735-w.
[14] C. K. Ryali, J. J. Hopfield, L. Grinberg, and D. Krotov, “Bio-inspired hashing for unsupervised similarity search,” in Proc. ICML, 2020, pp. 8295–8306.
[15] Y. Liang, C. K. Ryali, B. Hoover, L. Grinberg, S. Navlakha, M. J. Zaki, and D. Krotov, “Can a fruit fly learn word embeddings?” in Proc. ICLR, 2021.
[16] K. Eichler et al., “The complete connectome of a learning and memory centre in an insect brain,” Nature, vol. 548, pp. 175–182, 2017.
[17] F. Li et al., “The connectome of the adult Drosophila mushroom body provides insights into function,” eLife, vol. 9, e62576, 2020.
[18] P. Ram and K. Sinha, “Federated nearest neighbor classification with a colony of fruit-flies,” in Proc. AAAI, 2022, pp. 8036–8044.
[19] A. Litwin-Kumar, K. D. Harris, R. Axel, H. Sompolinsky, and L. F. Abbott, “Optimal degrees of synaptic connectivity,” Neuron, vol. 93, no. 5, pp. 1153–1164, 2017.
[20] J. Sharma and S. Navlakha, “Improving similarity search with high-dimensional locality-sensitive hashing,” arXiv:1812.01844, 2018.
[21] H. Jégou, M. Douze, and C. Schmid, “Product quantization for nearest neighbor search,” IEEE Trans. Pattern Anal. Mach. Intell., vol. 33, no. 1, pp. 117–128, 2011.
[22] J. Pennington, R. Socher, and C. D. Manning, “GloVe: global vectors for word representation,” in Proc. EMNLP, 2014, pp. 1532–1543.
[23] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proc. IEEE, vol. 86, no. 11, pp. 2278–2324, 1998.
[24] S. Dasgupta, T. C. Sheehan, C. F. Stevens, and S. Navlakha, “A neural data structure for novelty detection,” Proc. Natl. Acad. Sci. USA, vol. 115, no. 51, pp. 13093–13098, 2018.