Saved in:
Bibliographic Details
Main Authors: Poudel, Bibek, Cook, Adam, Traore, Sekou, Ameli, Shelah
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2405.10243
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917667986735104
author Poudel, Bibek
Cook, Adam
Traore, Sekou
Ameli, Shelah
author_facet Poudel, Bibek
Cook, Adam
Traore, Sekou
Ameli, Shelah
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2405_10243
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle DocuMint: Docstring Generation for Python using Small Language Models
Poudel, Bibek
Cook, Adam
Traore, Sekou
Ameli, Shelah
Software Engineering
Machine Learning
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.
title DocuMint: Docstring Generation for Python using Small Language Models
topic Software Engineering
Machine Learning
url https://arxiv.org/abs/2405.10243