Reflections on One Layer Deeper


The task

I participated in the One Layer Deeper competition, where the task was to learn repeated modular squaring, y = x2T mod N, end to end. The inputs are a modulus N, a starting value x and a step count T, and the expected output is y. The model has to learn this from input-output pairs alone, with no task-specific arithmetic in the forward pass, within a limited GPU time budget. The test sets use larger moduli and longer step counts than the training sets. The task is set up to be inherently serial, so it tests whether a model can do multi-step reasoning in latent space rather than through chain of thought. The competition closed without any end-to-end solution, and this post is my reflection on the time I spent trying to solve it.

Neural algorithmic reasoning

For some background, the task belongs to a subfield of machine learning called neural algorithmic reasoning (NAR). NAR builds neural networks capable of executing or mimicking classical algorithms (such as sorting or graph search) inside continuous latent spaces. Unlike current reasoning models that usually scale sequential computation by generating more tokens, algorithmically aligned models can do it in parallel entirely within the latent state, making reasoning far more efficient. This could give models much more computational depth, and with it the ability to solve harder problems.

Tasks in this area tend to be defined by discrete, structural and relational computation. They often resemble spatial puzzles or math operations, where it is relatively easy to test out-of-distribution generalization. Spatial ones are usually solved with convolution-based models, as in the deep thinking systems line of work. Arithmetic tasks aren't solved by any one standard model. Researchers tackle these using specialized architectures. For example, LSTMs, stack-augmented RNNs and Grid LSTMs were tried for addition. More recent attempts with transformers learned addition too, but needed careful data formatting, tasks rewritten into a form a transformer can express easily, or special positional embeddings such as Abacus and position coupling. The Neural GPU (NGPU) and the diagonal Neural GPU (DNGPU) are known for solving multiplication (together called Neural GPUs in the rest of this post).

Trying to solve it

With that high-level understanding, I started by letting agents have a go at it. The attempts are in the public dataset that the organizers releasedTo find my entries, open the SQL console in the dataset viewer and run SELECT * FROM easy WHERE github_login = 'adamsoliev', then repeat it with medium and hard in place of easy.. The agents kept hill-climbing the easy datasets quickly, but all of their approaches failed to generalize, even to the medium datasets. These failures, combined with my steering from too high a level, meant that I was too easily persuaded to change direction whenever I got moderate pushback from the agents. So I dropped down a level and split the task in two: first learn one squaring, x2 mod N, then learn to apply it T times.

Multiplication is the core subtask of one squaring, so I turned to Neural GPUs. Two things stood out to me in the NGPU paper. The first is how the authors understood the theoretical complexity of the task and picked a model with matching expressivity. They based their model on cellular automata, which can multiply two n-bit numbers in O(n) steps using Atrubin's algorithm. Like an automaton, Neural GPUs update every cell in parallel with the same local rule, which in their case is a gated convolution.

The second is how much effort went into making the training work: a 729-run grid search, parameter sharing relaxation, a curriculum and other training tricksFreivalds and Liepins later showed that hard nonlinearities and diagonal gating let the model share its weights strictly from the start of training, without the relaxation.. Kaiser and Sutskever must have believed strongly in their approach (probably based on matching task complexity to model expressivity), so they kept at it until it worked.

The other core subtask of one squaring is modular reduction. It turns out that, in theory, the two subtasks together are in the same complexity class as multiplication alone. Since Neural GPUs solve multiplication, they are computationally powerful enough to represent one squaring as well. The tricky part of one squaring is that information has to cross the whole number. In multiplication, the carry flows upward, from the least significant bit to the most significant. Long division settles the quotient from the top down, so in reduction the main dependency flows downward. Each subtraction inside long division also has its own borrow chain, and that chain runs upward, so reduction alone already needs information to move both ways. With local wiring like that of Neural GPUs, crossing a b-bit number takes on the order of b sequential steps. The T squarings cannot be skipped either, since each one needs the previous residue, so the whole task takes on the order of T · b steps. A fixed stack of distinct layers can't keep up with that depth as b and T grow, but one learned cell applied over and over with the same weights can.

Over the next month or so, I ran close to 200 experiments, some small and some large, and spent around $300 renting GPUs. Throughout, I kept the DNGPU as is and focused mainly on making training work, including running its cell for more steps (2× to 12× the default). Generally, plain squaring was easy to learn, while reduction turned out to be harder. Out of the many training tricks I tried, a curriculum that grows the quotient of x2 / N bit by bit seemed the most promising. Still, even that never got reduction to generalize past the training lengths, so one squaring stayed unsolved and I never got to the second subtask of applying it T times.

Takeaways

I found trying to solve a novel ML task end to end very similar to tackling any decently hard engineering challenge. It mostly consists of failures (ack'ing unknown unknowns). A strong belief in the approach, like the one that kept Kaiser and Sutskever going, also seems very important.

Much of the AI discussion happens on X. Tuning in turned out to cut both ways. On the upside, it is a good place to float rough ideas in public and get a quick sense of whether they are worth exploring. On the downside, great technical content is rare and buried under industry drama and trivia. Without a carefully curated timeline, it's hard for a newcomer to separate the signal from the noise, and virality only makes it worse. My impression is that most people following AI today are fairly new to it. When the community was smaller, engagement generally meant that practitioners saw a post's idea as an interesting direction. Today, it's mostly noise. With so much happening, and so much going viral, I got distracted a fair bit and second-guessed my problem choice more than a few times.

Throughout the whole process, agents took care of what I'd call the traditional engineering side. They implemented and debugged code, set up, ran and monitored experiments, and did the first pass of analysis on the results. What this means is that generalists like me can now try the research side much more easily, as long as they understand what's going on in the system as it evolves.

That understanding is the catch, though. After each change an agent made, I had to spend time understanding the implementation and the experiment setup, and check the results by hand to get a feel for them. Skipping this doesn't stop you right away, but if you keep going without understanding each change, the system and your mental model of it drift apart. Eventually your mental model breaks. You can no longer think about the system away from your laptop. To move forward again, you first have to go back several steps before the point where you were, gather enough context, and only then push past that point. Avoiding this is easier said than done.

This difficulty is partly because agents are poor at explaining themselves. My process for digesting their output has changed a number of times, and I'm still not satisfied with it. The most useful trick so far has been writing pseudocode for the system, or a part of it, and comparing it against the implementation together with the agent. I start at a high level, and once I'm comfortable with that level, I go one level down and repeat. Each pass aligns the implementation with my mental model, and I keep going as long as I gain understanding, until the feeling of “I don't know what's happening here” goes away.

Another problem with agents is that it's very easy to get into a state where you mistakenly feel like you are doing actual work. I caught myself spending some of my mornings on the automation that ran my experiments, fixing all kinds of trivial one-off failures in it or handling cases that I would never run into. None of that moved the actual problem forward.

Another annoyance of mine with agents is that each session starts afresh. I'll have a session where I go back and forth with the agent until its behavior is tuned just right, and from then on the session goes really well. But then I need to sleep or something else happens, and I have to start a new session, which means going back and forth again to get the balance right. I get the sense that other people feel the same way, and none of the current industry solutions address this well.

Looking back

I started learning about LLMs and ML in general around March of this year, a couple of hours a day after work and family time. I read and reread a couple of books, implemented a couple of papers, and wrote an intro blogpost. This competition was a chance to see the research process behind ML models firsthand, which I'm now much better informed about.

AI didn't change how I learned ML as much as I expected, at least not yet. Its default output looks nothing like a great technical artifact from an expert who is also a great teacher. Roughly, such an artifact starts from intuition, uses relatable analogies, avoids jargon, and keeps one visual language from start to finish. Christopher Olah's Understanding LSTM Networks is in my S-tier. AI output is usually the opposite: dense, jargon-heavy, and short on intuition. The most useful tool I have found so far is AI Mode in Google Search, which checks a few of those boxes for text.

I remain optimistic in this regard, though. I agree with Grant Sanderson's idea that AIs will probably end up better than most humans at explaining and distilling knowledge, and I hope he is right. His reasoning is that people who come up with genuinely novel insights also tend to be quite clear in communicating them.

If that happens, automated engineering combined with good explanations will let us move up a layer of abstraction and work on harder problems that were previously out of reach. We will still have to decide which questions to ask and pursue.