Software workflows · Research feature

The Hidden Methodological Layer: Uncovering Threats to Validity in LLM-Assisted Empirical Software Engineering

The findings highlight that current practices in LLM-assisted research often fail to make these critical components visible, limiting the ability to assess validity and replicate results.

Adapted from research by Vict\'oria Gomes, Fabio Palomba, Robert Feldt and colleagues.

arXiv preprint revision · 2026-11-15 · Attribution & reuse
In this article
Editorial illustration of linked workflow.

Editor’s introduction

The study analyzed 50 primary empirical software engineering studies that used large language models for tasks like classification, coding, and evaluation. It found that threats such as prompt-dependent interpretation, workflow instability, and evaluator bias were consistently underreported. These issues can affect multiple aspects of research validity depending on where LLM outputs are integrated into the workflow. The researchers identify a ‘hidden methodological layer’—a concept describing how LLM interactions embed methodological variables into the research process without explicit documentation. This layer includes unrecorded elements like prompt design, model settings, and output reuse, which can compromise transparency and reproducibility. The findings highlight that current practices in LLM-assisted research often fail to make these critical components visible, limiting the ability to assess validity and replicate results. The evidence does not assess the severity of these threats or their impact across different study types or tasks, and the scope is limited to studies that already reported LLM use.

Introduction

Empirical Software Engineering (ESE) relies on carefully designed methodological processes to produce valid and reliable knowledge about software systems and practices. This reliance on methodological rigor makes the explicit control and reporting of research decisions central to ESE, particularly those concerning data collection, construct operationalization, analysis procedures, and interpretation of results. Together, these elements form the backbone of empirical rigor, enabling researchers to assess validity, replicate studies, and build cumulative knowledge.

Given ESE’s dependence on the transparency and control of these methodological decisions, the increasing adoption of Large Language Models (LLMs) in software engineering introduces a fundamental shift in how empirical research is conducted. Unlike traditional tools, which are typically deterministic and explicitly configured, LLMs act as adaptive, general-purpose agents capable of interpreting instructions, generating outputs, and making implicit decisions during task execution. As a result, they are no longer merely supporting tools, but active components in the research process, influencing how data is processed, interpreted, and transformed.

This shift changes the methodological conditions under which empirical research is conducted. When researchers rely on LLMs to perform tasks such as classification, coding, or synthesis, part of the research logic becomes embedded in interactions with the model, including prompts, parameter settings, and iterative refinements. These interactions may introduce assumptions, biases, and stochastic behaviors that mediate how empirical evidence is constructed, interpreted, and reported. Importantly, while these interactions provide some level of control, the internal behavior of LLMs remains largely opaque and only partially controllable, limiting the researcher’s ability to fully understand or predict how outputs are produced. Consequently, part of the methodological process becomes effectively hidden, operating beneath the observable workflow.

While this hidden layer may streamline and scale empirical activities, it also raises critical concerns. If key methodological decisions are implicit, difficult to control, or inconsistently reported, then traditional assumptions about validity, reproducibility, and transparency may no longer hold. Understanding this shift is essential for ensuring that the integration of LLMs strengthens rather than undermines empirical rigor.

Data Analysis

To answer RQ1 - To what extent are threats to validity introduced by LLM-assisted research tasks explicitly reported in empirical software engineering workflows?, we examined how frequently threats to validity introduced by LLM-assisted research tasks were explicitly reported across the analyzed corpus.

For each LLM-assisted task, we recorded whether the corresponding paper explicitly reported at least one threat to validity associated with LLM use. We then organized these results according to the taxonomy of LLM involvement established in our SLR: augmentation, automation, decision support, and evaluation. In this taxonomy, augmentation refers to scenarios in which LLMs support or accelerate human activities while the researcher remains primarily responsible for the task; automation refers to workflows in which the LLM independently performs substantial parts of the empirical task with limited human intervention; decision support captures cases in which the LLM provides recommendations, suggestions, or analytical insights that inform human decision making; and evaluation refers to situations in which the LLM acts as an assessor or judge, for example by evaluating quality, correctness, similarity, or relevance. Organizing the analysis according to these categories allowed us to investigate whether the explicit reporting of LLM-related validity threats varied depending on the role assigned to the LLM within the empirical workflow.

To answer RQ2 - What threats to validity introduced by LLM-assisted research tasks are reported in empirical software engineering workflows?, we analyzed the reported threats through thematic analysis, following established guidelines for thematic synthesis in software engineering research. The analysis was conducted only for the subset of tasks in which at least one LLM-related validity threat was explicitly reported. We adopted an inductive coding process in which the extracted verbatim excerpts were first examined and assigned descriptive codes representing the specific validity concerns identified by the study authors. Conceptually related codes were then grouped into lower-level themes representing recurring forms of methodological risk introduced by LLM use. Finally, these lower-level themes were further abstracted into higher-level themes to characterize broader patterns in how threats to validity introduced by LLM-assisted research tasks are manifested and discussed in the literature.

The coding and synthesis process was conducted iteratively by one researcher and reviewed by a second researcher. We coded 33 extracted threat excerpts in total, treating each excerpt as a distinct threat occurrence. Because a single LLM-assisted task could be associated with more than one reported threat, multiple coded excerpts could be linked to the same task. The first researcher generated the initial codes, interpretations, and candidate themes, which were then reviewed and discussed with the second researcher across two refinement rounds. During these rounds, the researchers revisited the coded excerpts to improve conceptual consistency, reduce overlaps between categories, and ensure that each theme remained aligned with the methodological implications reported in the primary studies. Disagreements or ambiguous cases were resolved through discussion until consensus was reached. The resulting taxonomy therefore reflects iterative abstraction, peer review of coding decisions, and consensus-based refinement.

To answer RQ3 - How do reported threats to validity introduced by LLM-assisted research tasks relate to established validity dimensions in empirical software engineering?, we mapped each identified threat to its corresponding validity dimension. This mapping was conducted using the validity taxonomy appropriate for the type of empirical study, as presented in Table. Since the study type of each paper had already been extracted during our previous SLR, we used this information to determine the corresponding validity dimension before performing the classification. Each identified threat was then examined in terms of its underlying methodological implication and assigned to the validity dimension whose definition most closely reflected the nature of the concern being reported. For example, threats related to unreliable outputs were mapped to dimensions associated with construct validity, whereas concerns involving limited generalizability or contextual dependency were mapped to external validity dimensions. This procedure enabled us to systematically analyze how LLM-related validity threats manifest across different forms of empirical software engineering research and how they align with study-specific validity concerns.

The mapping process was conducted collaboratively, by one researcher and one reviewer, based on the definitions associated with each validity framework. Because some threats to validity introduced by LLM-assisted research tasks affected multiple aspects of empirical rigor simultaneously, a single threat could be associated with more than one validity dimension when conceptually justified by the reported methodological implications. The mapping decisions were iteratively reviewed and refined to improve consistency across the analyzed studies.

Among the 69 LLM-assisted research tasks analyzed, 30 tasks (43.5%) explicitly reported at least one LLM-related threat to validity. In contrast, the remaining 39 tasks (56.5%) did not explicitly acknowledge or discuss potential validity concerns introduced by LLM use.

The results indicate that explicit reporting of LLM-related validity threats differs according to how the LLM is positioned within the empirical workflow. This difference is particularly evident in tasks categorized as automation, where the LLM performs substantial parts of the empirical task with limited human intervention. Among these tasks, 22 of 42 (52.4%) explicitly reported at least one LLM-related threat to validity, making automation the category with the highest threat-reporting rate. This suggests that studies involving more autonomous forms of LLM use are more likely to acknowledge explicit methodological concerns.

At the same time, however, the automation category also contained 20 tasks in which no LLM-related threat to validity was explicitly discussed. This result is particularly noteworthy because automation-oriented workflows are those in which LLM usage may introduce stronger methodological risks. When an LLM performs substantial parts of an empirical task with limited human intervention, the absence of explicit threat reporting becomes especially concerning, as it may obscure whether researchers assessed the reliability of generated outputs, controlled for hallucinations or misclassifications, evaluated prompt sensitivity, or validated the automated procedure itself. Therefore, the automation category stands out not only as the form of involvement most frequently associated with reported threats, but also as a particularly sensitive context in which missing threat reporting and management may have greater methodological consequences.

In contrast, augmentation tasks showed the lowest reporting rate, with only 3 of 13 tasks (23.1%) acknowledging LLM-related threats. This may indicate that, when LLMs are used mainly to support or accelerate human work, authors are less likely to frame their use as introducing distinct validity concerns. In augmentation settings, the presence of human oversight may lead authors to perceive the LLM as less methodologically consequential. Nevertheless, this interpretation requires caution. Human involvement does not eliminate LLM-related risks; it may only change how they appear. For example, an LLM-generated suggestion, summary, or intermediate output may still influence how researchers interpret data, prioritize evidence, or make analytical decisions, even when the final judgment remains human.

Tasks categorized as evaluation showed an intermediate pattern: 5 of 13 tasks (38.5%) had at least one LLM-related threat reported in the corresponding paper, while 8 did not. This role deserves particular attention because LLMs used for evaluation are not merely producing intermediate artifacts; they are participating in judgment. When LLMs are used as evaluators, judges, or assessors, they can influence how quality, correctness, relevance, similarity, or performance are measured. Therefore, even though the reporting rate for evaluation was lower than automation, the methodological stakes remain high. In these cases, threats such as evaluator bias, inconsistency, misalignment with human judgment, and inaccurate assessment may directly affect the study’s findings.

The only task categorized as decision support did not report any LLM-related threat to validity. Consistent with the interpretation above, this should be understood as a reporting outcome rather than as evidence that decision-support uses are methodologically unproblematic. Conceptually, decision support may still introduce validity concerns because LLM-generated recommendations, rankings, explanations, or interpretations can shape human decisions even when the final choice remains with the researcher. Because this category contains only one task, however, the result does not support substantive comparison with the other forms of LLM involvement.

The previous analysis showed that many LLM-assisted tasks did not explicitly report LLM-related threats to validity. For the tasks in which threats were reported, however, the authors often reported more than one validity concern associated with LLM use, meaning that the number of identified threats exceeds the number of tasks in which threats were reported.

The identified threats were distributed across five higher-level themes. Most threats were concentrated in threats to empirical evidence construction, which accounted for 19 coded occurrences. This concentration indicates that LLM-related validity threats were more likely to be reported when the model was used to produce, transform, classify, filter, or extract the empirical evidence used in later analyses.

The remaining lower-level themes within threats to empirical evidence construction show that this concern extends beyond incorrect labels. LLM screening and filtering errors and LLM-generated artifact unreliability appeared 4 times each, while LLM extraction errors appeared once. Together, these themes indicate that LLMs may compromise empirical evidence in different but related ways: by excluding relevant material, retaining irrelevant material, producing artifacts that inaccurately represent the original data, or extracting incomplete or imprecise information from empirical sources. In this sense, the central risk is not simply that an LLM may produce an incorrect answer, but that its output may reshape what counts as evidence in the study.

This concern becomes more pronounced when LLMs are embedded in repeated or chained workflows. The lower-level theme LLM workflow instability, with 2 occurrences, captures risks that emerge when outputs depend on feedback loops, refinement cycles, or automated processing steps. In these cases, validity threats may arise not only from a single inaccurate response, but also from the behavior of the workflow as a whole, including error accumulation, unstable outputs across iterations, or failure of refinement loops to converge. This suggests that some LLM-related threats are workflow-level threats rather than merely output-level threats.

Importantly, model contingency relevance depends on the role played by the LLM and the extent to which the resulting evidence depends on model-specific behavior. For example, when an LLM is used only to produce labels that are independently validated against a reliable reference, variation across models or versions may have limited impact on the study findings. In contrast, model contingency becomes more consequential when LLM outputs are used without comprehensive validation, when the model participates in the operationalization or interpretation of constructs, or when its outputs are propagated into subsequent analyses. Thus, the relevant concern is not simply that different models may produce different outputs, but whether such model-dependent variation can materially alter the empirical evidence or conclusions of the study.

Viewed as a whole, the taxonomy shows that reported LLM-related threats to validity are concentrated mainly around the construction of empirical evidence, especially when LLMs classify, screen, extract, or generate the material on which later analysis depends. However, the reported threats are not limited to inaccurate outputs. They also involve prompt sensitivity, workflow instability, evaluator bias, downstream propagation of errors, and dependence on specific models or domain fit. This suggests that LLMs introduce a methodological layer that is often only partially visible in empirical reports: model choices, prompts, interaction protocols, and reuse of LLM outputs may shape the research process even when they are not treated as methodological decisions. The central concern, therefore, is not only whether an LLM output is correct, but whether the study reports how LLM-assisted steps entered the empirical workflow, how their risks were assessed, and how their effects on the findings were controlled.

Implications for Empirical Software Engineering Research

The findings of this study have implications for how LLM-assisted empirical software engineering should be designed, reported, evaluated, and reviewed. As LLMs become increasingly integrated into empirical workflows, methodological rigor cannot rely solely on assumptions inherited from human-driven or deterministic procedures. Instead, researchers need to explicitly account for the hidden methodological mechanisms introduced through LLM interactions and their potential impact on empirical validity.

A first implication concerns the reporting of LLM-assisted empirical workflows. The results of RQ1 showed that many studies employing LLMs did not explicitly report threats to validity associated with their use, even in workflows involving substantial automation or evaluation activities. This suggests that existing reporting practices may not yet adequately capture the methodological implications of LLM integration. To improve transparency and reproducibility, future studies need to document not only the empirical procedures and tasks performed with LLM assistance, but also the model- and interaction-specific conditions under which these tasks were carried out. Such information may include prompt engineering strategies, model versions, parameter settings, interaction protocols, validation procedures, human oversight mechanisms, and the extent to which LLM-generated outputs were reused in downstream analyses.

A second implication concerns reproducibility and methodological stability. Traditional empirical workflows often assume that analytical procedures can be reproduced from explicit methodological descriptions. However, the probabilistic and prompt-sensitive nature of LLMs challenges this assumption. Identical prompts may produce different outputs across executions, while small variations in prompt wording, model configuration, or interaction history may substantially alter empirical outcomes. As a result, reproducibility in LLM-assisted empirical software engineering may require additional methodological controls, such as prompt versioning, repeated executions, sensitivity analyses, configuration tracking, and explicit documentation of model dependencies.

The study also has implications for how empirical results involving LLMs should be evaluated and interpreted. Our taxonomy of threats to validity introduced by LLM-assisted research tasks revealed that methodological risks frequently emerge during the construction, transformation, classification, extraction, and evaluation of empirical evidence. Consequently, researchers and reviewers may need to critically examine not only the final outputs generated by LLM-assisted workflows, but also the processes through which these outputs were produced and validated. In particular, studies using LLMs for classification, synthesis, or evaluation activities may benefit from systematic human validation, cross-model comparisons, consistency checks, and robustness analyses designed to assess the stability and reliability of generated outputs.

Another implication concerns methodological literacy. Researchers using LLMs in empirical software engineering need to understand not only the empirical method they are applying, but also the operational properties of the models they incorporate into that method. This includes recognizing prompts as methodological instruments, model configurations as sources of variation, stochastic outputs as potential threats to stability, and generated artifacts as evidence that may require validation before reuse.

Finally, the findings suggest the need for methodological guidelines and evaluation standards tailored to LLM-assisted empirical research like the recent guidelines proposed by Baltes et al.. Existing validity frameworks remain highly relevant, but they provide limited guidance on how to document and control risks introduced by probabilistic, opaque, and rapidly evolving AI systems. Future guidance should therefore address prompt reporting, model transparency, workflow traceability, output validation, robustness evaluation, and the management of cascading validity effects across empirical workflows.