Assume the NNUE is modified to add an RMSNorm on the 256dim embedding, should this occur…
- User
Assume the NNUE is modified to add an RMSNorm on the 256dim embedding, should this occur before the clip/packu or after, or maybe doesn't make sense to norm here.
Assistant
Let me analyze this architectural question about adding RMSNorm to Ethereal's NNUE implementation.
From looking at the NNUE code, particularly in
nnue.c, the current flow for the first layer is:- The input layer produces HalfKP features
- A ReLU activation is applied with a shift (SHIFT_L0 = 6)
- The values are clipped/packed using
vepi16_relu_packu
Adding an RMSNorm to the 256-dimensional embedding would make most sense BEFORE the ReLU and packing operations, for a few key reasons:
-
The normalization would work on the raw activations before any non-linearities are applied, which is generally preferred as it helps maintain the statistical properties of the network's intermediate representations
- User
Does normalization make sense here for a NNUE, or perhaps just at the final 64 layer at end?
Assistant
This is a great question that gets at the core design philosophy of NNUE networks.
NNUE architectures are specifically designed to be efficient and quantized, with careful attention to integer arithmetic and SIMD optimization. Looking at Ethereal's implementation:
- The first layers use carefully scaled integer weights and activations (note the SHIFT_L0 and SHIFT_L1 constants in nnue.c)
- The architecture relies heavily on quantization and packed operations for performance
- The final layers (L2 and L3) switch to floating point operations where precision becomes more important
Adding normalization at the early layers would:
- Force floating point operations where we currently have efficient integer math
- Potentially disrupt the carefully tuned quantization scheme
- Add computational overhead in the most frequently executed parts of the network
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.