RoofLang: Enabling AI-Driven Architecting of LLM Inference Systems
A simulator language lets an AI agent redesign LLM serving setups without running real code.
39.5×
Peak decode throughput gap
DeepSeek V4 Flash versus Kimi K3 at 1M context
How it works
Profiling hits limits
AI optimizers tune existing software by profiling it, so designs the stack can't run well never get found.
Simulate architectures instead
RoofLang describes workloads and hardware as graphs, allows only meaning-preserving rewrites, and scores them with a roofline simulator.
Insights and new designs
It shows compact KV caches drive DeepSeek V4's speed; a Claude Code agent found layouts up to 50.1% better.
What they found
Which comes out on top on Memory traffic per token?
Bigger batches amortize weight reads
try itDrag batch size up and watch decode throughput per GPU climb then flatten.
- Decode throughput
- low
- here
- weight reads dominate
Terms
6 termsRoofline model Estimates op time as the slowest of compute, memory, or network limits.
Like an architect testing floor plans in a physics simulator before hiring builders, instead of only remodeling the house already standing.
Limits
- Initial compute and hardware graphs must be verified correct by humans.
- Assumes perfect MoE load balance and omits KV appending and speculative decoding.
- Simulating Kimi K3 on 128 GPUs can take hours and hundreds of GB.