arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2602.06976cs.CLcs.AIcs.LGcs.PL
收藏

弥合知识鸿沟:在推理时获取不熟悉编程语言以完成编码任务

Bridging the Knowledge Void: Inference-time Acquisition of Unfamiliar Programming Languages for Coding Tasks

State Key Laboratory for Novel Software Technology, Nanjing University, China(新型软件技术国家重点实验室,南京大学,中国);National Institute of Healthcare Data Science, Nanjing University, China(健康数据科学国家研究院,南京大学,中国)

Chen Shen, Wei Cheng, Jingyue Yang, Huan Zhang, Yuhan Wu, Wei Hu

AI总结:

本文提出ILA-agent框架,通过推理时动态交互获取不熟悉编程语言,提升编码任务性能。

摘要:

大型语言模型(LLMs)在编码任务中的能力往往反映在其广泛的预训练语料库中,这种广泛性在面对之前不熟悉的编程语言时通常会崩溃。不同于数据密集型微调,我们研究了推理时语言学习(ILA)的范式,其中LLM通过与有限的外部资源进行动态交互来掌握不熟悉的语言。在本文中,我们提出了ILA-agent,一个通用的ILA框架,为LLM提供了一组行为原语。通过将本质的人类行为建模为一组工具,ILA-agent使LLM能够通过与官方文档和执行环境的结构化交互逐步探索、应用和验证语言知识。为了在低资源环境下提供严格的评估,我们构建了Cangjie-bench,一个基于新型静态类型语言Cangjie的多任务基准。我们为Cangjie实例化ILA-agent,并在代码生成、翻译和程序修复任务中评估其性能。使用不同LLM的结果表明,ILA-agent在检索增强的基线之上表现显著更好。进一步分析代理轨迹特征化了涌现的行为模式,同时突显了持续存在的性能差距。

英文摘要:

The proficiency of Large Language Models (LLMs) in coding tasks is often a reflection of their extensive pre-training corpora, which typically collapses when confronted with previously unfamiliar programming languages. Departing from data-intensive finetuning, we investigate the paradigm of Inference-time Language Acquisition (ILA), where an LLM masters an unfamiliar language through dynamic interaction with limited external resources. In this paper, we propose ILA-agent, a general ILA framework that equips LLMs with a set of behavioral primitives. By modeling essential human-like behaviors as a suite of tools, ILA-agent enables LLMs to incrementally explore, apply, and verify language knowledge through structured interactions with the official documentation and execution environment. To provide a rigorous evaluation in a low-resource setting, we construct Cangjie-bench, a multi-task benchmark based on the novel statically-typed language Cangjie. We instantiate ILA-agent for Cangjie and evaluate its performance across code generation, translation, and program repair tasks. Results using diverse LLMs demonstrate that ILA-agent significantly outperforms retrieval-augmented baselines. Further analysis of agent trajectories characterizes the emergent behavior patterns while highlighting persisting performance gaps.

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

↑