Introduction
Instead of building complex multi-branch neural networks that must be simplified after training, what if we could move architectural "priors" directly into the optimizer? By utilizing RepOptimizers, researchers demonstrate that a plain VGG-style model can achieve state-of-the-art performance while being significantly faster to train and much easier to quantize for mobile deployment.
The Problem with Structural Re-parameterization
In recent years, "Structural Re-parameterization" (SR)—exemplified by models like RepVGG—has become a popular technique for boosting the performance of simple architectures. These models employ complex, multi-branch structures during training (such as residual connections and $1 \times 1$ convolutions) to improve accuracy. After training, these branches are mathematically "fused" into a single, simple structure for fast inference.
However, SR introduces three major drawbacks:
- Training Overhead: The extra branches make training slower and significantly more memory-intensive.
- Quantization Issues: Fusing branches often results in a "spiky" weight distribution. This makes 8-bit (INT8) quantization difficult, leading to severe accuracy drops on edge devices.
- Complexity: Managing different training-time and inference-time architectures adds engineering friction.
This raises a compelling question: Can we get the benefits of these structural priors without actually building the complex structures during training?
Methodology: Gradient Re-parameterization
To address these limitations, the authors introduce Gradient Re-parameterization (GR) and the RepOptimizer. The core idea is to modify the gradients during training to mimic the behavior of a more complex model, rather than altering the model's physical architecture.
The process follows a three-step pipeline:
- Define the Prior: The researchers first imagine a complex "Constant-Scale Linear Addition" (CSLA) structure. For example, this might include a $3 \times 3$ convolution, a $1 \times 1$ convolution, and an identity branch, each with a scaling factor.
- Hyper-Search (HS): Because the optimal scaling factors are unknown, a highly efficient "Hyper-Search" is performed on a small dataset (like CIFAR-100). A model is trained with trainable scales to discover the optimal values.
- Train with RepOptimizer: Finally, on the target dataset (like ImageNet), a plain model (e.g., RepOpt-VGG) is trained. The optimizer uses the previously searched scales as constant multipliers (Grad Mult) for the gradients.
Mathematically, the authors prove that training a single convolution with these modified gradients is identical to training a multi-branch structure, provided the branches are linear.
Key Insights
- Priors in the Optimizer: The most profound insight is that architectural "knowledge" (like the benefit of residual connections) does not have to exist as physical layers in a network. Instead, it can be expressed as a mathematical constraint on how weights are updated.
- Dataset-Agnostic Hyper-parameters: Surprisingly, the scaling factors found on a tiny dataset like CIFAR-100 transfer perfectly when training on ImageNet. This suggests these factors capture fundamental properties of the model architecture rather than the specific training data.
- Quantization-Friendliness: Standard RepVGG is notoriously hard to quantize because the structural fusion process creates a wide range of weight values. Because RepOptimizer trains a plain model from the start without any structural fusion, the resulting weight distribution is much smoother and inherently "friendlier" to 8-bit conversion.
Experimental Results
The researchers evaluated RepOpt-VGG across standard benchmarks, including ImageNet-1K, MS COCO, and Cityscapes, yielding impressive results:
- Training Efficiency: RepOpt-VGG-B1 trains 1.8x faster and consumes less memory than the original RepVGG-B1 because it completely avoids extra forward and backward passes through auxiliary branches.
- Competitive Accuracy: Despite its simple "plain" structure, RepOpt-VGG performs on par with or better than well-designed models like EfficientNet and ResNet. For instance, the RepOpt-VGG-L2 variant reached an impressive 83.13% top-1 accuracy on ImageNet.
- Quantization Robustness: This is arguably the method's "killer feature." While a standard RepVGG model's accuracy plummeted from ~78% to ~54% when converted to INT8, RepOpt-VGG only dropped to ~75.9%. This makes it vastly more practical for real-world edge deployment.
Limitations and Future Work
The primary limitation of the current methodology is its reliance on the linearity of the operations. While it works beautifully for convolutions and linear layers, it cannot yet replace structures where non-linearities (like ReLU activations) are placed between branches.
Future work could explore moving even more complex architectural priors into the optimizer. This could potentially spark a new era of "optimizer-centric" deep learning, where the model architecture remains dead-simple for maximum inference speed, while an advanced training process does all the heavy lifting.
Summary updated