AIが生成するコードをあらゆる言語でより正確にする(Making AI-generated code more accurate in any language)

ad

2025-04-18 マサチューセッツ工科大学(MIT)

MITの研究チームは、大規模言語モデル(LLM)によるコード生成の精度と構造の正確性を高める新手法を開発した。この手法では、ユーザーが指定する構文ルールや意味的制約に基づき、構造的に有効かつ意味的にも妥当な出力に優先的に計算リソースを割り当てる「確率的モンテカルロ法」を活用。小型LLMでもPythonやSQL、分子構造、ロボットプランニングにおいて大型モデルを凌ぐ精度を実現した。今後は一般ユーザー向けのデータ解析支援など幅広い応用が期待されている。

<関連情報>

逐次モンテカルロ法による大規模言語モデルの統語的・意味的制御 Syntactic and Semantic Control of Large Language Models via Sequential Monte Carlo

João Loula, Benjamin LeBrun, Li Du, Ben Lipkin, Clemente Pasti, Gabriel Grand, Tianyu Liu, Yahya Emara, Marjorie Freedman, Jason Eisner, Ryan Cotterell, Vikash Mansinghka, Alexander K. Lew, Tim Vieira, Timothy J. O’Donnell
arXive  last revised 18 Apr 2025 (this version, v2
DOI:https://doi.org/10.48550/arXiv.2504.13139

AIが生成するコードをあらゆる言語でより正確にする(Making AI-generated code more accurate in any language)

Abstract

A wide range of LM applications require generating text that conforms to syntactic or semantic constraints. Imposing such constraints can be naturally framed as probabilistic conditioning, but exact generation from the resulting distribution — which can differ substantially from the LM’s base distribution — is generally intractable. In this work, we develop an architecture for controlled LM generation based on sequential Monte Carlo (SMC). Our SMC framework allows us to flexibly incorporate domain- and problem-specific constraints at inference time, and efficiently reallocate computational resources in light of new information during the course of generation. By comparing to a number of alternatives and ablations on four challenging domains — Python code generation for data science, text-to-SQL, goal inference, and molecule synthesis — we demonstrate that, with little overhead, our approach allows small open-source language models to outperform models over 8x larger, as well as closed-source, fine-tuned ones. In support of the probabilistic perspective, we show that these performance improvements are driven by better approximation to the posterior distribution. Our system builds on the framework of Lew et al. (2023) and integrates with its language model probabilistic programming language, giving users a simple, programmable way to apply SMC to a broad variety of controlled generation problems.

1602ソフトウェア工学
ad
ad
Follow
ad
タイトルとURLをコピーしました