Inspiration

We started with a question: Can one AI teach another without sharing its data or model weights?

Imagine a bank discovers a new type of fraud. Another bank might use a completely different AI system and hasn't encountered that fraud pattern yet. Could the first system help the second learn faster by sending just a small amount of information?

I was also interested in how biological brains learn and communicate. When I came across Fly Hero, an open-source simulator of a fruit fly brain, I started wondering whether we could use it to test this idea.

That's how Synapse started.

What we built

Synapse uses two simulated fruit fly brains, each with around 6,900 neurons and 990,000 connections based on real connectome data.

We call them Fly A and Fly B.

Fly A is the teacher. Fly B is the student.

We gave them a Rock-Paper-Scissors task where they learn from winning and losing. At some point, the opponent changes its strategy, so the flies have to adapt.

The interesting part is that Fly A can send Fly B its preferred move using electrical spikes from just two simulated neurons.

Fly B has a different learning architecture, so we can't simply copy Fly A's weights into it. Instead, Fly B uses the information it receives to help update its own learning.

After training, we disconnect the teacher completely and see how well the student performs on its own.

We also built an interactive website where you can watch the brains, see the neural spikes, and compare how the student learns with and without a teacher.

How we built it

We started by modifying the original Fly Hero simulator using Python and JavaScript.

We built a second simulated brain, gave both flies separate learning controllers, and developed a way for them to communicate through neural spikes.

For the visualization, we used Three.js to display the neural networks and their activity.

We also built tools to run repeated experiments and compare the results against different controls, including random messages, shuffled messages, and no teacher at all.

Later, we wrote our own version of the neural simulation engine to check whether the results still held with a different numerical implementation.

Challenges we faced

This was probably the part we spent the most time on.

At first, we tried to get the flies to teach each other using more biologically inspired learning mechanisms. But the student struggled to learn certain actions, and sometimes it would keep choosing the same move regardless of what happened.

We changed the communication system several times.

At one point, it looked like we had successfully made Fly B learn faster. But when we compared it against random and shuffled messages, those also helped.

That was frustrating because it meant we couldn't actually say the teacher was responsible for the improvement.

We went back and changed how the teacher communicated. Instead of sending a simple approval or rejection signal, Fly A started sending its preferred action. Fly B could then use that advice alongside what it learned from its own wins and losses.

That finally gave us a measurable improvement over our controls.

We also discovered that a teacher can make things worse. When Fly A had learned an outdated strategy, its advice could actually prevent Fly B from adapting. We experimented with having the student learn when to trust its teacher, but we haven't completely solved that problem.

Another result surprised us: sending the same message digitally worked just as well as sending it through neural spikes. So although our experiment shows that useful information can travel through the simulated neural network, we can't claim that using neural spikes is better.

We kept these unsuccessful experiments and their results in our repository because they were part of figuring out what actually worked.

Results

Our main experiment involved 15 independent runs.

After the opponent changed its strategy, we let Fly B learn for 48 rounds. We then disconnected Fly A and tested Fly B over 72 games.

On average:

  • With a trained teacher: 68 wins
  • With shuffled messages: 33 wins
  • Without a teacher: 10 wins

Compared with the strongest control in each run, the trained teacher improved the student's score by an average of 24.9 wins out of 72.

We also tried a different task involving a machine responding to changing fault conditions. That experiment showed a similar benefit, with the taught student averaging 19 more wins than its strongest control.

The improvement was mainly in how quickly the student adapted. Given enough time, the student learning alone could eventually catch up.

What we learned

The biggest thing I learned was how easy it is to get a result that looks successful without actually proving what you think it proves.

For example, when random messages improved the student's performance, we initially had to rethink what our experiment was measuring. Just because the student learns faster doesn't mean it learned something useful from the teacher.

We had to test whether the teacher's actual knowledge made a difference.

I also learned more about neural simulations, reinforcement learning, how to design controlled experiments, and how difficult it can be to get two independently learning systems to communicate.

One thing we're careful about is that our system uses both simulated neural networks and engineered learning algorithms. We haven't recreated the way real flies teach each other.

What's next

We wanted to see whether the same idea could have applications outside a simulation.

One direction we're working on is fraud detection using Capital One's Nessie API and Google's Gemini.

The idea is to have a more powerful AI analyze suspicious transaction patterns and teach a smaller local model. That smaller model could then examine transactions independently without needing to call the larger AI every time.

We've built an early version of this application, although we haven't yet shown that Gemini improves the student's fraud-detection accuracy over a comparable model trained without it.

We're also interested in applications involving robots, autonomous systems, and devices that can't easily share large amounts of data.

There are still plenty of questions we haven't answered, especially what happens when the teacher is wrong or the task becomes more complicated.

But we're happy that we managed to answer our original question in a controlled simulation: one AI can help another learn faster by sharing a very small amount of information, without transferring its model weights.

You can find our code, experiments, and results on GitHub.

Synapse builds on Benjamin Gelman's original Fly Hero simulator and fruit fly connectome research from Janelia/Google.

Built With

Share this project:

Updates

Submission history