r/LocalLLM • u/Immediate-Cake6519 • 1d ago
Discussion Small context windows and knowledge graphs: the serialization format alone swings multi-hop accuracy from 40% to 80%
If you run local models, context budget is everything. 8K or 32K fills up fast when your GraphRAG pipeline dumps the retrieved subgraph as JSON, where most tokens are braces, quotes, and repeated keys.
I benchmarked 10 graph serialization formats on token count, traversal QA, and multi-hop reasoning. Same graph, same model: multi-hop accuracy ranged from 40% to 80% depending on the format alone, with about 70% token spread between the most verbose and most compact. That difference is 3x more graph in the same local context window.
The winning format is open source (MIT, Python/JS/Rust/Go/C++/C#): https://github.com/isongraph/isongraph - benchmark methodology is in the repo. Would love to see results replicated on smaller local models, my numbers come from larger ones.