Schema-Derived Decoding Boosts MLIR Code LM Generalization.

Plawan Kumar Rath· July 22, 2026 View original

Summary

This paper introduces new benchmarks and evaluates schema-derived constrained decoding for Multi-Level Intermediate Representation (MLIR), enabling small code LMs to generalize across different MLIR dialects without retraining. This approach uses inference-time priors from dialect specifications to improve code generation accuracy.

Researchers have explored a method to significantly improve the ability of small code language models (LMs) to generate Multi-Level Intermediate Representation (MLIR) code across various dialects without requiring extensive retraining. MLIR is a crucial component of modern machine learning compiler infrastructure, but its extensible nature and limited presence in pretraining data make it challenging for LMs to handle new dialects. The core idea involves using inference-time priors derived directly from each dialect's Operation Definition Specification (ODS). This "schema-derived constraint stack" includes a Control Flow Graph (CFG) over operation signatures, type-domain splits, and an SSA-scope validator. This system allows for robust code generation even for dialects not explicitly seen during training. To validate this, the team released four new natural-language-to-MLIR benchmarks. Experiments showed that a relatively small model, SmolLM2-1.7B, equipped with these schema-derived priors, matched or even surpassed much larger 15B-34B code LMs in terms of verify-valid generation, particularly on structurally constrained dialects like Linalg. This demonstrates a powerful technique for achieving cross-dialect generalization efficiently.

Why it matters

For AI engineers and compiler developers, this research offers a highly efficient way to generate correct MLIR code across diverse and evolving dialects using smaller language models, accelerating compiler development and reducing computational overhead for code generation tasks.

How to implement this in your domain

  1. 1Explore the new MLIR benchmarks for evaluating code generation models.
  2. 2Investigate integrating schema-derived constrained decoding into existing code LMs for MLIR generation.
  3. 3Apply the concept of inference-time priors from formal specifications to other structured code generation tasks.
  4. 4Consider using smaller, specialized LMs combined with strong constraints for domain-specific code generation.

Who benefits

Software DevelopmentAI/ML InfrastructureSemiconductorCloud Computing

Key takeaways

  • Schema-derived constrained decoding improves MLIR code generation for LMs.
  • It enables cross-dialect generalization without requiring model retraining.
  • New benchmarks for natural-language-to-MLIR generation have been released.
  • Smaller LMs with this technique can outperform much larger models on specific tasks.

Original post by Plawan Kumar Rath

"arXiv:2607.18254v1 Announce Type: new Abstract: Multi-Level Intermediate Representation (MLIR) underlies modern ML compiler infrastructure (TensorFlow, JAX/StableHLO, PyTorch Inductor, IREE), yet appears only in trace amounts in code-LM pretraining corpora. MLIR is also extensibl…"

View on X

Originally posted by Plawan Kumar Rath on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses