Was reading "Lost in Backpropagation: The LM Head is a Gradient Bottleneck" by
@nthngdy and
@yoavartzi the other day. Their ideas seemed very clever, but my ability to follow their intuition was lacking. So I decided to imagine "What would it be like to work as a neuron", to better process their ideas. The main audience when writing this was just myself. Sharing in case others find it a fun read.
A Day in the Life of a Neuron Associate at Grub Zoo.
Welcome to Grub Zoo. Proud home of 1000 animals. Each animal has its own designated 5 minute feeding window during the day where it eats one serving of grub. The feeding schedule looks something like:
-Feed the horse and the Giraffe from 4:00-4:05.
-Feed the rhino from 4:15-4:20.
-Feed the 8 alligators from 7:10-7:15.
Initially the Zoo ran off a simple lookup chart, where one could query a 5 minute window, and get returned a list of all animals that needed to be fed. Well, Bob from Marketing had a great (terrible) idea to replace our lookup table with AI. But instead of using AI, we could just become AI (wtf?). He explained that we’d each get some role in a mega human neural network, then use the power of ‘backpropagation’ to tell each other what to do. I think this is his promo project or something, not sure. His idea is that the optimal feeding window should depend on all sorts of properties of the weather, and once we get this learning machine running, it can plug in a bunch of these advanced features.
The first part of the plan was to designate 10 employees as feeders. Each feeder had to write down how they would divvy up any grub they were given between the 1,000 animals. One feeder, Jeremy, decided he’d give all grub he was given to the sloth. Weird guy. Another one, Anna, decided she’d split up the grub equally across all 1,000 animals. (How’s she gonna manage that, lol?).
My job was the supplier. Every 5 minutes I’d show up with some servings of grub. Then I’d have to divvy it up between the feeders, who’d then divvy it up between the animals based on their prearranged fractions. The weird part here is that I was the only one who was aware of the time of day- the feeders always stuck to their fractions.
Bob said that during each 5 minute interval we’d have two phases: an execution phase, and a feedback phase. Well for the first 5 minute execution phase I frankly had no idea what was going on, so I just gave an equal amount of grub to each of the 10 feeders, who then distributed it out. Somehow Anna was able to get grub out to all 1,000 animals, impressive.
Only the horse and the giraffe were supposed to get fed in this window, but the small amount of grub ended up spread out across all animals, and nobody was happy. I voted to drop Bob’s idea, but he figured we could salvage things. His insight was “Most windows only have a couple animals who need getting fed, so after everybody distributes their grub, we should apply some sort of bunching action towards the ones with the most grub. That way at least somebody gets a decent meal. Sometimes multiple animals need grub and we won’t be sure we got it right, so just do soft bunching.” He called it softmax.
We applied his technique, and sure enough one animal got a good meal, but it was the wrong animal! And the animals at Grub Zoo are extremely picky about when they get fed! Well, Bob said this was ok at first (what?), we just needed the feedback phase.
The feedback phase started with the animals. The ones that didn’t get fed but were supposed to, complained loudly. The feeders were the only ones who could observe and hear the animals. Each feeder would first go observe all 1000 animals to see which ones were complaining. Then they’d update their fractions slightly towards giving them more grub. Now if the supplier had given the feeder little or no grub that window, the feeder would take little effort in updating their fraction as it wouldn’t matter anyway. But if they had been given a large amount of grub, they’d take tremendous honor in updating their fraction quite heavily. But they had to be careful here! They were going to use that fraction for every time window, so they didn’t want to over-correct for one 5 minute interval.
The next phase of feedback was for me as the supplier. Each of the 10 feeders came and told me either ‘Man I coulda made a difference I had the fractions right just give me more grub’, or ‘I was off on this one, didn’t need grub here’. Then my job was to update ‘Ok for this 5 minute interval, give grub to feeder X’, because they told me their fraction is calibrated. I figured none of the feeders had it exactly right, but if I gave more grub to the feeders that seemed decent at the right times, their errors would average out and softmax would help bunch it up on the right animals.
To me the process felt pretty dumb, as the feeders were just like mindless cogs, trying to find the one right fraction. They could see all 1000 animals. But all I could see were 10 people shouting ‘give me more/less grub’. And somehow I was supposed to manage all the windows from that?
Over time I developed a massive lookup table. For each 5 minute interval, how much grub to give to each of the 10 feeders. Each feeder started to get more sophisticated specialization. For instance, one guy fed just the 8 alligators. I knew to only give him grub from 7:10-7:15, because that’s when he complained.
Well, Bob got wind that I was using a lookup table for each 5 minute window and freaked out. Said it wasn’t true AI. Said I was getting demoted to a neuron. 9 other people got hired as neurons too, working in parallel to me.
Now instead of a unique fraction for each window, I had a simpler role. I had to learn a fixed ratio across the 10 feeders, and a simple rule for when to switch on. Initially I just put the fraction on for the morning. And then tuned the fraction a bit to give grub to the feeders that were clamoring for more grub in the morning. I figured if I helped focus on some of the morning intervals, other ‘neuron associates’ could manage other windows of the day. I never got to see what these other neuron associates were up to, but I figured if I listened to the feeders I could help compensate for the gaps.
Well, we got some new funding, and Bob decided to hire some more ‘neuron associates’, so we are up to 20 now. Communication is becoming a real problem. We never talk to each other, and it’s getting kind of weird only listening to the 10 feeders and trying to compensate for what all my coworkers are doing.
Now Bob had the craziest idea yet. He decided to break up our 20 neuron associates into two 10 member squads: Alpha and Bravo. I got put on Bravo. During each interval I’d get to see both the time of day, and how much the Alpha Squad was planning to give to each feeder. I decided to take on a targeted role: IF the time was between 10-11am AND I saw that Alpha Squad was giving grub to feeder 2, then I’d give grub to feeder 1 and 2. I learned that in the morning whenever Alpha Squad gave grub to feeder 2, feeder 2 would still complain and want even more, and feeder 1 complained as well.
I noticed that sometimes Alpha Squad would slip up and not give grub to feeder 2, which meant I didn’t trigger on feeder 1 or 2. When this happened, I’d complain loudly. Hey Alpha! Give more grub to feeder 2! Problem is, team Alpha was getting overwhelmed during the feedback cycle. They had to listen to both the feeders directly, and every single member on squad Bravo. The problem got even worse when we doubled the size of Alpha and Bravo to 20 people each. That’s when Bob started hiring a new role, called ‘transporters’ and ‘messengers’.
There was one messenger and transporter for each feeder. Everyone only got to receive feedback from the messengers, and give grub to the transporters. During the execution phase, the transporters would collect the grub from squad Alpha, then I could make my decision based on if transporter 2 had grub. All of us in squad Bravo would then add on to the grub the transporters were carrying. During the feedback phase, I’d tell messenger 2 if I wanted more grub sent to feeder 2. This way, Alpha squad didn’t have to talk to both the feeders and Bravo squad. The messengers just added up the feedback from both the feeders and Bravo.
We ran this operation for several weeks, with Alpha and Bravo squads distributing grub to the transporters, the messengers giving feedback, and the feeders divvying it out and observing the animals. It seemed like the dumbest thing I’d ever seen! A lookup table could have done the same thing!
Well, that’s when Bob made a change that actually blew my mind. He called it the ‘magic of generalization’. The first thing he did was give all neuron associates access to the temperature, in addition to the time of day. Now in the old world, we’d have to manually make updates to all 1000 animals in the lookup table to figure out how they responded to temperature. In the new world, I only had to change my allocation to the 10 transporters. The feeders had already built fractions that grouped the animals into correlated sets.
I developed a new trigger condition. IF the time was between 10-11am AND transporter 2 had grub AND the temperature was above 60F, then give grub to transporter 1, 2, and 3. I came to learn that in very cold weather, these messengers didn’t complain as much.
Over time Bob added new features I could trigger on. Rain. Wind. Sunshine. It was starting to be quite a lot to handle. Bob always had to go around explaining to every neuron associate how this new measurement would work. Eventually Bob got pretty tired of this. He decided that only squad Alpha could see things like time, temperature, rain, wind, and sunshine. At first this seemed completely crazy to me. How could I know when to trigger, without these key features?
We concocted a pretty funny plan. I noticed that messenger 9 NEVER complained. My guess is that feeder 9 was just completely checked-out. Never gave any grub to anyone. Team Alpha had picked up on this. They also knew that whenever it was between 10-11am and above 60F, messenger 2 would complain to them. So they decided to give grub to transporter 9 whenever it got hot in the morning- not because transporter 9 needed the grub. But because team Bravo could then use that signal to make better decisions.
I developed a new heuristic: IF transporter 2 AND transporter 9 have grub, then we give grub to transporter 1,2,3. AND we also take that grub away from transporter 9 and add it to the pile, since feeder 9 never complains.
So that became my job. I’d wake up every morning, drive in to work as a neuron associate, then pay very close attention to which 10 transporters had grub, and how that correlated to the complaints I’d get from the 10 messengers. I’d update my fractions among the 10 transporters, and update my feedback to the 10 messengers.
Later that month my team name got updated to Squad Bravo-46. What the heck? Turns out Bob had really scaled the operation. We now had 50 Bravo squads in series. My job was always the same, talk to 10 messengers, and observe 10 transporters. I had no idea what measurements got fed into Alpha Squad. And honestly, I had no idea how many animals even lived at the Zoo anymore. I didn’t even know how many team members were on Bravo-46, since I never talked to them.
Alpha Squad was the only team that got to see the pure, raw measurements. And the 10 feeders were the only team that got to see the actual animals. In particular, it seemed like the feeders functioned like quite the bottleneck. I'd love to get to observe all 1,000 animals, instead of just 10 messengers and transporters.
Anyways, that’s my job. Hope the giraffe is doing alright.