Honestly the answers to these questions are usually the most obvious thing. It could just be some basic dimensionality reduction technique precomputed for each input/output size combination.
That’s still just a few thousand matrices. I’m sure they can handle the training and distribution of that set.