DocuMint:使用小型语言模型生成Python文档字符串
DocuMint: Docstring Generation for Python using Small Language Models
AI总结:
本研究探究小型语言模型生成Python高质量文档字符串的效能,推出含10万样本的DocuMint微调数据集,实验验证了小模型经微调后在文档生成指标上的显著提升。
摘要:
高效的沟通,尤其是通过文档进行的沟通,是软件开发中贡献者之间协作的核心。语言模型(LM)的最新进展为该生态系统引入了一类新的参与者:由LM驱动的助手,能够完成代码生成、优化和维护工作。本研究探究了小型语言模型(SLM)生成高质量文档字符串的效能,评估维度包括准确性、简洁性与清晰度,通过数学公式进行定量性能基准测试,并采用李克特量表开展人工定性评估。此外,我们推出了包含100,000个样本的大规模监督微调数据集DocuMint。在定量实验中,Llama 3 8B在所有指标上均取得最佳性能,简洁性和清晰度得分分别为0.605和64.88。但在人工评估中,CodeGemma 7B获得了最高的总分,所有指标的平均分为8.3(满分10分)。使用DocuMint数据集微调CodeGemma 2B模型后,所有指标的性能均得到显著提升,其中简洁性指标的提升幅度最高达22.5%。微调后的模型和数据集可在HuggingFace上获取,代码可在代码仓库中找到。
英文摘要:
Effective communication, specifically through documentation, is the beating heart of collaboration among contributors in software development. Recent advancements in language models (LMs) have enabled the introduction of a new type of actor in that ecosystem: LM-powered assistants capable of code generation, optimization, and maintenance. Our study investigates the efficacy of small language models (SLMs) for generating high-quality docstrings by assessing accuracy, conciseness, and clarity, benchmarking performance quantitatively through mathematical formulas and qualitatively through human evaluation using Likert scale. Further, we introduce DocuMint, as a large-scale supervised fine-tuning dataset with 100,000 samples. In quantitative experiments, Llama 3 8B achieved the best performance across all metrics, with conciseness and clarity scores of 0.605 and 64.88, respectively. However, under human evaluation, CodeGemma 7B achieved the highest overall score with an average of 8.3 out of 10 across all metrics. Fine-tuning the CodeGemma 2B model using the DocuMint dataset led to significant improvements in performance across all metrics, with gains of up to 22.5% in conciseness. The fine-tuned model and the dataset can be found in HuggingFace and the code can be found in the repository.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。