Alternative NNUE inputs

Discussion of chess software programming and technical issues.

Moderator: Ras

salmon
Posts: 1
Joined: Thu Jul 24, 2025 3:12 pm
Full name: Salomon Dölle

Alternative NNUE inputs

Post by salmon »

I am currently implementing a nnue into my own hobby engine. I would love to try a complete new approach for the architecture and see how it does. My idea was to focus on relative piece-piece interactions (for example a pawn three squares below an enemy knight is kind of the same pattern no matter where on the board). This would lead to 12 piece types * 12 piece types * 15 x difference * 15 y difference = 32.400 different inputs. I hope the net could generalize piece relations very well because they don't depend on the absolute position on the board. However this approach does neglect the edge of the board.
Next number of inputs could be reduced by only looking at 8 possible x difference values assuming that horizontal mirroring of the two pieces does not change the value of their relation. Besides I did count some piece relations twice ((piece_a,piece_b) and (piece_b,piece_a)).
So I could reduce the number of inputs to (12 choose 2) piece type combinations * 8 xdiff * 15 ydiff = 7920 Inputs. This is pretty small compared to a HalfKP architecture.
So here are my questions:
1. Do you think my input encoding has potential regarding playing strength?
2. I haven't figured out how I want to do efficient updates. Moving a piece would change lots of inputs, especially when it is a capture or castle.