跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算与语言

arXiv:2308.05646 (cs)
[提交于 2023年8月10日]

标题:AST-MHSA : Code Summarization using Multi-Head Self-Attention

作者:Yeshwanth Nagaraj, Ujjwal Gupta
查看论文《AST-MHSA : Code Summarization using Multi-Head Self-Attention》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Code summarization aims to generate concise natural language descriptions for source code. The prevailing approaches adopt transformer-based encoder-decoder architectures, where the Abstract Syntax Tree (AST) of the source code is utilized for encoding structural information. However, ASTs are much longer than the corresponding source code, and existing methods ignore this size constraint by directly feeding the entire linearized AST into the encoders. This simplistic approach makes it challenging to extract truly valuable dependency relations from the overlong input sequence and leads to significant computational overhead due to self-attention applied to all nodes in the AST. To address this issue effectively and efficiently, we present a model, AST-MHSA that uses multi-head attention to extract the important semantic information from the AST. The model consists of two main components: an encoder and a decoder. The encoder takes as input the abstract syntax tree (AST) of the code and generates a sequence of hidden states. The decoder then takes these hidden states as input and generates a natural language summary of the code. The multi-head attention mechanism allows the model to learn different representations of the input code, which can be combined to generate a more comprehensive summary. The model is trained on a dataset of code and summaries, and the parameters of the model are optimized to minimize the loss between the generated summaries and the ground-truth summaries.
主题: 计算与语言 (cs.CL); 机器学习 (cs.LG); 程序设计语言 (cs.PL); 软件工程 (cs.SE)
引用方式: arXiv:2308.05646 [cs.CL]
  (或者 arXiv:2308.05646v1 [cs.CL] 对于此版本)
  https://doi.org/10.48550/arXiv.2308.05646

提交历史

来自:Yeshwanth Nagaraj
[v1] 2023年8月10日 星期四 15:43:46 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.CL
< 上一篇   |   下一篇 >
最新 | 近期 | 2023-08
切换浏览方式为:
cs
cs.LG
cs.PL
cs.SE

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站