arXiv:2611.12019cs.SENov 2026

Manuscript Offprint

arXiv:2611.12019

Feeling Easier, Working Harder: Cognitive Load in AI-Assisted Code Comprehension

Maryangela White, Maximilian Rose, Matthew Buckman, Amy McDonnell, Francisco Ortega, Bianca Trinkenreich

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

Maryangela White

Computer Science Department

Colorado State University

Fort Collins, United States

maryangela.white@colostate.edu

Maximilian Rose

Computer Science Department

Colorado State University

Fort Collins, United States

maximilian.rose@colostate.edu

Matthew Buckman

Computer Science Department

Colorado State University

Fort Collins, United States

matthew.buckman@colostate.edu

Amy McDonnell

Psychology Department

Colorado State University

Fort Collins, United States

amy.mcdonnell@colostate.edu

Francisco Ortega

Computer Science Department

Colorado State University

Fort Collins, United States

f.ortega@colostate.edu

Bianca Trinkenreich

Computer Science Department

Colorado State University

Fort Collins, United States

bianca.trinkenreich@colostate.edu

Abstract—Background: Software developers spend significant time reading and understanding code, a task that is increasingly being supplemented by generative AI. While these tools aim to reduce the intrinsic difficulty of reading code, interacting with them introduces a dual-task environment that may impose extraneous cognitive load that is challenging to capture.

Aims: This study investigates how access to generative AI affects developers' real-time cognitive workload (RQ1), objective code comprehension performance (RQ2), and self-perceived code comprehension strategies (RQ3).

Method: We conducted a 3x2 within-subjects study with 20 novice computer science students who reviewed Java code snippets of varying lengths with or without AI assistance, followed by an AI-unassisted comprehension quiz. Objective cognitive workload was continuously captured using a standardized tactile Detection-Response Task (tDRT) during both reading and quiz phases, and then compared to subjective post-quiz NASA-TLX and SEQ scores.

Results: AI assistance significantly increased objective cognitive workload, raising tDRT reaction times by 11.2%, yet participants' perceived workload remained unchanged. Code comprehension scores were high under both conditions, with no evidence that AI assistance improved comprehension at the difficulty levels evaluated; scores clustering near the maximum limited power to detect benefits on harder tasks. Qualitatively, participants reported trusting the AI conditionally—verifying its output against their own reading for more complex snippets, but directly trusting it for simpler code—and, while many felt their reading process was unchanged, a notable subset shifted toward skimming or reading the AI's explanations in place of the code itself.

Conclusions: These findings reveal that developers do not accurately perceive the cognitive resources they expend when managing AI tools. This study provides evidence of added cognitive effort associated with using generative AI, pointing towards a need to account for this dual-task penalty in software engineering tools and education.

Index Terms—Cognitive Workload, Detection Response Tasks, Generative AI, Code Comprehension, Wearable Sensor

I. INTRODUCTION

For decades, software developers have spent up to 70% of their time reading and understanding code rather than writing it [1, 2]. Generative AI (GenAI) assistants promise to ease this burden by translating convoluted logic into clear, natural-language explanations [3]. However, emerging evidence suggests that human-AI collaboration splits the developer's attention, trading the effort of writing code for the hidden mental strain of prompt-formulation, context-switching, and output verification [4, 5]. Because this mental effort is largely hidden behind developers' generally positive impressions of GenAI tools, they frequently underestimate the cognitive effort they actually expend [6, 7]. This means traditional cognitive workload measurements like the NASA Task Load Index [8] fail to capture this discrepancy, as post-task surveys only capture what a developer remembers after the task is over [9].

To uncover this hidden mental workload, researchers have commonly relied on continuous physiological tracking (e.g. EEG, fNIR, and eye-tracking) [10]. While these methods yield rich data, they require expensive equipment, fragile calibrations, and noise-sensitive signals, making them impractical for everyday software engineering environments. We address this instrumentation gap by introducing the Tactile Detection-Response Task (tDRT) to SE research. The tDRT is a low-cost, ISO-standardized behavioral instrument [11] that quantifies cognitive workload via fluctuations in reaction times to simple physical stimuli.

By leveraging the real-time tracking capabilities of the tDRT alongside traditional performance and subjective metrics, we can better examine the hidden costs of AI-assisted program comprehension. To guide this investigation, we present three core research questions:

RQ1. How does access to GenAI assistance affect developers' real-time cognitive workload during code comprehension?

RQ2. How does access to GenAI assistance affect observable code comprehension performance across tasks of varying complexity?

RQ3. How do developers perceive the impact of GenAI assistance on their overall code comprehension process and strategies?

To explore these questions, we conducted a 3×23 \times 2 within-subjects experiment with 20 novice computer science students. Participants evaluated Java code snippets across three sizes under both AI-assisted and unassisted conditions. Cognitive workload was captured continuously using the tDRT and supplemented by post-task NASA-TLX and SEQ metrics. Comprehension performance was assessed via multiple-choice questions probing maintenance, summarization, mental execution, and structural understanding [12], question types that mirror realistic code review demands in collaborative software projects [13, 14]. Finally, to capture changes in strategy, we conducted a qualitative analysis of participant experiences, focusing on how utilizing the AI altered their reading methods and calibration of trust.

Our results show that AI assistance significantly increased objective cognitive workload (RQ1), raising tDRT reaction times by 11.2% over the unassisted condition ( χ2=17.37,p<.001\chi^{2}=17.37, p<.001), even though subjective questionnaire ratings remained unchanged. Notably, this cognitive load increase persisted even after the AI was no longer in use; during quiz phases (where AI was not accessible), participants in the AI-condition still exhibited reaction times 6.93% higher than the control group (p=0.007). Ultimately, this discrepancy demonstrates that computer science students from our study did not accurately perceive the cognitive resources expended when using GenAI for code comprehension. The subjective ease of interacting with GenAI may mask a measurable, sustained objective cost. For code comprehension performance (RQ2), scores were high under both conditions, and we found no evidence that AI assistance improved comprehension at the difficulty levels evaluated. Qualitatively (RQ3), developers reported adapting their strategies based on task difficulty, where they verified AI output against their own reading for complex snippets, but directly accepted explanations for simpler code. Furthermore, while many participants felt their habits remained unchanged between conditions, a notable subset shifted towards skimming the code during the AI-assisted condition, or relying entirely on the AI's natural language explanation.

This paper makes novel contributions to SE research by introducing the tDRT methodology within an SE context and providing empirical evidence of the hidden cognitive costs that accompany generative AI usage in code comprehension. The remainder of this paper is structured as follows. Section II reviews existing research on cognitive workload and generative AI usage in software engineering. Sec. III details our data collection and analysis, followed by results in Sec. IV, and discussion in Sec. V. Finally Sec. VI concludes the paper and provides suggestions for possible directions of future work.

References (47)