Deep Learning A to Z · Fruit Fly Special 2

Learned memories are retrieved through the instinct circuit

A fly smells odor A, recalls an electric shock, and so it avoids the odor. This brief "thought" passes through two places. First, the learning center (mushroom body) retrieves the memory "A was dangerous," and only when that memory crosses over to a convergence neuron in the instinct center (lateral horn) does it become behavior. The same convergence neuron also handles the innate behavior of approaching food odors. Learned and innate information meet in a single neuron.

There are a lot of unfamiliar names. Learn the nicknames first in the Meet the cast section below. In the text, hover over or tap any name with a dotted underline to see what it means.

Dolan, Belliart-Guérin et al. (2018). Communication from Learned to Innate Olfactory Processing Centers Is Required for Memory Retrieval in Drosophila. Neuron 100(3):651–668.

2018Published in Neuron [R1]
2 rolesJobs of the convergence neuron: memory retrieval + attraction to food odors [R1]
7 stepsFrom anatomy to behavior: how the convergence neuron was found
6 + 5Cast: six neurons · five experimental tools
1.0 · 0.6Model lab convergence formula: instinct × 1.0 + memory × 0.6 (for illustration)
2Code notebooks that run right away in Colab
Names

Meet the cast — let's use nicknames instead of hard names

The names in the paper are like "ID numbers" that researchers give neurons to tell them apart. This page uses the nicknames below and writes the paper's names alongside in parentheses or small print.

Six neurons, in the order the signal meets them

Five experimental tools the researchers used

How to read the paper's names

PD2a1

PD2a1 = the name of the path the cell's main fiber takes through the brain (PD2) + a shape group within that path (a) + a cell type number (1). PD2b1 is group b of the same path. Together they are written "PD2a1/b1," and on this page we call them the convergence neuron.

MBONα2sc

MBON-α2sc = short for Mushroom Body Output Neuron + it receives input in the second compartment of the mushroom body's α lobe + a code that distinguishes it from other output neurons in the same compartment. On this page we call it the memory output neuron.

In the end, the paper's story fits in one sentence: the fly avoids an odor only when the memory output neuron's "that smell was dangerous" signal passes through the convergence neuron.

3D

The path a memory takes through the brain

A green signal starts at the odor input, passes through the mushroom body, exits via the memory output neuron, and then crosses over to the convergence neuron in the lateral horn. Food-odor signals from the antennal lobe also enter the lateral horn directly. Drag to rotate.

Region

Press a region button to highlight that part and show its description.

1

The question — are instinct and learning really processed separately?

Textbook diagrams split the two pathways neatly: the lateral horn for innate behavior, the mushroom body for learned behavior. But whether the lateral horn really handles only instinct had never been tested directly.

The previous model vs. this paper's model

Press the buttons to switch between the two diagrams. Only one thing changes: the connection from the mushroom body output neuron (the memory output neuron) to the lateral horn.

How the experiment works — train, wait, test

This is the basic procedure for a fruit fly memory experiment. The left side shows what the flies go through; the right side uses a neural network diagram to show how the connections (weights) inside the mushroom body change along the way. Learning happens during training, and in the test phase the changed connections show up as behavior.

Training ① odor A + shock→ Training ② odor B only→ Wait · memory kept→ Test · T-maze

The fact that started it all

The memory output neuron is a mushroom body output neuron that is essential for retrieving aversive memories — memories that make a fly avoid an odor it learned to pair with an electric shock. And this neuron's axon extends into the lateral horn. The researchers asked two questions: Is memory information really passed to the lateral horn? And is that transfer necessary for retrieving the memory?

2

How they found it — seven steps from anatomy to behavior

This is the sequence they used to find out "who receives the memory output neuron's signal," confirm it, switch it off, and look inside. Click each step to see the method and a similar task in deep learning.

3

Experiment ① — switch off the convergence neuron and the memory can't be retrieved

A temperature-sensitive blocking protein (Shits) is put into specific neurons only, and the temperature is raised only during the test to block those neurons' output. It's the same logic as an ablation study in deep learning.

Pick a neuron and switch it off

Bar heights are schematic, showing only the direction of the results. The two control groups are flies carrying only one half of the genetic system; they check that the temperature itself or the gene insertion alone doesn't lower memory.

Neuron to switch off
Memory type
Temperature during test

Both the bars and the maze are schematics showing the direction of the results. The better the memory, the more flies avoid odor A (paired with the shock) and head toward B.

It's not because instinct processing broke down

Even with the convergence neuron switched off, the flies' natural avoidance of the two training odors (at the same concentrations) stayed the same. That means the memory score didn't drop because the flies lost their sense of smell or their innate responses were damaged.

Schematic. It shows only the direction of the result: innate avoidance was similar in the control and blocked groups.

4

Experiment ② — training changes the convergence neuron's response

Calcium imaging is a method that watches the rise in calcium inside a neuron when it is active, as fluorescence brightness. After training, the convergence neuron's response to the odor was weakened, in the same direction as the memory output neuron's.

Responses to the same odor, before and after training

Try switching the neuron and the condition. The graph is a schematic showing only direction; for actual magnitudes and protocols, see the figures in the paper.

Seen through deep learning — change one layer's weights and the activations after it change too

Fruit fly

Learning happens in connections inside the mushroom body (Kenyon cell → MBON). As a result, the memory output neuron's output changes, and the response of the lateral horn convergence neuron that receives this signal changes along with it. This experiment alone can't tell whether the convergence neuron's own connections changed.

Neural network

Even if you fine-tune only the middle layer W2, the activations of the later layers h3 and h4 all change for the same input. It's the same reason you can't conclude "learning happened here" just from a change in activations.

h2 = f(W2′·h1) → h3 = f(W3·h2) changes too
5

Experiment ③ — one neuron, two roles

When they traced the convergence neuron's inputs in whole-brain electron microscopy data, they found direct input from antennal lobe projection neurons carrying food odors. And indeed, switching off the convergence neuron also weakened the innate attraction to some odors.

Three signals that converge on the convergence neuron

Click a circle to see what each input carries.

Innate behavior of approaching food odors

Schematic. It shows only the direction of the result: switching off the convergence neuron reduced attraction for some of the tested odors. This wasn't true for every food odor.

6

Model lab — why does switching off one neuron make two behaviors disappear together?

This is a toy model for illustration, built on the circuit the paper proposes. The convergence neuron is treated as a single "unit that adds innate and learned inputs," and you can change the training, blocking and test to see the T-maze results. The numbers have nothing to do with real data.

Training
Convergence neuron
Test
7

Reading it again through deep learning

This paper's findings and methods overlap in many ways with how we design and analyze neural networks. These are all analogies; they don't mean the brain uses these algorithms.

As a one-line formula

Convergence neuron output = f( W_innate · food odor signal + W_learned · memory output neuron signal )
W_innate: set during development (frozen pretrained weights)
Memory output neuron signal: changed by experience in the mushroom body (the fine-tuned pathway)
→ the deep learning structure y = frozen model(x) + learned correction(x), the same shape as a residual connection or a LoRA adapter
8

Comparing architectures — this page's model vs MLP · RNN · GRU · LSTM · CNN

Press the buttons to switch between diagrams of the six architectures. Green lines are learned connections, dashed lines are fixed connections, and orange arrows are memory carried across time. All diagrams are schematics that show the principle.

The six architectures at a glance

Learned connections / total connections (input 16×16, 3 classes)

Gray bar = total connections, colored bar = learned connections. Deep learning models learn everything; the fruit fly models are mostly fixed connections. The Trainer below and Code 2 in Common section A count the same numbers.

Evidence level in the last row: Real circuit/measurement the model transcribes a real circuit · Similar structure the wiring looks alike, but that's no proof they compute the same thing · Loose analogy · Pure analogy just a figure of speech to aid explanation, with no biological basis.

Key differences from this page's point of view

Section 7 of page ② compared this structure to "frozen model + learned correction," i.e. a LoRA adapter. Putting it in a table makes the differences clearer. RNNs, GRUs and LSTMs carry memory within a time sequence as a hidden state, but this model's memory is stored in connection strengths and spans the hours between training and testing. Just as GRU and LSTM gates decide "how much memory to bring out," the convergence neuron is where memory and instinct are mixed (an analogy).

9

Fruit Fly Trainer — teach it with your own drawings and try it right away

Like Teachable Machine: ① collect examples for each class, ② train, and ③ check with new input. All computation happens inside this browser; your drawings and webcam video never leave it. To run the same model in code, use Code 2 in Common section A.

① Collect data
② Train
Model
Epochs30
Learning rate0.05
③ Preview
Input
Export
Continue in Code 2 →
Load · Save

Collected samples are saved automatically in this browser and survive a page refresh. Exported data and model JSON files can be loaded again.

Getting started: press "Fill sample data," or draw on the pad and press "Add drawing" on a class. Click a class name to rename it.

Same as Teachable Machine

The flow of create classes → collect samples → train → live preview → export, webcam input, and doing all computation in the browser.

Differences

Teachable Machine uses transfer learning: it trains only a small classifier on top of features pre-extracted by a large image model (MobileNet). This Trainer has this page's models learn 16×16 drawings from scratch. That makes it suited to simple shapes and weak on complex inputs like photos. In return, it shows you the validation accuracy and the number of learned connections directly.

10

Putting it on one page — from odor to memory retrieval

Click a box to jump to its explanation. The two pathways meet at the convergence neuron and become a single behavior.

Three key takeaways

1. The lateral horn doesn't process instinct alone. Its convergence neuron is needed to retrieve aversive memories.
2. The convergence neuron is a dual-role neuron that receives both a memory signal (memory output neuron) and a food-odor signal (projection neurons).
3. Learned and innate information are combined in specific, identifiable neurons to produce behavior.
Caveats for readers. The convergence neuron is actually two types, PD2a1 and PD2b1, but because they are labeled together by the same genetic tool, they were treated as one group in most experiments. The neuron was needed for innate attraction only for some of the odors tested. The bars and curves on this page, and the model in section 6, are schematics to explain the direction of the results, not the paper's actual numbers. Statistics are taken from the paper's text.

Colab code — run this page yourself

Both notebooks use only libraries preinstalled in Colab. Click "Download notebook (.ipynb)" and open it in Colab via File → Upload notebook, or copy the code and paste it into a new notebook cell.

Code 1 · The memory + instinct convergence model in NumPyLinked to section 6 Model lab and "Hands-on: comparing architectures" · numpy · under 1 s on CPU

Builds a circuit where the lateral horn (instinct) is fixed and only the mushroom body output (memory) changes by a dopamine rule (active Kenyon cells × chosen action × reward/punishment). After punishing odor A five times, it checks whether only instinct remains when the convergence neuron's memory input is blocked. To use your own data, change the odor_A and innate values.

Output (run on 2026-10-04, numpy 2.4 · CPU). The random seed is fixed, so it's the same every time you run it.
Code 2 · Five standard deep learning models vs three fruit fly models in PyTorchLinked to "Hands-on: architecture comparison · Trainer" · torch, numpy, matplotlib · about 1 min on CPU

Trains MLP, CNN, RNN, GRU, LSTM and three fruit fly models on the same drawing data. Cell 8 runs an experiment that blocks the memory input of the memory + instinct model. Upload the fly_lab_data.json you downloaded from the Trainer in cell 1 to compare using your own drawings.

Output (run on 2026-10-04, PyTorch 2 · numpy 2.4 · CPU). Trained separately with two seeds. The fruit fly models give identical results for both seeds because the seed for their fixed connections is set. Numbers may vary with seed, version and hardware.

How is it different from standard deep learning code?

ItemCode 1 (memory + instinct convergence)Standard deep learning code
Frozen partLateral horn (instinct) + Kenyon cell inputBase model (requires_grad_(False))
Learned partMemory output neuron connections W_mbAdapter adapter
Learning signalDopamine: was the outcome good or bad? (a single number)Difference from the true label (a gradient for each class)
Update methodLocal rule: active Kenyon cells × chosen action × dopamineBackpropagation: gradients passed backward from the loss
Switch-off experimentretrieve=False → blocks the convergence neuron's memory inputuse_adapter=False → turns off the correction
Result when switched offOnly instinct remains, so the fly approaches again (direction of the result in section 3 of the paper walkthrough)Reverts to the base model's answer
CautionA schematic model reproducing the direction of the paper's resultsReal LoRA is the product of two low-rank matrices, A·B
Show standard deep learning code for comparison (frozen_base_adapter.py, PyTorch)

AI prompts — use this code as a starting point

These are prompts to paste into an AI assistant such as ChatGPT, Qwen or Claude. Pressing "Copy" appends the selected code after the prompt. Replace the parts in 〔 〕 with your own situation.

Code to attach

An AI's answer is only a starting point. Always check any papers, numbers or library functions it suggests against the original sources and official documentation. If you used AI help for a competition entry or paper, disclose that you used it and how much, following the rules of the organizer or journal.

Glossary

This is the same dictionary as the yellow dotted underlines in the text. Hover over or tap an underline to see the same explanation.

Analogies — and where they break down

Analogies are a first step toward understanding, but they can also plant misconceptions. Fruit fly/brain analogies are marked with their strength. Direct there is evidence it actually does the same job · Partial only some properties match · None no known counterpart

ConceptEveryday analogyFruit fly/brain analogyWhere the analogy breaks down
Convergence neuronOne person receiving reports from two departments and giving final sign-offDirect PD2a1/b1 in the lateral horn receive signals from both the memory output neuron and food-odor projection neurons [R1]Real convergence isn't simple addition. The 1.0 · 0.6 weights in the model lab are for illustration only
Memory retrievalTaking something out of storage to use itPartial After training, the mushroom body output to the same odor changes, and that signal crosses over to the lateral hornA memory isn't stored in one place like an object. It is spread out as changes in connection strengths
Dopamine learningFixing habits with praise and scoldingDirect Dopamine neurons change the strength of mushroom body output connectionsReal dopamine is a reward/punishment signal, not a "true label." The Trainer's default mode simplifies this to true labels
Fixed pathway + correction (LoRA)Leaving the head-office manual as is and just adding branch notesPartial The mushroom body's learned signal is added on top of the lateral horn's innate pathwayLoRA is a mathematical method that attaches a low-rank product of matrices. It doesn't mean the fruit fly circuit computes this way
Ablation studyRemoving one part and seeing what happens to the machineDirect A temperature switch blocks the convergence neuron's output, and the memory score is measured [R1]In deep learning, ablation just means setting numbers to 0, but biological experiments also have to account for control groups and temperature effects

About the author and references

E-1 About the author · E-2 Academic references · E-3 Figure sources

E-1 About the author

Sangsun Ahn (CEO of M-Robo Inc.)

After working at the Korea Electrical Safety Corporation and the Maeil Business Newspaper, he founded M-Robo Inc., a spin-off venture of Maeil Business Newspaper, where he currently serves as CEO. M-Robo began as an in-house venture of a news organization and grew into a media venture; it provided a robot journalist service (StockBot) to the Kukmin Ilbo and has carried out many projects for the Korea Internet & Security Agency, the Korea Press Foundation, the Korea Communications Agency and others. It now runs its own AI news service, Money-Robo. As CEO, he won the Asia Open Data Hackathon and twice received the Minister of the Interior and Safety Award for contributions to data entrepreneurship, and he is the inventor and registrant of five patents in artificial intelligence and blockchain. He is the author of "AI Crime and Self-Defense" (in Korean), and has developed e-learning content on fintech, statistics and artificial intelligence for the KOREATECH Online Lifelong Education Institute. He holds a Ph.D. in economics (Dongguk University, mathematical microeconomics). He teaches data and AI courses at several universities, including Kookmin University and Hoseo University. Full profile

Courses

  • Sangsun Ahn (2025). Data Science for Business, lecture notes (in Korean). Department of Artificial Intelligence Convergence, Open Cyber University of Korea.
  • Sangsun Ahn (2025). [K-Digital] AI Natural Language Processing (in Korean). STEP (Smart Training Education Platform), KOREATECH Online Lifelong Education Institute.
  • Sangsun Ahn (2024). [K-Digital] Fundamentals of Fintech Data Analysis (in Korean). STEP (Smart Training Education Platform), KOREATECH Online Lifelong Education Institute.

STEP course links: link.step.or.kr/1qyVoJ · link.step.or.kr/M9na9N · link.step.or.kr/brqEyc
If the links don't work because of a site redesign, please visit www.step.or.kr.

Papers and presentations

  • Sangsun Ahn (2025). A Study on a Household Expenditure Prediction Model Using the Korean Retirement and Income Study Panel Data: An AI Model-Based Approach (in Korean). Future Society, 16(2). Full text
  • Sangsun Ahn (2025). A Study on a Household Expenditure Prediction Model Using the Korean Retirement and Income Study Panel Data: An AI Approach (in Korean). Presentation at the KReIS Panel Conference (2025-05-13), National Pension Research Institute, National Pension Service. Slides
  • Sangsun Ahn (2025). A Study on an Algorithm for Detecting Suspected Drug Transactions from SNS Text: Focusing on Pattern and Context Analysis (in Korean). Future Society, 16(1). Full text
  • Sangsun Ahn (2024). Statistics-Based Countermeasures Against Adversarial Data for Securing Anomaly Detection Models in Finance: Empirical Analysis and Simulation Results (in Korean). Future Society, 15(3). Full text
  • Sangsun Ahn (2024). An AI-Based Solution for Detecting SNS Posts Based on Virtual Character Traits (in Korean). Poster at the 2024 Summer Newmedia Party (2024-06-19), Seoul Media Institute of Technology.
  • Sangsun Ahn (2024). Machine Learning Models Using Industrial Accident Panel Data (in Korean). Poster at the 10th Panel Study of Workers' Compensation Insurance Conference (2024-05-17), Labor Welfare Research Institute, Korea Workers' Compensation & Welfare Service.
  • Sangsun Ahn (2024). Analysis and Forecasting of Virtual Asset Time-Series Data: Comparing Time-Series and AI Models and Suggesting Improvements (in Korean). Future Society, 15(1). Full text

E-2 Academic references

  1. [R1] Dolan, M.-J., Belliart-Guérin, G., Bates, A. S., … Jefferis, G. S. X. E. (2018). Communication from learned to innate olfactory processing centers is required for memory retrieval in Drosophila. Neuron, 100(3), 651–668.e8. doi:10.1016/j.neuron.2018.08.037 — this entire installment
  2. [R2] Zheng, Z., Lauritzen, J. S., Perlman, E., … Bock, D. D. (2018). A complete electron microscopy volume of the brain of adult Drosophila melanogaster. Cell, 174(3), 730–743.e22. doi:10.1016/j.cell.2018.06.019 — sections 2 and 5 (electron microscopy data)
  3. [R3] Aso, Y., Hattori, D., Yu, Y., … Rubin, G. M. (2014). The neuronal architecture of the mushroom body provides a logic for associative learning. eLife, 3, e04577. doi:10.7554/eLife.04577 — Cast (memory output neuron name)

E-3 Figure sources

  • The bars, mazes and calcium curves in sections 3–6 are schematics reproducing the direction of the results in [R1], not actual measurements
  • Character art in the closing scene: Deep Learning A to Z lab characters

TIPs for educators

A guide for instructors, on-the-job training leads and tutors. Times are estimates; adjust them to your actual class.

AudienceLearners who have finished Special 1; undergraduate and graduate students reading a research paper for the first time
PrerequisitesSpecial 1's ③ (mushroom body and Kenyon cells) and "rules vs. learning"
Learning objectives① State the paper's claim — that learned memories become behavior via the instinct center — in one sentence ② Explain the logic of an ablation experiment (switch off, control, compare) ③ Map the fixed pathway + learned correction structure onto deep learning (adapters)
Estimated timeReading 45–55 min · animation demos 20 min · Colab practice 30 min (Code 1: 10 min; Code 2: 2 min to run + 15 min to interpret)

Three ways to run it

50-minute lecture

Focus on reading the paper

Intro 5 min (the cast's nicknames) → Sections 1·2, the question and how they searched, 15 min → Sections 3·5 experiments 15 min → Section 6 model lab 10 min → check questions 5 min.

90-minute on-the-job training

Focus on applying it to design

Sections 1·3 20 min → Section 7, rereading it through deep learning (fixed model + correction), 20 min → memory-input blocking experiment in the Trainer 20 min → running and interpreting Code 2 30 min.

1:1 tutoring

Pace by level

Beginners: the cast plus Sections 1·3·6 only. Intermediate learners: have them pair each of the seven steps in Section 2 with a deep-learning analysis method (reading weights, ablation, inspecting activations).

Tips by section

SectionQuestion to pause onHands-on tip
The cast"What does the name PD2a1/b1 mean?"Open the "How to read the names" card first
1 The question"Are instinct and learning really processed separately?"Look at the textbook figure and the paper's figure side by side
2 How they searched"How do you confirm that two neurons are connected?"Click through the seven steps in order
3 Switch it off?"What if just raising the temperature makes memory worse?"Compare low vs. high temperature and the other candidate neurons
5 Two roles"Why does switching off one neuron make two behaviors disappear together?"Switch back and forth between the memory test and food attraction
6 Model lab"What happens if you change 0.6 to 0?"Click "Convergence neuron off"
Practice: Trainer"Why does blocking the memory input leave only the innate value?"After training, click "Block memory input"

Top 5 misconceptions

MisconceptionCorrect explanationScene to show
Memory lives only inside the mushroom bodyFor a memory to become behavior, it has to cross over to the convergence neuron in the lateral horn [R1]Section 3
The instinct circuit and the learning circuit are completely separateA single convergence neuron handles both memory retrieval and innate attraction to foodSection 5
Any change after switching off a neuron is entirely due to that neuronThe effect of temperature alone and of the inserted gene alone must be checked separately with control groupsThe control experiments in Section 3
The numbers in the model lab are the paper's measurementsIt is a schematic that carries over only the direction of the resultsThe yellow stamp in Section 6
Dopamine tells the fly the right answerIt is a reward/punishment signal. Learning from correct-answer labels is a simplification for explanationThe "Note" text in the Trainer

Check questions (click to reveal the explanation)

Q1. State this paper's claim in one sentence.

A memory signal read out of the mushroom body must be passed on to the convergence neurons (PD2a1/b1) in the lateral horn for the memory to become behavior.

Q2. In the experiment that switches off the convergence neuron, why is a "temperature-only control group" needed?

Temperature itself can change behavior, so we must tell whether the memory score dropped because the neuron was blocked or because of the temperature.

Q3. In the model lab, the convergence formula is 1.0 × instinct + 0.6 × memory. If instinct = 0.2 and memory = −1.0, what is the convergence value? And if the memory input is blocked?

0.2 + 0.6 × (−1.0) = −0.4 (toward avoidance). Blocked: 0.2 (only instinct remains, toward approach).

Q4. Why does switching off one neuron make both memory retrieval and food attraction disappear?

Because that neuron is a shared layer that receives two pathways together (the memory signal from the mushroom body and the innate signal from food-odor projection neurons) and produces the output.

Q5. In Code 2, blocking memory retrieval dropped accuracy from 0.84 to 0.09. Why 0.09?

All innate values are 0, so every class gets the same score and the model always picks the first class. 0.09 is the fraction of the test data that belongs to the first class.

Colab assignments

Basic

In Code 1, change the innate value to [0.0, 0.5] (instinct leans toward avoidance). Report in a table how the before-training, after-training and blocked results change, and compare the cases where instinct and memory point the same way vs. opposite ways.

Challenge

In Code 2's MemoryInnate, give innate a value (e.g. 2.0 for the X class), train, then block the memory input. Compare the confusion matrices before and after blocking, and write how instinct pulls the decision.

Adjusting difficulty and going further

BeginnersThe seven steps in Section 2 and the calcium imaging in Section 4 can just be skimmed. Make sure Sections 3·6 are solid
AdvancedHave learners find other studies of the fly memory circuit (how memory output neurons divide up roles) and present a comparison with this paper. Check any paper they cite in the original
Learn moreSangsun Ahn, “Data Science for Business” lecture notes (data science overview, in Korean) · STEP [K-Digital] AI Natural Language Processing (in Korean) · STEP [K-Digital] Fintech Data Analysis Basics (in Korean)
Materials for instructorsGrading criteria for the check questions and sample answers for the assignments are on the Answer Key for Educators page (Special 2)

Great work!

You've read all of "Special 2: The Memory Retrieval Paper." Everyone in the lab has a few words to wrap things up.

Professor
ProfessorTogether we traced the path by which a learned memory is retrieved by way of the instinct circuit.
  • A memory becomes behavior only after crossing from the mushroom body to the convergence neuron in the lateral horn
  • One convergence neuron plays two roles: memory retrieval and food attraction
  • In Code 2, blocking the memory input dropped accuracy from 0.84 to 0.09
Assistant
AssistantSwitch off just one neuron and two behaviors vanish together. Wow!
Fly Researcher
Fly ResearcherA memory's only a memory if you can pull it out and use it. You can thank my lateral horn for that.