Manuscript Offprint

arXiv:2611.09846

Ensemble Methodology for Reference-Free Confidence Estimation in LLM-based Code Summarization

Marco Colombo, Balaji A Jayaram, Sowmyakumari Selvaraj, Sumit Tokkar, Animesh Kumar, Aravinda Prasad Sistla, Ravishankar Shetty, Rigel Gjomemo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Marco Colombo

Sumit Tokkar

mcolom4@illinois.edu

stokkar@illinois.edu

University of Illinois

Urbana-Champaign

Balaji A J

Sowmyakumari Selvaraj

Animesh Kumar

Ravishankar Shetty

Balaji_Jayaram@infosys.com

sowmyakumari.s@infosys.com

animesh.kumar14@infosys.com

RavishankarS@infosys.com

Infosys

Aravinda Prasad Sistla

Rigel Gjomemo

sistla@uic.edu

rgjome1@uic.edu

University of Illinois Chicago

Abstract

This paper describes an approach and use case to estimate the correctness of LLM-generated COBOL summaries without access to human-authored references. The core intuition is that inter-model agreement on semantics is informative about truth, and that an LLM-as-judge can provide higher-fidelity pairwise assessments than traditional string- or embedding-based metrics [18, 20]. We operationalise this intuition with (i) controlled summary generation from diverse models; (ii) a LLM evaluator that compares pairs of summaries and emits structured judgments; and (iii) a calibrated aggregation rule that combines supportive evidence while penalising only corroborated contradictions.

1 Introduction

COBOL (Common Business-Oriented Language) remains deeply entrenched in enterprise computing, with billions of lines of code in production across financial services, insurance, government, and healthcare sectors [5]. These legacy systems, developed over several decades, manage mission-critical operations including transaction processing platforms (IBM TPF), core banking systems, claims processing, and regulatory compliance frameworks. The technical complexity of these codebases stems from decades of incremental modifications, vendor-specific extensions, and business logic that evolved without adequate documentation, creating significant knowledge management challenges for organizations maintaining these systems.

The imperative for COBOL modernization stems from multiple converging factors. First, the steep decline in COBOL-proficient developers—with a significant portion of existing practitioners approaching retirement age and limited new talent entering the field—creates a critical sustainability risk. Second, integration challenges between legacy COBOL platforms and modern cloud-native architectures, microservices, and API ecosystems impede digital transformation initiatives. Third, maintaining aging mainframe infrastructure incurs substantial costs. These factors have given rise to multiple initiatives aimed to transform COBOL codebases into modern languages and platforms [7, 10]. Some of these initiatives include direct translation of COBOL codebases into

a modern language [6, 8, 9] while others are focused on extracting specifications and the business logic, which can then be used to recreate that business logic in a modern language and architecture [4, 13].

In this paper, we are focused on the latter approach, business logic extraction from COBOL codebases. The main challenge in this approach is that the vast majority of legacy COBOL programs lack adequate inline comments, external documentation, or design specifications—original developers have often retired, taking institutional knowledge with them. This creates a fundamental documentation gap: to safely migrate, refactor, or rewrite these systems, engineers need accurate descriptions of what each program does, yet manual documentation at scale is prohibitively expensive given the extensive codebases requiring analysis.

Recent advances in Large Language Models (LLMs) have demonstrated promising capabilities in code understanding and documentation generation. Multiple frontier models, including GPT-4, Claude, LLaMA, and specialized code models, can generate human-readable summaries of code functionality. This creates an opportunity to automatically document legacy COBOL codebases at scale. However, a fundamental question remains: How do we evaluate the quality, accuracy, and reliability of AI-generated documentation when no ground truth exists? Traditional code summarization research relies on reference-based metrics (BLEU, ROUGE, BERTScore) that measure similarity against human-authored reference summaries. These metrics are inapplicable to legacy COBOL scenarios where no reference documentation exists.

LLM-based approaches. Existing approaches to assessing LLM output quality offer partial solutions but are insufficient in isolation. Reference-based metrics (BLEU [16]), ROUGE ([14]), CodeBLEU ([17]), BERTScore ([21]) require human-authored ground truth summaries—fundamentally inapplicable when no reference documentation exists. Model-internal confidence signals such as perplexity and logit probabilities provide valuable indicators of generation uncertainty and can flag when models are uncertain about their predictions. However, these token-level signals cannot reliably detect when a model is confidently wrong about semantic interpretation—a model

Marco Colombo, Sumit Tokkar, Balaji A J, Sowmyakumari Selvaraj, Animesh Kumar, Ravishankar Shetty, Aravinda Prasad Sistla, and Rigel Gjomemo

may generate a fluent, high-probability summary that completely misinterprets business logic. Single-model LLM-as-judge approaches where one model evaluates another's output show promise but face validity concerns: evaluators may have systematic biases or blind spots, lack deep understanding of COBOL-specific constructs and mainframe paradigms, have no ground truth for calibration, and can themselves produce inconsistent assessments. No single metric adequately addresses the multifaceted challenge of reference-free evaluation for domain-specific legacy code.

Challenge: No human-authored references. In the absence of human-authored references, how can we quantitatively estimate confidence in LLM-generated COBOL documentation to determine which outputs are reliable enough for operational use and which require human expert review? This requires evaluation metrics that are: reference-free (operable without ground truth comparisons); quantifiable (producing numerical confidence scores supporting prioritization and quality gating); interpretable (providing actionable signals explaining why outputs are flagged as low-confidence); multi-dimensional (assessing correctness, completeness, and consistency across multiple quality axes); robust (resistant to single-model biases and prompt engineering artifacts); and scalable (applicable to millions of lines of code requiring documentation). For enterprise adoption, organizations need confidence metrics that indicate: "This summary has high inter-model agreement and complete code coverage—safe for downstream use" versus "This summary has contradictions and potential omissions—requires expert review."

Our approach: overview. We propose a multi-metric ensemble framework that combines complementary evaluation mechanisms:

(1) Inter-model agreement via LLM-as-judge: generating summaries from multiple diverse models and employing structured pairwise comparisons;

(2) Calibrated aggregation: combining judgments through linear pooling with conjunctive penalty for corroborated contradictions;

(3) Token-level confidence scores: measuring generation certainty through perplexity and logit probability analysis;

(4) Code coverage assessment: employing G-Eval metrics to quantify documentation completeness.

This reference-free framework enables automatic triage of AI-generated documentation.

Our approach has been implemented inside Infosys to deal with summarization of large code bases and extraction of business rules from those code bases for developers. This paper is organized as follows. Section 2 contains background and related work. Section 3 describes our approach in detail. Section 4 describes the evaluation of our approach and results, and Section 5 concludes the paper.

References (17)