arXiv:2608.28184cs.LGAug 2026

Manuscript Offprint

arXiv:2608.28184

Biologically Inspired Mechanisms for Facilitating Grokking in Multilayer Perceptrons

Florin Leon

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Grokking is a delayed transition from memorization to generalization that is often accompanied by substantial reorganization of internal representations. This paper studies whether biologically inspired mechanisms, many of which are not commonly incorporated into artificial neural networks, can actively promote this transition by regulating hidden-layer computation at the levels of neuronal activity, response, and effective connectivity. We augment a multilayer perceptron with input gating, structural plasticity, gain modulation, threshold modulation, homeostasis, lateral inhibition, and activation decorrelation, and evaluate these mechanisms through systematic ablations on two established grokking benchmarks: sparse parity and noisy XOR classification. The results show that the mechanisms contribute unequally to generalization. Homeostasis provides the strongest and most consistent benefit, while structural sparsification emerges as the second major mechanism. The remaining biologically inspired mechanisms have smaller or less consistent effects in the present experiments. For both problems, the results support the common principle that explicit regulation of neuron utilization and effective connectivity can improve the emergence of generalizable internal computation. These findings motivate broader investigation of biologically inspired activity regulation and adaptive sparsification, including in large language models, where they may accelerate the development of generalizable representations and reduce the optimization time required for robust generalization.

Keywords: grokking, biologically inspired neural mechanisms, hidden representation, structural organization, homeostasis, structural plasticity

1 Introduction

Grokking denotes a training dynamic in which a neural network can reach near-perfect performance on the training set while test performance remains poor, with strong generalization appearing only after a substantial delay. This temporal gap has been studied most often in small algorithmic tasks, where extended optimization can eventually move the model from memorizing examples toward a more systematic form of generalization that resembles rule learning (Power et al., 2022). Further research suggests that this transition is linked to changes in the internal mechanisms of the model, including the emergence of subnetworks that support more generalizable solutions (Merrill et al., 2023).

This observation points to a broader question about the role of internal structure in delayed generalization. Standard multilayer perceptrons (MLPs), whether trained in the classical backpropagation setting with stochastic gradient descent (SGD) or with more recent first-order optimizers such as AdamW, are designed primarily to minimize prediction error. These training methods impose no direct constraint on the form of the internal organization.

that the model learns. In particular, they do not ensure modularity, specialization, sparse circuit formation, or any other property that could help the model form robust, reusable internal patterns. Recent work has drawn attention to this issue through the “fractured entangled representation” hypothesis (Kumar et al., 2025), which argues that conventional objective-driven training can produce representations in which useful regularities are spread across redundant and interfering components.

This question is also relevant beyond small synthetic benchmarks. Large language models (LLMs) also continue to develop and reorganize internal representations over extended training, which makes mechanisms that regulate internal organization relevant at larger scales. If grokking depends in part on the formation of better internal structure, then methods that make that transition faster or more reliable may reduce training cost and improve the emergence of systematic behavior. Therefore, grokking provides a useful setting for studying how architectural biases shape internal representations during learning.

The present paper examines this issue using two benchmarks that have played different roles in the grokking literature. The first is sparse parity (Merrill et al., 2023), where inputs are binary vectors and the label is determined by the parity of a small hidden subset of coordinates. This task belongs to the class of algorithmic examples that first made grokking visible, and it has since been used to study how a network can move from an early dense solution with poor test performance to a later sparse solution that generalizes well. The second is a noisy XOR-cluster classification (Xu et al., 2023), where examples are drawn from four Gaussian clusters arranged in a XOR pattern, with a small fraction of labels flipped. In this problem, a neural network can initially fit the training set well but with near-chance test accuracy, and later reach good test performance while still fitting the noisy labels. Sparse parity and noisy XOR reveal two different forms of delayed generalization. In sparse parity, the transition reflects the emergence of a compact subnetwork that captures a hidden dependency among a few input coordinates. In noisy XOR, it reflects a change from sample-level interpolation to features aligned with the nonlinear cluster geometry.

The main difference from most previous works lies in the mechanisms under investigation. Much of the existing grokking literature has focused on standard architectures, optimization effects, and post hoc analysis of the learned solutions. The present study evaluates a set of biologically inspired regulatory mechanisms and examines how they affect grokking behavior. We incorporate these mechanisms into a multilayer perceptron architecture that we call BioNN. The mechanisms act within the hidden layers by altering the routing and regulation of activity, the competition among neurons, and the effective connectivity that develops during learning. The goal is to determine whether they can promote a more useful internal organization and whether this organization changes the speed, stability, or form of the transition from memorization to generalization.

The remainder of the paper is organized as follows. Section 2 reviews related work on grokking and brain-inspired neural models. Section 3 introduces the proposed model and describes the biologically inspired mechanisms, including input gating, structural plasticity, gain modulation, threshold modulation, homeostasis, lateral inhibition, and activation decorrelation. Section 4 presents the experimental setup, including the grokking tasks, network structure indicators, and experimental protocol. Section 5 reports the ablation results and discusses the contribution of each mechanism, the organization of the learned representations, implications for generalization and LLMs, and the computational demands of the proposed mechanisms. Section 6 concludes the paper and summarizes the main findings.

The implementation of the model is available at: https://github.com/florinleon/BioNN.

References (55)