arXiv:2509.01082cs.LGcs.PL2025-09被引 5

用语言模型提升小模型生成概率程序的准确性和可靠性

RefineStat: Efficient Exploration for Probabilistic Program Synthesis

  • 通过语义约束和诊断式重采样,自动修复语法和语义错误
  • 在多个任务上达到或超过闭源大模型的生成效果
  • 适合需要高可信概率建模的科研与工程人员

概率编程为不确定性建模提供了强大框架,但在该领域进行统计模型发现需在严格领域约束下探索巨大搜索空间。当小语言模型生成概率程序时,常出现语法和语义错误,如推理结构缺陷。受概率编程专家经验和调试策略启发,我们提出RefineStat:一种语言模型驱动的框架,通过强制语义约束确保生成程序包含有效分布和合法参数,并在可靠性检查失败时,通过重采样先验或似然组件进行诊断式修正。我们在多个概率编程代码生成任务上评估了RefineStat,使用小语言模型(SLMs),结果表明其生成的程序既语法正确又统计可靠,性能常可匹配甚至超越闭源大语言模型(如OpenAI o3)。

原文摘要 · Abstract (English)

Probabilistic programming offers a powerful framework for modeling uncertainty, yet statistical model discovery in this domain entails navigating an immense search space under strict domain-specific constraints. When small language models are tasked with generating probabilistic programs, they frequently produce outputs that suffer from both syntactic and semantic errors, such as flawed inference constructs. Motivated by probabilistic programmers' domain expertise and debugging strategies, we introduce RefineStat, a language model--driven framework that enforces semantic constraints ensuring synthesized programs contain valid distributions and well-formed parameters, and then applies diagnostic-aware refinement by resampling prior or likelihood components whenever reliability checks fail. We evaluate RefineStat on multiple probabilistic-programming code-generation tasks using smaller language models (SLMs) and find that it produces programs that are both syntactically sound and statistically reliable, often matching or surpassing those from closed-source large language models (e.g., OpenAI o3).

概率编程程序合成小模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。