arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.03158cs.SEcs.AIcs.LG
收藏

哪种算法规范格式有助于语言模型实现机器学习算法?

Which Algorithm Specification Formats Help Language Models Implement Machine Learning Algorithms?

Data Analytics Department, Mizuho-DL Financial Technology, Co., Ltd.(Mizuho-DL金融科技公司数据分析部门);NP-hard Inc.(NP-hard公司)

Masahiro Kato, Taka Kato

AI总结:

研究算法规范书面格式对大语言模型首次实现准确性的影响,比较多种格式在五个机器学习任务、三个模型和四个实验设置下的表现,发现不同情况下各格式效果有差异,给出写作建议。

摘要:

大语言模型越来越多地用于实现研究手稿中的算法,但论文往往隐含实现选择。本研究考察算法规范的书面格式如何影响大语言模型首次实现的准确性。我们在五个机器学习任务、三个模型和四个实验设置中比较普通散文、LaTeX算法风格伪代码、类似PDF提取的伪代码、Markdown字段、类似YAML的规范、类似JSON的规范和Python代码存根,产生4020个生成的实现。隐藏测试评估通常决定正确性的细节,包括平局决胜、数组形状、数值规则、返回结构和无效输入行为。在核心信息设置下,LaTeX算法风格伪代码的平均格式效果最大,类似YAML的规范和普通散文紧随其后。在完整信息下,GPT-5.4 mini在匹配比较中没有格式差异,而Gemma 3 4B和Llama 3.2 3B仍然有。尽管指定了函数签名,但代码存根并不能始终提高正确性。结果支持一项写作建议:作者应明确说明接口、计算步骤、数值规则和边界情况行为,而不是依赖特定的表面格式来承载这些细节。

英文摘要:

Large language models (LLMs) are increasingly used to implement algorithms from research manuscripts, but papers often leave implementation choices implicit. This study examines how the written format of an algorithm specification affects first-pass LLM implementation accuracy. We compare ordinary prose, LaTeX algorithm-style pseudocode, PDF-like extracted pseudocode, Markdown fields, YAML-like specifications, JSON-like specifications, and Python code stubs across five machine learning tasks, three models, and four experimental settings, yielding 4,020 generated implementations. Hidden tests evaluate details that often determine correctness, including tie-breaking, array shapes, numerical rules, return structures, and invalid-input behavior. Under the core-information setting, LaTeX algorithm-style pseudocode has the largest average format effect, with YAML-like specifications and ordinary prose close behind. Under complete information, GPT-5.4 mini shows no format differences in the matched comparisons, whereas Gemma 3 4B and Llama 3.2 3B still do. Code stubs do not consistently improve correctness despite specifying the function signature. The results support a writing recommendation: authors should state the interface, computation steps, numerical rules, and boundary-case behavior explicitly, instead of relying on a particular surface format to carry those details.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑