Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development

Jesse Phillips, Tracy Hall, Paul Rayson, Mo El-Haj
7/23/2026
cs.SEcs.CL

No official code found. Best implementation: phillijm/TransformerAssistedLLMCodeSum (0 stars, GPL-3.0, last commit 2026-05-28).

Abstract

Neural Source Code Summarisation (NSCS) aims to generate natural language summaries of source code to improve developers' and maintainers' understanding of code. Source code summaries are vital during the maintenance phase of the Secure Software Development Lifecycle (SSDLC), as they improve maintainers' understanding of code and help reduce the number of bugs and vulnerabilities in a software system. However, summaries are often missing, incomplete, or outdated in many software systems. Solutions to this problem use small, task-specific Transformer models or code-aware Large Language Models (LLMs). Task-specific Transformer-generated summaries often score well across many natural language generation (NLG) metrics, but these metrics reward lexical overlap rather than summary quality. Conversely, the ability of LLMs to capture semantics and produce high-quality summaries presents an exciting solution to this problem. This is especially relevant given the increased availability of LLMs and improvements in workstation hardware in recent years, which mean that some LLMs can now be run on developers' workstations. However, because of their abstractive nature, LLM-generated code summaries often differ greatly from developer-written summaries in the words and phrases they use, resulting in low scores across NLG metrics. We show how combining these two methods, by using Transformer-generated summaries in prompt engineering, may enable LLMs to create better source code summaries and help software practitioners maintain secure systems. We prompt four LLMs using four different prompts, with a task-specific Transformer used to assist the LLMs within the prompts. We present "Transformer-Assisted LLM-Based Source Code Summarisation", a method through which we observe an improvement of 7.8% in BLEU-4 and 5%.

View on arXivView PDF

Code Implementations(1)

GPL-3.0

Replication package for "Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development", presented at NLPAICS 2026

00Oct 9, 20244 months agoGPL-3.0

Similar Papers

Cite this paper

@article{phillips2026transformerassisted,
  title  = {Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development},
  author = {Jesse Phillips and Tracy Hall and Paul Rayson and Mo El-Haj},
  year   = {2026},
  eprint = {2607.20933},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.20933v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.20933.svg)](https://codeofpaper.com/paper/2607.20933)

Discussion