Daily Tech Briefing
AI 科技速览

每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。

AI 快讯
arXiv AI · 2026/7/22 04:00:00

Cross-Dialect Generalization Without Retraining: Benchmarks and Evaluation of Schema-Derived Constrained Decoding for MLIR

AI 中文解读
新研究提出一种巧妙方法,让小型AI模型无需重新训练就能理解不同编程语言“方言”,性能甚至超越数十倍参数的大模型。MLIR是AI编译器底层的中间代码格式,不同芯片或框架会使用不同的MLIR方言。以往应对每种方言都要重新训练模型,非常浪费资源。这次科学家从每种方言的官方定义中自动提取出结构规则,在推理阶段直接约束模型输出,相当于给AI一个小抄而非强迫它死记硬背。实验显示,仅17亿参数的SmolLM2在生成特定方言代码时,正确率达到80%,比150亿到340亿参数的大模型高出21到44个百分点,生成速度快8到25倍。这项技术让AI编程工具变得更轻量、更便宜,普通开发者和企业无需昂贵显卡就能用上高精度的代码生成助手;同时也意味着AI编译器能更快适配新硬件,未来手机、智能设备上的AI应用启动和运行都会更加流畅。
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 extensible by design: new dialects ship per application domain, so a fine-tuned model per dialect does not scale. We ask whether inference-time priors derived mechanically from each dialect's Operation Definition Specification (ODS) can substitute for gradient-based adaptation. First, we release four natural-language-to-MLIR benchmarks across three dialects - MLIR-Spec-150, Linalg-Spec-30, StableHLO-Spec-30, and StableHLO-Held-Out-200 - totaling 410 in-scope NL-to-MLIR pairs, plus a 25-program out-of-grammar stress set and a hand-authored n=30 functional reference set, shipped under Apache-2.0 with Gebru datasheets and Croissant 1.0 metadata. Second, we build a three-layer schema-derived constraint stack: a CFG over op signatures(C1), type-domain splits from an ODS-extracted type lattice (C2), and an SSA-scope validator driving five-retry rejection sampling (C3). Porting from arith+func+memref+linalg to StableHLO required no new constraint-layer code. On dialects whose verifier semantics are dominated by structural constraints, schema-derived priors let SmolLM2-1.7B match or exceed 15B-34B code LMs at 8-25x the per-generation speed: on linalg, SmolLM2 reaches 80.0% verify-valid (three-seed mean, n=125), beating CodeLlama-34B, Granite-Code-34B, and StarCoder2-15B by 21-44 percentage points with non-overlapping CIs. On arith+func and on the templated parametric StableHLO-Held-Out-200, where verifier semantics turn on attribute values rather than structure, the same baselines match or beat the SLM; we scope these as non-win cells. We release benchmarks, decoder, all per-prompt generations, and a reproducibility Docker image.
分享
阅读原文