I’ve done it by hardcoding a knowledge graph nn and adding a few “query” layers. You can freeze the graph and swap it out and update it during training so you can update the knowledge at will during inference. You just need to keep the format the same; the model learns an arbitrary graph query language. If you register a buffer it can update you can teach it to keep scratchpad memory very quickly.

Very nice! I'm actually running a autoresearch / modded-gpt comparision to try the complex math operation idea right now! I suspect it's too hard for small quick model training runs to figure out how to use them.

I'll put your knowledge graph nn idea into the mix of things to try.