Manuscript Offprint
arXiv:2610.07446CogAdapt: Cognition-informed Sparse Adaptation of Code LLMs
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
YUEKE ZHANG, Vanderbilt University, USA
ZIHAN FANG, Vanderbilt University, USA
KEVIN LEACH, Vanderbilt University, USA
YU HUANG, Vanderbilt University, USA
Large language models (LLMs) have become increasingly capable of generating code. However, achieving stronger code-generation performance still often relies on costly model adaptation, i.e., fine-tuning pretrained model parameters. Meanwhile, prior studies have shown meaningful correspondence between how humans process code and how neural models allocate attention or internal computation. Building on this relationship, recent human-aligned learning approaches have used cognitive signals, such as attention or brain activity, to guide training and improve model performance. However, these methods typically still adapt a large portion of the model, leaving the training cost largely unchanged. This reveals an important gap: human cognitive signals may not only indicate what the model must learn from, but also help determine where adaptation is most useful within the model. Motivated by this insight, we investigate whether human responses during code reading correspond to the internal behavior of code models, and whether this correspondence can guide more selective and efficient model adaptation without sacrificing performance.
We present CogAdapt, a cognition-informed framework for task-dependent sparse adaptation of code models. CogAdapt first learns transferable program-level and token-level priors from human Electroencephalography (EEG) and attention data, then combines these priors with the frozen model's response to each coding task to determine how much adaptation to allocate and which transformer blocks should receive updates. During fine-tuning, only the selected blocks are updated, while no new human recordings are required for inference. Across Qwen and GLM, we find consistent correspondence between human reading behavior and MoE computation. CogAdapt achieves the best pass@1 across both LiveCodeBench and BigCodeBench, including gains of 10.86 and 6.29 percentage points over matched regular fine-tuning on LiveCodeBench, while reducing gradient-eligible adaptation parameters by 86.21–87.21%. These results suggest that human comprehension signals can provide useful guidance for making code-model adaptation both more selective and more effective.
ACM Reference Format:
Yueke Zhang, Zihan Fang, Kevin Leach, and Yu Huang. 2026. CogAdapt: Cognition-informed Sparse Adaptation of Code LLMs. In Proceedings of Make sure to enter the correct conference title from your rights confirmation email (Conference acronym 'XX). ACM, New York, NY, USA, 22 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn
Authors' Contact Information: Yueke Zhang, Vanderbilt University, Nashville, Tennessee, USA; Zihan Fang, Vanderbilt University, Nashville, Tennessee, USA; Kevin Leach, Vanderbilt University, Nashville, Tennessee, USA; Yu Huang, Vanderbilt University, Nashville, Tennessee, USA.
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.
Conference acronym 'XX, Woodstock, NY
© 2026 Copyright held by the owner/author(s). Publication rights licensed to ACM.
ACM ISBN 978-x-xxxx-xxxx-x/YYYY/MM
https://doi.org/10.1145/nnnnnnn.nnnnnnn
Zhang et al.

Fig. 1. Human attentional hotspots coincide with MoE computation at the same code regions
computational cost. Training and deploying large generative models require considerable GPU resources and electricity, and recent studies have raised growing concerns about their energy consumption [7, 27, 43]. Mixture-of-Experts (MoE) architectures provide a promising way to improve computational efficiency by activating only a subset of model components for each input, allowing model capacity to grow while reducing the computation required during inference [9, 12, 23, 39]. Nevertheless, sparse inference does not eliminate the cost of training and adapting these large models. MoE models still require substantial computation during training [8, 30]. Thus, an important challenge remains: while MoE models can selectively allocate computation during inference, how can we similarly make learning more selective during adaptation?
Existing parameter-efficient methods address part of this problem by reducing how many parameters are updated. Parameter-efficient techniques such as LoRA reduce the number of trainable parameters or the memory required for adaptation [10, 19, 48]. However, these methods determine adaptation largely from properties of the model itself, providing limited external guidance about where learning would be most useful. In contrast, the human brain operates under strong metabolic constraints, which have been associated with energy-efficient neural coding and computation [2, 25]. This contrast motivates a different question: can human cognitive signals provide prior knowledge about where computation is most valuable, and use that knowledge to guide which parts of an LLM should be adapted?
Human cognition therefore provides a promising source of prior knowledge for more selective model adaptation. Eye-tracking studies show that developers follow selective and non-linear reading patterns and allocate different amounts of attention to different code regions [3, 44]. A growing line of work has consequently modeled programmer attention from eye movements, aligned human reading behavior with neural code representations, and incorporated human attention into code models [1, 3, 44, 49, 53]. More recent studies extend this direction to Code LLMs by transferring cognitive signals into downstream model adaptation [47, 50–52, 54]. Together, these studies suggest that human cognitive signals capture information about where developers concentrate their processing effort, and that this information can provide useful supervision beyond conventional input–output training data. However, balancing the performance benefits of human-guided adaptation with training efficiency remains an open challenge. This motivates our work: can human EEG and attention measurements collected during code comprehension provide useful guidance about which parts of a code model should be updated? If so, fine-tuning could focus on a small, task-dependent subset of transformer blocks rather than adapting the model uniformly.
We propose cognition-informed sparse adaptation of code LLMs, called CogAdapt. Our approach uses EEG and attention measurements from human code reading to inform both the emphasis of code supervision and the allocation of adaptation gradients. Figure 1 illustrates the local human-model correspondence that motivates the study. We structure our study in two connected steps. First, we conduct an exploratory analysis to examine whether human attention and EEG responses systematically correspond to MoE computation at the same code regions and across model depth. The resulting correspondence is distributed across blocks rather than concentrated in one fixed location, motivating task-dependent adaptation. Building on this finding, CogAdapt converts human signals into transferable priors and combines them with frozen-model responses to dynamically select a small set of transformer blocks for each training task. Only these selected blocks are adapted, while inference requires no EEG or attention input.
Our contributions are as follows:
• We present COGADAPT, a cognition-informed framework for sparse adaptation of code models. To the best of our knowledge, this is the first work to use human code-comprehension signals to guide where a code model should adapt. COGADAPT transfers cognition-derived priors to downstream tasks without requiring new human data.
• We identify local correspondence between human reading behavior and MoE computation. Across two MoE architectures and four code categories, 75.0–83.3% of analyzed regions show positive correlations between human attention or EEG responses and model computation.
• We show that human processing demand corresponds to MoE computation across model depth. The depth-time heatmaps reveal systematic but architecture-dependent relationships between EEG responses and model computation, with different internal signals dominating in Qwen and GLM.
• We demonstrate that cognition-informed sparse adaptation improves code generation with fewer gradient-eligible parameters. On LiveCodeBench, COGADAPT improves pass@1 over matched all-block fine-tuning by 10.86 points for Qwen and 6.29 points for GLM, while reducing adaptation parameters by 86.21–87.21%.
2 Motivating Example
Figure 2 illustrates the intuition behind our study using a real code example from the NoviceVsExpert dataset [33], where participants read Java programs while their EEG and eye movements were recorded. The example is a short binary-search implementation, but different parts of the program require different levels of reasoning. In particular, the boundary check if (high < low) determines when the search should stop, and the following return -1 handles this case. Understanding these lines requires connecting the current search range with the control flow that follows.
Humans devote more attention to difficult code regions. Panel A illustrates the developer’s eye movements while reading the code. After initially directing their gaze to later lines in the program, the developer returns to the boundary check before continuing. This backward eye movement indicates that the boundary condition receives additional attention rather than being inspected only once during the initial reading.
Panel B shows the corresponding EEG responses. The boundary check and return statement receive more visual attention than the surrounding calculation and comparison. The EEG measurements show a similar pattern: brain activity is stronger around these same reasoning-intensive
Zhang et al.
A Human attention

int middle = (low + high) / 2;
if (high < low) {
return -1;
}
attention
if (key == sortedArray[middle]) {
...
}
read
forward
encounter
boundary
check
return
to guard
Backward regression
B What happens to the human?
B1 Human attention
B2 EEG theta

Regression-locked theta change
0, 4–8 Hz

C What happens inside the MoE?

C1 Expert-choice confidence
Ordinary region
Critical region
E1 E2 E3 E4
E1 E2 E3
E1 E2 E4
more decisive routing
confidence ↑
C2 Hidden-state shift
Ordinary region
Critical region
E1 E2 E3
E1 E2 E4
larger representation change
C3 MoE write
Ordinary region
Critical region
E1 E2 E3
E1 E2 E4
model state
stronger expert contribution
MoE update composite
D Same hard region, corresponding responses
Same code region
Human EEG
MoE update
Calculation
Boundary check
Return
Next comparison
corresponding responses
Positive association (across regions)
Fig. 2. A motivating example of human–model correspondence during code comprehension. (A) A developer looks back at the boundary check while reading the binary-search program. (B) The same region receives greater human attention and a stronger EEG response. (C) When the MoE model processes this code, it also responds more strongly around the boundary check: the model makes a more decisive expert choice, changes its internal representation more, and receives a larger contribution from its expert components. (D) The same reasoning-intensive code region motivates our broader human–model correlation analysis.
lines. Together, these signals suggest that the boundary condition is a meaningful point of increased human processing demand.
The model also responds more strongly around the same region. Panel C shows what happens when an MoE code model processes the same code. Different tokens can cause different levels of internal computation. Around the boundary check, the model makes a more decisive routing choice, changes its internal representation more strongly, and receives a larger contribution from its expert components. We summarize these responses in the lower part of the panel, where the boundary check and return again stand out from the surrounding statements.
Human and model responses highlight similar code regions. Panel D places the two views side by side. The goal is not to claim that human brain activity and model computation are identical. Rather, the example shows that the same code region elicits relatively stronger responses in both the developer and the model. Developers devote more attention and neural processing to the boundary condition, while the model also exhibits a stronger internal response there. Across code regions, this produces a positive association between human attention and model response.
This example motivates the central question of our work: if difficult code regions consistently attract both stronger human processing and stronger model computation, can human comprehension signals help guide where and how a code model should adapt? CogAdapt investigates this question across programs and model architectures, and then uses the resulting human-derived signals to guide sparse adaptation for downstream code generation.
3 Related Work
Our work connects three lines of research: learning to generate code, measuring human program comprehension, and comparing human and model processing.
3.1 Large Language Models for Code
Early pretrained models developed representations that connect code with its descriptions [13, 45, 46]. Generative code models extend this foundation by learning to produce programs from specifications and surrounding context. Research on Codex and CodeGen established the potential of large-scale code training for function synthesis and multi-turn programming [5, 28]. Infilling models and code-specialized foundation models further support editing within existing programs and conditioning on longer code contexts [15, 36]. Efficient adaptation raises a further question: where should a limited training budget be spent? Low-rank adaptation restricts learning to compact weight updates, and adaptive rank allocation distributes that budget according to parameter importance [19, 48]. Mixture-of-Experts (MoE) code models offer a related form of selectivity by activating only some experts for each token [9]. Selective adaptation has also been studied within parameter-efficient and layer-wise training. LISA samples layers for optimization, LoRA-drop uses adapter outputs to assess importance, and CKA-based layer selection uses representational change to identify adaptation locations [29, 31, 55].
3.2 Measuring Human Code Comprehension
Neuroimaging research treats program comprehension as a cognitive activity that can be studied beyond completion time and correctness. Early functional magnetic resonance imaging (fMRI) studies demonstrated the feasibility of observing brain activity during source-code comprehension, and subsequent studies examined its relation to working memory, attention, familiarity, and code review [14, 21, 26, 34, 40]. Studies of neural efficiency and cortical representations examine how familiarity and programming skill relate to the processing of source code [20, 41]. Electroencephalography (EEG) provides complementary evidence through changes in brain activity associated with programming experience and mental workload [6, 24].
Human measurements also help assess what makes particular code difficult to understand. Neuroimaging studies of code-complexity metrics examine whether structural properties capture comprehension demands, while work on identifier naming and readability measures the cognitive consequences of how code is presented [11, 32]. Physiological measurements have additionally been used to estimate difficulty during software-development tasks [16]. Combining modalities helps connect overall effort with the code that readers inspect. Simultaneous fMRI and eye tracking, gaze-linked near-infrared measurements, and combined EEG and eye tracking provide complementary views of the same comprehension activity [11, 33, 35].
3.3 Cognitive Guidance for Language and Code Models
Neuroscience provides empirical benchmarks for characterizing the representations learned by language models. Neural predictivity is associated with next-word prediction performance, while brain–model correspondence varies across training stages and representational depths [4, 38]. These findings motivate examining multiple model layers and processing signals. Human attention also offers a complementary perspective on language processing. Comparisons between LLM self-attention and eye-saccade patterns indicate that scaling improves correspondence with human reading attention, whereas instruction tuning primarily increases sensitivity to instructions [17].
For code, associations between fMRI recordings, program properties, and learned representations demonstrate shared information between human and artificial program processing [42]. Beyond
Zhang et al.

Fig. 3. Overview of CogAdapt. We first compare human EEG and attention responses with the internal responses of an MoE code model on the same code. These human signals are summarized into reusable guidance about which programs and code regions tend to require more processing. For each downstream coding task, the model then identifies the transformer blocks most relevant for adaptation. CogAdapt uses this information to focus training on important examples, code regions, and model blocks. After fine-tuning, inference is unchanged and requires only the coding prompt, with no human measurements.
such comparisons, human attention has become a training signal for code models. Cognitive simulation based on ACT-R generates code-reading scanpaths from limited human observations, reducing dependence on large eye-tracking datasets [50]. Observed visual attention can also supply token-level loss weights for code-model fine-tuning [52]. Integrating simulated scanpaths with training weights based on cognitive salience and attention order further supports transfer from C++ reading patterns to Java tasks [54]. Together, these approaches demonstrate how observed and simulated reading behavior can inform model adaptation.
4 Methodology
We present CogAdapt, a cognition-informed framework for task-dependent sparse adaptation of Mixture-of-Experts (MoE) code models, as shown in Figure 3. The central idea is straightforward: human EEG and attention measurements indicate which code regions require greater cognitive effort during comprehension, while our human-model analysis reveals where corresponding changes in model computation appear across transformer blocks. CogAdapt transfers this information to downstream code-generation tasks and uses it to determine which training examples and code regions receive greater emphasis and which transformer blocks are updated.
4.1 Stage 1: Measuring Human and Model Responses to the Same Code
CogAdapt begins with code for which we have both human-comprehension measurements and model responses. We use the NoviceVsExpert corpus [33], in which participants read Java programs while EEG and eye movements were recorded. We then process the same programs with each MoE code model. This gives us two views of the same code: how strongly humans respond while reading it and how strongly different parts of the model respond while processing it.
Human responses. We obtain two complementary signals from synchronized eye-tracking and EEG recordings of 37 participants reading 32 Java programs [33]. Eye tracking identifies which code tokens participants inspect, how long they look at them, and when they look back or revisit them. From the EEG recordings, we extract theta-band power (4–8 Hz) and standardize it within participants. We aggregate theta over the corresponding semantic code regions. These signals describe where readers concentrate their attention and the neural activity associated with reading individual regions or an entire program.
Model responses. We process the same Java programs with each MoE model and record five responses at each candidate block: expert-choice concentration, expert-choice change, hidden-state shift, MoE write strength, and residual update strength. Their exact definitions and aggregation are given in Section 5.2. These quantities describe routing and representation changes at code locations. We compare them with human measurements to examine correspondence, without assuming that response magnitude directly identifies an optimal adaptation location.
Alignment and preprocessing. EEG is resampled to 100 Hz, filtered at 0.5–40 Hz, channel-screened, and common-average referenced. 4–8 Hz theta is measured using median Hilbert log power across six nonfrontal regions, averaged over 0–1 s after backward-fixation onset relative to a -0.8 to -0.2 s baseline. Local theta and dwell/regression/revisit summaries are standardized within participant and aggregated at mapped tokens. Welch theta log-power changes relative to the -5 to -1 s pre-code baseline are averaged across nine regions, standardized within participant and time bin, and averaged across participants and 12 normalized reading bins. Fixations are mapped to visible code spans using image geometry and each model's tokenizer offsets.
Together, these aligned human and model measurements establish where human processing demand corresponds with model computation on the same code. However, downstream code-generation tasks do not come with EEG or eye-tracking data. We therefore next summarize the human observations into transferable guidance that can be applied to new training examples.
4.2 Stage 2: Constructing Transferable Cognitive Priors
The human corpus contains Java programs, whereas downstream training uses Python solutions. CogAdapt therefore transfers two summaries of the human observations: a program-level processing-demand prior and a token-level attention prior based on syntactic role. These priors summarize patterns learned from the source corpus; they are not direct EEG or attention measurements of the downstream Python tasks.
4.2.1 Program-Level Demand Prior. Human EEG recordings provide a starting point for estimating the processing demand of reading code. Prior work has used regression models to relate static code metrics to EEG-measured cognitive load [18]. We follow this general strategy to transfer evidence from human code reading to downstream tasks.
For each of the Java programs, we summarize participant-normalized theta responses across readers and the 12 reading-time bins. We describe its structure using eight properties: character count, nonblank-line count, lexical-token count, maximum nesting depth, and counts of control-flow constructs, function calls, operators, and statements [18]. A ridge regressor with standardized inputs and regularization strength 10 learns how these properties relate to the program-level theta response. For downstream task i, we extract corresponding properties from its Python reference solution and compute
Python tokenization and syntax trees provide approximate counterparts to the Java features. Higher scores indicate resemblance to programs that elicited stronger human theta responses. CogAdapt uses the standardized score to weight training tasks in both models. The score is a proxy for reading demand; computing it requires no EEG recordings for downstream tasks.
4.2.2 Token-Level Attention Prior. Following prior work that uses programmer visual attention to guide LLM training [52, 54], we use attention behavior to construct a transferable token-level
Zhang et al.
attention prior. For each code element observed in the human study, we summarize multiple reading behaviors, including how long participants inspect the element and whether they return to it during comprehension. We combine these signals into an attention score :
where a larger indicates that the corresponding code element received greater human attention. Because the human data are collected on Java while our downstream tasks are written in Python, we do not transfer scores through exact token matching. Instead, we transfer attention through syntactic correspondence. We represent code elements using their syntactic roles and AST context and associate structurally similar elements across the two languages. For a downstream token, its human-attention prior is therefore determined by the attention observed for syntactically similar elements in the human-study programs. This design follows the idea established by prior approaches: human reading behavior is converted into reusable supervision for code-model training [52, 53].
4.3 Stage 3: Selecting Blocks for Each Training Task
Different coding tasks may benefit from adaptation in different parts of the model. To identify these locations, we first pass each training prompt and its reference solution through the pretrained MoE model. For each transformer block, we measure how the MoE router changes its selection of routed experts, how much the block changes its internal representation, and how strongly the selected experts contribute to the block output. We summarize these responses at sampled solution positions and normalize them within each task so that the different signals can be compared on a common scale. The previous analysis tells us which depth ranges tend to show stronger human–model correspondence. We summarize this pattern into a model-specific depth prior and use it as one source of evidence when ranking blocks for a new task. The resulting ranking identifies the blocks favored by the selection policy for that particular task. We also decide how much adaptation capacity to allocate. Higher-demand tasks receive slightly more blocks, while lower-demand tasks receive fewer. We compute it once before fine-tuning and reuse it whenever the task appears during training.
4.4 Stage 4: cognition-informed Sparse Fine-Tuning
After selecting the adaptation blocks for each task, CogAdapt fine-tunes the model using the human-derived priors from Stage 2. These priors affect training at two complementary levels. The program-level EEG prior determines how strongly an entire training example contributes to learning, while the attention prior determines which parts of its reference solution receive greater emphasis. The task-specific mask from Stage 3 then determines where these gradients are allowed to update the model.
Emphasizing cognitively demanding tasks. The program-level processing-demand score provides a transferable estimate of how demanding a training example may be for a human reader. CogAdapt uses this signal to assign larger training weights to examples associated with greater predicted processing demand.
Emphasizing human-attended code. Within each reference solution, CogAdapt uses the attention prior from Section 4.2.2 to emphasize code elements that tend to attract more human attention during comprehension. We also use syntactic context to preserve this emphasis when transferring the prior to the downstream code-generation data.
Combining the task-level and token-level weights, the supervised objective for task i is
where controls the importance of the overall training example and controls the importance of individual code tokens. The underlying objective remains standard next-token prediction; human data changes only how the supervision is distributed across examples and code locations.
Restricting learning to selected blocks. CogAdapt applies the task-specific block mask obtained in Stage 3. Although the full model participates in the forward pass, only the adaptation parameters within the selected blocks are allowed to receive gradients for the current example. The pretrained MoE experts remain frozen, while lightweight attention adapters and router parameters in the selected blocks are updated. Human signals determine what training information should receive greater emphasis, while the task-dependent block mask determines where the resulting learning should occur. As a result, each example can focus both its supervision and its adaptation capacity on the parts of the training process that are most relevant to that task.
4.5 Stage 5: Standard Inference without Human Signals
After fine-tuning, CogAdapt is used in the same way as a regular code LLM. Given a new programming prompt, the trained model directly generates the solution using standard inference. No EEG, eye-tracking data, reference solution, or additional cognitive information is required for the downstream task. The human measurements are used only during the earlier stages of CogAdapt to construct transferable priors and guide how the model is adapted during training. Once training is complete, this information is already reflected in the learned model parameters. As a result, CogAdapt does not require new human data when applied to unseen code-generation problems, making the approach compatible with standard deployment settings.
5 Evaluation
Our evaluation follows the progression from human–model correspondence to its practical use in model adaptation. RQ1 first examines whether developers and MoE models respond more strongly to the same code regions. RQ2 then examines where this correspondence appears across model depth and human reading stages. These two analyses provide the empirical motivation for task-dependent block selection. Finally, RQ3 evaluates whether using this information for cognition-informed sparse adaptation can improve code-generation accuracy while reducing the training resources required for adaptation.
We study Qwen3-Coder-30B-A3B-Instruct and GLM-4.7-Flash. Qwen contains 48 transformer blocks and routes each token to eight of 128 experts. GLM contains 47 transformer blocks; each routed MoE block selects four of 64 routed experts and additionally contains a shared expert. We exclude GLM's shared expert when computing router-distribution statistics.
5.1 Datasets and Benchmarks
5.1.1 Human Code-Comprehension Corpus. We use the NoviceVsExpert corpus [33], a controlled code-comprehension study with 37 participants. Participants read 32 Java programs of varying difficulty and answered questions about their behavior while their eye movements and EEG signals were recorded. This provides complementary views of human code comprehension: reading time captures the overall effort spent on a program, eye tracking shows which parts of the code receive attention, and EEG provides a measure of neural activity during comprehension. At finer granularity,
Zhang et al.
we align eye fixations with the code being viewed and summarize how long readers look at each location, how often they revisit it, and when they look back to an earlier part of the program. We normalize these attention measures within each participant before combining them across readers. We further group nearby tokens into 81 semantic code regions, allowing human and model responses to be compared at the same meaningful code locations.
5.1.2 Code-Generation Benchmarks. We evaluate on two benchmarks: LiveCodeBench (LCB) [22] and BigCodeBench (BCB) [56]. LCB supplies contest-style programming problems, while BCB tests instruction following and the composition of library functions. For LCB, the final training corpus contains 534 execution-validated Python reference solutions prepared from versions 1–4; evaluation uses 175 tasks from the saved version-6 manifest. For BCB, the saved manifest partitions 1,140 tasks into 760 training, 160 development, and 220 test tasks.
5.2 Metrics
5.2.1 Model Computation Signals
LLM Signal Extraction and notation. For token at block , let and be the block input and output, the attention write, the complete MoE/MLP write, and the total residual update. We suppress the block index when defining individual metrics; always refers to the preceding token at the same block. Let denote Qwen's normalized distribution over all 128 experts, its actual top-eight dispatch set, and its captured dispatch-weight vector, with zero entries for unselected experts. Full-distribution statistics and actual dispatch statistics capture different aspects of routing. GLM instead uses 64 routed experts and a shared expert; the shared expert contributes to but is excluded from routing statistics.
Expert-choice confidence. Expert-choice confidence measures how strongly the router prefers a small set of experts for a token. Intuitively, if the routing probability is spread nearly uniformly across experts, the router is uncertain; if most of the probability is concentrated on a few experts, the router is more confident. Let denote the normalized routing probability assigned to expert e, and let E be the number of routed experts. We use normalized routing entropy to illustrate this idea:
is close to 0 when the router distributes probability broadly across experts, and approaches 1 when its routing decision is concentrated on a small number of experts. Thus, a larger value indicates a more decisive expert choice.
Expert-choice change. Expert-choice change measures how much the router changes its selected experts between two neighboring code tokens. Intuitively, if two consecutive tokens use nearly the same experts, the routing decision is stable; if they use substantially different experts, the model is reallocating its computation. Let and denote the sets of experts selected for the current and preceding token, respectively. We illustrate this change using Jaccard distance:
is close to 0 when consecutive tokens use mostly the same experts, and becomes larger as more experts are replaced. Thus, a larger value indicates a stronger change in how the model allocates computation across experts.
Hidden-state shift. Hidden-state shift measures how much the model’s internal representation changes between two neighboring code tokens. Intuitively, if consecutive tokens are represented similarly, the shift is small; if the next token substantially changes the representation, the shift is large. Let and denote the hidden representations of the current and preceding token. A simple measure of this change is the normalized Euclidean distance:
A larger value therefore indicates that moving to the current token produces a stronger change in the model’s internal representation.
MoE write. MoE write measures the strength of the contribution produced by the model’s expert network at the current token. Let denote the output produced by the MoE/MLP component and the representation entering the block. A simple normalized measure is
A larger value indicates that the experts make a stronger contribution relative to the representation already present at that block.
Residual integration. Residual integration characterizes how strongly the computation inside a transformer block is incorporated into the representation passed to the next block. Intuitively, it asks whether the block makes only a small modification to the incoming representation or produces a substantial, well-aligned update.
Let
denote the total update produced by a block. A simple measure of update strength is
Larger values indicate that the block changes the incoming representation more strongly.
5.2.2 Human-Model Correspondence
Rank correlation. To measure whether humans and models respond strongly to the same code, we use Spearman’s rank correlation ( ). Spearman correlation measures whether two quantities follow a similar ordering without requiring them to have the same scale or a linear relationship [37]. This is useful in our setting because human measurements, such as attention and EEG, and model-computation signals have very different units.
Formally, we compute
where X is a human response and Y is a model response measured over the same observations. A positive means that code locations or programs receiving stronger human responses also tend to produce stronger model responses; a negative value indicates the opposite ordering, while values closer to zero indicate less consistent correspondence. Depending on the analysis, each observation represents a token, a semantic code region, or a complete program. This type of human–model comparison follows prior work showing that representations of source code can exhibit correspondence between human brain activity and learned code representations [42].
Zhang et al.
Depth-time correspondence. We further ask whether human-model correspondence is distributed across the model and whether it changes as humans progress through a program. Prior studies of language processing have shown that brain-model correspondence can vary across both model layers and stages of human processing [4, 38]. Following this idea, we compare each model-computation signal at every transformer block with human EEG theta measured over 12 normalized stages of program reading. For model signal s, block b, and reading stage t, we summarize this relationship as
where is the model response across programs and is the corresponding human theta response. We control for program length so that the comparison reflects more than simply larger programs producing larger responses. The resulting depth-time map provides an intuitive view of the relationship: each cell asks whether, at a particular model block and stage of human reading, programs that elicit stronger human responses also elicit stronger model computation.
5.2.3 Execution Accuracy and Statistical Comparison. We assess code-generation quality on the held-out tasks described in Section 5.1.2 using execution-based pass@1. Pass@1 is a percentage of solved tasks; is an absolute percentage-point difference. Each condition uses its first complete generation pass. For Random-K6, the reported standard deviation is across three fixed masks.
5.2.4 Adaptation Sparsity and Training Efficiency. We evaluate how selectively COGADAPT allocates adaptation capacity and whether this selectivity translates into lower training cost. Mean selected blocks reports the average number of transformer blocks selected for adaptation for each unique training task. Gradient-eligible parameters measures the average number of attention-adapter and router parameters that are allowed to receive gradients for one task. Adaptation reduction reports the percentage reduction in these gradient-eligible parameters relative to the all-block Regular FT baseline.
To measure practical training cost, we additionally report training wall time and GPU energy consumption. Wall time records the elapsed training time, while GPU energy is estimated from sampled GPU power over the recorded measurement interval. We report their reductions relative to the matched Regular FT condition, where a positive reduction indicates lower measured training cost.
5.3 Baselines and Ablations
We compare CogAdapt with standard and sparse fine-tuning baselines, and use a set of controlled ablations to examine where its gains come from. Unless otherwise stated, all methods use the same training data, optimization settings, LoRA configuration, and evaluation protocol.
5.3.1 Baselines
Regular fine-tuning (Regular FT). This baseline applies the same attention-LoRA and router-gate adaptation to every candidate block. It uses the same benchmark-specific training data, adapter rank, training exposure, and optimization settings as CogAdapt, but does not perform selective block adaptation.
Representation-based block selection (CKA-K6). We further compare with a model-internal sparse selection strategy based on centered kernel alignment (CKA), following prior work on using representation similarity to identify transformer layers for adaptation [29]. For each block, we compute linear CKA between its input and output representations, extracted at the final non-padding token of the training prompts and reference solutions. For centered representation matrices and ,
where denotes the Frobenius norm. A lower CKA score indicates a larger representational change between a block's input and output. We therefore select the six blocks with the lowest CKA scores and keep this set fixed during adaptation. Unlike CogAdapt, this baseline determines where to fine-tune entirely from the model's internal representations, without using human cognitive signals.
5.3.2 Ablations. We design five ablations to isolate the main components of CogAdapt. They differ primarily in which human signals are used and how adaptation blocks are selected. Unless otherwise stated, all variants use the same training data, optimization settings, and evaluation protocol as CogAdapt.
All-Block. This variant retains CogAdapt’s EEG-derived task weighting and attention-derived token weighting, but updates all candidate blocks instead of selectively chosen blocks.
Rand-K6. This variant retains CogAdapt’s human-derived task and token weighting, but replaces cognitive-informed block selection with six randomly selected blocks. The same six blocks are fixed across all tasks and throughout training and inference.
Model-Only. This variant removes all human-derived guidance. For each task, it selects blocks only from the model's own behavior. The highest-scoring blocks are then fine-tuned, so different tasks can adapt different blocks.
No-EEG.. This variant removes EEG-derived task weighting and EEG-based block-selection guidance, while retaining attention based token weighting.
No-Gaze. This variant removes attention-based token weighting, so all supervised completion tokens receive equal loss weight. EEG-derived task weighting and block selection remain unchanged.
5.4 Training and Hardware Settings
Training configuration. Attention adapters use rank 16, scale 32, and dropout 0.05. AdamW uses learning rates for attention adapters and for router gates, , , , and weight decay 0.01. Learning rates follow a 3% linear warmup and cosine decay; the gradient norm is clipped at 1.0. The microbatch contains one example, with eight microsteps accumulated per update. The recorded setup uses two NVIDIA RTX A6000 GPUs. The reproduction host exposes an Intel Xeon Gold 6330N CPU at 2.20 GHz, 28 physical cores, 56 logical CPUs, and 256GiB of RAM.
6 Results
6.1 RQ1: Do Humans and MoE Models Respond More Strongly to the Same Code Regions?
Human reading responses and MoE computation are positively correlated across code categories. Figure 4 provides the main view of this relationship. We group semantic code regions into four common categories—control flow, calls/returns, array expressions, and scalar/other operations—and examine the distribution of Spearman correlations within each category. The four panels compare human attention and EEG theta-band activity with the model responses of Qwen and GLM. Across all human-signal/model combinations and all four code categories, 75.0%-83.3% of the displayed
Zhang et al.


C EEG theta-band power-Qwen

D EEG theta-band power-GLM

Fig. 4. Human–model alignment across code categories. The x-axis groups code regions into four semantic categories. The y-axis shows the percentage of regions in each correlation range. Gray indicates nonpositive correlations; increasingly dark blue indicates stronger positive correlations. The four panels compare human attention or EEG theta-band activity with Qwen or GLM. For each region, Spearman correlation is calculated across matched code tokens between the human signal and the mean of five standardized model metrics. Across all displayed regions, median correlations and approximate 95% resampling intervals are: Attention–Qwen, 0.240 [0.084, 0.341]; Attention–GLM, 0.200 [0.071, 0.288]; EEG theta–Qwen, 0.183 [0.000, 0.217]; and EEG theta–GLM, 0.200 [0.011, 0.214]. Intervals use 5,000 resampling draws accounting for repeated observations from the same participants and programs.
regions show positive correlations ( ). In other words, code regions that receive stronger human responses also tend to induce stronger model computation.
The correspondence is also not uniform across code regions. Some regions show relatively weak positive relationships, whereas others exhibit stronger correspondence. For example, Attention–Qwen correspondence is positive for 83.3% of array-expression regions and 82.4% of scalar/other regions, while the other category/model combinations remain positive for roughly three quarters or more of the regions. The strength of the relationship also differs between Qwen and GLM and between attention and EEG, suggesting that human-salient code is reflected through different internal responses across model architectures.
Answer to RQ1. Human reading responses and MoE computation show positive correspondence at the same semantic code locations. This pattern appears across both attention and EEG and across both model families, although its strength varies by code region and architecture. Importantly, this result provides a practical motivation for CogAdapt's training design: human cognitive signals can identify code regions that are also computationally salient to the model, supporting their use as guidance for emphasizing training examples and code tokens during adaptation.
Qwen3-Coder-30B · blocks 0-47
GLM-4.7-Flash · blocks 0-46


Brain-Model Alignment (Spearman )
Fig. 5. Human brain–model alignment during code reading. The x-axis shows successive transformer blocks (model layers), from earlier to deeper processing. The y-axis shows human reading time, progressing upward from Early through Middle to Late. Colors show how each model measure relates to human EEG theta activity across the same 32 programs. Red indicates a positive association, blue a negative association.

Fig. 6. An example of program-level human–model correspondence at Qwen block 41. Each point represents one of the 32 programs. The left panel shows that programs producing larger hidden-state changes in the model tend to require longer human reading time. The middle panel shows that longer reading time is associated with stronger EEG theta activity, while the right panel shows a direct positive relationship between model hidden-state change and EEG theta activity.
Zhang et al.
6.2 RQ2: Where in the MoE Model Does Computation Correspond to Human Processing Demand?
Human–model correspondence forms structured patterns across model depth. Figure 5 provides the main result for RQ2. For each transformer block, we compare five model-computation signals with human EEG theta activity across the 32 programs, while also considering when the EEG response occurs during the reading process. Each cell reports a Spearman correlation: warmer regions indicate that programs producing stronger model responses also tend to elicit stronger human theta responses, whereas cooler regions indicate the opposite relationship.
The heatmaps reveal positive correspondence, but importantly, this correspondence is structured rather than uniform. For Qwen, hidden-state shift shows broad positive associations across middle and later blocks and remains visible across multiple stages of human reading. Expert-choice change also develops extended positive regions through the middle and deeper portions of the model, while residual integration is frequently positive across a broad span of blocks. Expert-choice confidence and MoE write show more localized positive regions. Together, these patterns indicate that human-model correspondence is stronger at some model depths than at others, rather than being distributed uniformly across the network.
GLM exhibits a different, but similarly organized, pattern. Expert-choice confidence and MoE write show the clearest positive correspondence with EEG theta, particularly across middle and deeper blocks. In contrast, hidden-state shift and expert-choice change are largely negative, while residual integration contains a mixture of positive and negative regions. Thus, the two architectures do not express human-model correspondence through the same internal quantity: Qwen shows clearer correspondence in representational change and integration, whereas GLM shows clearer correspondence in routing confidence and expert contribution. The important commonality is that both models contain identifiable ranges of blocks where human processing demand corresponds systematically with model computation.
The correspondence is distributed rather than tied to one special block. Figure 6 provides a concrete example of the broader pattern in Figure 5. For Qwen block 41, programs with larger hidden-state changes also tend to require longer human reading time. Human reading time is itself positively associated with EEG theta activity, while hidden-state change is directly correlated with EEG theta activity. This example illustrates that programs requiring greater human processing can also produce greater changes in the model's internal computation.
We do not interpret block 41 as a uniquely “brain-aligned” block. Rather, Figure 5 shows that related positive associations occur across multiple neighboring depths, and that their locations and computational forms differ between model architectures. The key finding is therefore that the correspondence is distributed, depth-dependent, and architecture-dependent. If human-related computation were concentrated in one universal block, a fixed adaptation location could be sufficient. Instead, the relevant blocks vary across the model and across architectures. This directly motivates CogAdapt’s task-dependent design: rather than updating all blocks or using one fixed sparse subset, CogAdapt selects different blocks for different coding tasks, while human-derived processing signals guide the amount and emphasis of adaptation.
Answer to RQ2. Human processing demand exhibits systematic correspondence with MoE computation across model depth. Figure 5 shows broad and structured positive regions in both model families, although the model signals carrying this correspondence differ between Qwen and GLM. The relationship is therefore distributed, depth-dependent, and architecture-dependent, rather than confined to a single universally aligned block. This provides the empirical basis for CogAdapt: human signals reveal where meaningful model computation occurs, while the
Table 1. Pass@1 (%) of baselines, CogAdapt ablations, and the full method. Rand-K6 reports mean ± standard deviation over three fixed random six-block masks. Bold indicates the best result in each setting.
| Model | Benchmark | Baselines | Ablations | Full CogAdapt | |||||
|---|---|---|---|---|---|---|---|---|---|
| Regular FT | CKA-K6 | All-Block | Rand-K6 | Model-Only | No-EEG | No-Gaze | |||
| Qwen | LCB | 18.86 | 24.57 | 20.00 | 22.86 ± 0.57 | 24.00 | 26.29 | 28.57 | 29.71 |
| Qwen | BCB | 36.36 | 32.73 | 34.55 | 34.39 ± 1.14 | 36.36 | 35.91 | 37.73 | 37.73 |
| GLM | LCB | 17.71 | 21.14 | 20.00 | 20.00 ± 1.51 | 22.29 | 21.14 | 21.71 | 24.00 |
| GLM | BCB | 28.64 | 28.64 | 30.91 | 30.76 ± 0.95 | 28.18 | 29.55 | 30.00 | 31.82 |
Table 2. Training-side efficiency of task-dependent sparse adaptation.
| Model | Bench. | Mean Blocks | Eligible Params (M) | All-block Params (M) | Adapt. Reduction | Train Time (s) Ours / FT | Time Reduction | GPU Energy (Wh) Ours / FT | Energy Reduction |
|---|---|---|---|---|---|---|---|---|---|
| Qwen | LCB | 6.25 / 48 | 3.382 | 25.952 | 86.97% | 1883.78 / 1944.82 | 3.14% | 188.10 / 192.81 | 2.44% |
| Qwen | BCB | 6.14 / 48 | 3.319 | 25.952 | 87.21% | 2201.15 / 2304.37 | 4.48% | 190.02 / 197.04 | 3.56% |
| GLM | LCB | 6.09 / 47 | 3.486 | 27.061 | 87.12% | 1608.03 / 1649.79 | 2.53% | 168.99 / 172.66 | 2.12% |
| GLM | BCB | 6.55 / 47 | 3.733 | 27.061 | 86.21% | 1888.42 / 2006.22 | 5.87% | 174.00 / 182.28 | 4.55% |
lack of one universally optimal block motivates dynamically selecting adaptation blocks for each coding task.
6.3 RQ3: Does CogAdapt Improve Code Generation with More Selective Adaptation?
CogAdapt improves accuracy over both dense and fixed sparse adaptation. Table 1 shows that CogAdapt achieves the best or tied-best pass@1 across the four model–benchmark settings. The improvement is especially clear on LiveCodeBench. For Qwen, pass@1 increases from 18.86% with Regular FT to 29.71% with CogAdapt, a gain of 10.86 percentage points, while GLM improves from 17.71% to 24.00%, a gain of 6.29 points. On BigCodeBench, CogAdapt reaches 37.73% for Qwen and 31.82% for GLM, again outperforming Regular FT. CogAdapt also exceeds the fixed CKA-K6 baseline in all four settings, suggesting that task-dependent adaptation is more useful than committing to the same representation-based block set for every task.
Ablations show that both block selection and human guidance matter. Simply applying human-weighted training to every block does not produce the same benefit: All-Block performs below CogAdapt in all four settings. Replacing informed block selection with a fixed random set also reduces accuracy, with Rand-K6 trailing CogAdapt across both models and benchmarks. Model-Only, which chooses blocks from the model's own responses but removes human guidance, also performs consistently below the full method. For example, its pass@1 drops from 29.71% to 24.00% on Qwen-LCB and from 24.00% to 22.29% on GLM-LCB. These results indicate that CogAdapt benefits not only from adapting fewer blocks, but also from using human signals to guide where and how adaptation occurs. The individual cognitive signals provide complementary contributions. Removing EEG reduces Qwen-LCB from 29.71% to 26.29%, Qwen-BCB from 37.73% to 35.91%, and GLM-LCB from 24.00% to 21.14%. Removing gaze has a smaller effect on Qwen-LCB, reducing pass@1 to 28.57%, while GLM-LCB drops from 24.00% to 21.71%. On Qwen-BCB, No-Gaze matches CogAdapt at 37.73%.
CogAdapt concentrates learning in only a small part of the model. Table 2 shows that CogAdapt selects only about 6.1–6.6 blocks per task, compared with all 47–48 blocks under Regular FT. This reduces gradient-eligible adaptation parameters from 25.95–27.06M to only 3.32–3.73M,
Zhang et al.
corresponding to an 86.21–87.21% reduction. Despite executing the full backbone during the forward pass, CogAdapt also reduces wall-clock training time by 2.53–5.87% and measured GPU energy by 2.12–4.55%.
Answer to RQ3. CogAdapt achieves stronger or comparable code-generation accuracy while adapting only about six blocks per task. Its largest improvements over Regular FT are 10.86 and 6.29 percentage points on LiveCodeBench, while reducing gradient-eligible adaptation parameters by approximately 86–87%. The ablations further show that both informed block selection and human cognitive guidance contribute to these gains.
7 Discussion, Limitations, and Future Directions
Our results show that cognition-informed sparse adaptation can improve code generation while reducing the number of parameters updated during training. We next discuss why this selective adaptation may be effective, its current computational limitations, and directions for extending sparsity beyond model adaptation.
Why selective adaptation can improve accuracy. CogAdapt's gains suggest that adaptation quality depends on where updates occur, not only on how many parameters receive gradients. Model responses identify blocks relevant to each task, while human-derived difficulty priors control the adaptation budget. Restricting each example's updates to these blocks may reduce interference with representations useful for other tasks, while preserving the pretrained expert weights. Human-derived task and token weights further concentrate supervision on examples and code regions associated with greater processing demand. Together, these mechanisms may help a smaller per-example adaptation budget produce more useful updates. CogAdapt's improvements over both all-block fine-tuning and fixed sparse baselines support the value of task-dependent selection.
From sparse adaptation toward sparse computation. CogAdapt reduces the number of parameters that are eligible for gradients for each training example, but the full backbone still participates in the forward pass. Consequently, the reduction in wall-clock time and energy is smaller than the reduction in adaptation parameters. This distinction suggests an important next step: connecting cognitively informed adaptation with conditional model execution. For example, future systems could extend sparsity beyond standard MoE routing. While an MoE model already selects only a subset of experts within each MoE block, the full sequence of transformer blocks still participates in the forward pass. A future system could additionally use human-informed signals to decide which blocks or adapters should participate for a given task, or whether some block-level computation can be skipped entirely. Combining expert routing with conditional block or adapter activation, early exiting, or other forms of dynamic execution could therefore translate CogAdapt's adaptation sparsity into larger training and inference savings.
8 Conclusion
We present CogAdapt, a cognition-informed framework that uses human attention and EEG signals to guide task-dependent sparse adaptation of MoE code models. Our analysis shows that human processing and model computation correspond both at individual code regions and across model depth, although the specific patterns differ between architectures. Rather than assuming a single universally aligned layer, CogAdapt transfers these cognitive signals as priors to guide what training examples and code regions receive more emphasis and where adaptation occurs within the model.
Across two MoE backbones and two code-generation benchmarks, CogAdapt achieves the best pass@1 among the evaluated methods. Compared with regular fine-tuning, it improves LiveCodeBench pass@1 by 10.86 percentage points for Qwen and 6.29 points for GLM. Our ablations further show that these gains are not explained by sparse fine-tuning alone: using all blocks, fixed random blocks, or model-only block selection generally performs worse than the full CogAdapt, while removing EEG or attention guidance also reduces performance in most evaluated settings. At the same time, CogAdapt reduces per-example gradient-eligible adaptation parameters by 86.21–87.21%, together with reductions in training time and estimated GPU energy. Overall, our findings show that human comprehension signals can provide useful guidance not only for what a model should learn from, but also for where learning should occur.
References
[1] Tarek Alakmeh, David Reich, Lena Jäger, and Thomas Fritz. 2024. Predicting Code Comprehension: A Novel Approach to Align Human Gaze with Code Using Deep Neural Networks. Proceedings of the ACM on Software Engineering 1, FSE (2024), 1982–2004. doi:10.1145/3660795
[2] David Attwell and Simon B. Laughlin. 2001. An Energy Budget for Signaling in the Grey Matter of the Brain. Journal of Cerebral Blood Flow & Metabolism 21, 10 (2001), 1133–1145. doi:10.1097/00004647-200110000-00001
[3] Aakash Bansal, Bonita Sharif, and Collin McMillan. 2023. Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarization. Proceedings of the ACM on Human-Computer Interaction 7, ETRA (2023), 1–19. doi:10.1145/3591136
[4] Charlotte Caucheteux and Jean-Rémi King. 2022. Brains and algorithms partially converge in natural language processing. Communications Biology 5, 1 (2022), 134. doi:10.1038/s42003-022-03036-1
[5] Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sastry, Pamela Mishkin, Brooke Chan, Scott Gray, Nick Ryder, Mikhail Pavlov, Alethea Power, Lukasz Kaiser, Mohammad Bavarian, Clemens Winter, Philippe Tillet, Felipe Petroski Such, Dave Cummings, Matthias Plappert, Fotios Chantzis, Elizabeth Barnes, Ariel Herbert-Voss, William Hebgen Guss, Alex Nichol, Alex Paino, Nikolas Tezak, Jie Tang, Igor Babuschkin, Suchir Balaji, Shantanu Jain, William Saunders, Christopher Hesse, Andrew N. Carr, Jan Leike, Josh Achiam, Vedant Misra, Evan Morikawa, Alec Radford, Matthew Knight, Miles Brundage, Mira Murati, Katie Mayer, Peter Welinder, Bob McGrew, Dario Amodei, Sam McCandlish, Ilya Sutskever, and Wojciech Zaremba. 2021. Evaluating Large Language Models Trained on Code. arXiv:2107.03374 https://arxiv.org/abs/2107.03374 arXiv preprint.
[6] Igor Crk, Timothy Kluthe, and Andreas Stefik. 2016. Understanding Programming Expertise: An Empirical Study of Phasic Brain Wave Changes. ACM Transactions on Computer-Human Interaction 23, 1 (2016), 1–29. doi:10.1145/2829945
[7] Alex de Vries. 2023. The Growing Energy Footprint of Artificial Intelligence. Joule 7, 10 (2023), 2191–2194. doi:10.1016/j.joule.2023.09.004
[8] DeepSeek-AI. 2024. DeepSeek-V3 Technical Report. arXiv preprint arXiv:2412.19437 (2024).
[9] DeepSeek-AI, Qihao Zhu, Daya Guo, Zhihong Shao, Dejian Yang, Peiyi Wang, Runxin Xu, Y. Wu, Yukun Li, Huazuo Gao, Shirong Ma, Wangding Zeng, Xiao Bi, Zihui Gu, Hanwei Xu, Damai Dai, Kai Dong, Liyue Zhang, Yishi Piao, Zhibin Gou, Zhenda Xie, Zhewen Hao, Bingxuan Wang, Junxiao Song, Deli Chen, Xin Xie, Kang Guan, Yuxiang You, Aixin Liu, Qiushi Du, Wenjun Gao, Xuan Lu, Qinyu Chen, Yaohui Wang, Chengqi Deng, Jiashi Li, Chenggang Zhao, Chong Ruan, Fuli Luo, and Wenfeng Liang. 2024. DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligence. arXiv:2406.11931 https://arxiv.org/abs/2406.11931 arXiv preprint.
[10] Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2023. QLoRA: Efficient Finetuning of Quantized LLMs. arXiv:2305.14314 https://arxiv.org/abs/2305.14314 arXiv preprint.
[11] Sarah Fakhoury, Yuzhan Ma, Venera Arnaoudova, and Olusola Adesope. 2018. The effect of poor source code lexicon and readability on developers' cognitive load. In Proceedings of the 26th Conference on Program Comprehension. ACM, 286–296. doi:10.1145/3196321.3196347
[12] William Fedus, Barret Zoph, and Noam Shazeer. 2022. Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity. Journal of Machine Learning Research 23, 120 (2022), 1–39. https://www.jmlr.org/papers/v23/21-0998.html
[13] Zhangyin Feng, Daya Guo, Duyu Tang, Nan Duan, Xiaocheng Feng, Ming Gong, Linjun Shou, Bing Qin, Ting Liu, Daxin Jiang, and Ming Zhou. 2020. CodeBERT: A Pre-Trained Model for Programming and Natural Languages. In Findings of the Association for Computational Linguistics: EMNLP 2020. Association for Computational Linguistics, 1536–1547. doi:10.18653/v1/2020.findings-emnlp.139
[14] Benjamin Floyd, Tyler Santander, and Westley Weimer. 2017. Decoding the Representation of Code in the Brain: An fMRI Study of Code Review and Expertise. In 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE). IEEE, 175–186. doi:10.1109/icse.2017.24
Zhang et al.
[15] Daniel Fried, Armen Aghajanyan, Jessy Lin, Sida Wang, Eric Wallace, Freda Shi, Ruiqi Zhong, Wen-tau Yih, Luke Zettlemoyer, and Mike Lewis. 2023. InCoder: A Generative Model for Code Infilling and Synthesis. In International Conference on Learning Representations. https://openreview.net/forum?id=hQwb-lbM6EL
[16] Thomas Fritz, Andrew Begel, Sebastian C. Müller, Serap Yigit-Elliott, and Manuela Züger. 2014. Using psychophysiological measures to assess task difficulty in software development. In Proceedings of the 36th International Conference on Software Engineering. ACM, 402–413. doi:10.1145/2568225.2568266
[17] Changjiang Gao, Shujian Huang, Jixing Li, and Jiajun Chen. 2023. Roles of Scaling and Instruction Tuning in Language Perception: Model vs. Human Attention. In Findings of the Association for Computational Linguistics: EMNLP 2023. Association for Computational Linguistics, 13042–13055. doi:10.18653/v1/2023.findings-emnlp.868
[18] Gao Hao, Haytham Hijazi, Júlio Medeiros, João Durães, Chan Tong Lam, Paulo de Carvalho, and Henrique Madeira. 2026. Complementarity in Software Code Complexity Metrics. Journal of Systems and Software 232 (2026), 112679. doi:10.1016/j.jss.2025.112679
[19] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2022. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations. https://arxiv.org/abs/2106.09685
[20] Yoshiharu Ikutani, Takatomi Kubo, Satoshi Nishida, Hideaki Hata, Kenichi Matsumoto, Kazushi Ikeda, and Shinji Nishimoto. 2021. Expert Programmers Have Fine-Tuned Cortical Representations of Source Code. eNeuro 8, 1, Article ENEURO.0405-20.2020 (2021). doi:10.1523/eneuro.0405-20.2020
[21] Anna A Ivanova, Shashank Srikant, Yotaro Sueoka, Hope H Kean, Riva Dhamala, Una-May O'Reilly, Marina U Bers, and Evelina Fedorenko. 2020. Comprehension of computer code relies primarily on domain-general executive brain regions. eLife 9, Article e58906 (2020). doi:10.7554/elife.58906
[22] Naman Jain, King Han, Alex Gu, Wen-Ding Li, Fanjia Yan, Tianjun Zhang, Sida Wang, Armando Solar-Lezama, Koushik Sen, and Ion Stoica. 2025. LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Code. In International Conference on Learning Representations, Vol. 2025. 58791–58831. https://proceedings.iclr.cc/paper_files/paper/2025/file/94074dd5a072d28ff75a76dabed43767-Paper-Conference.pdf
[23] Albert Q. Jiang, Alexandre Sablayrolles, Antoine Roux, Arthur Mensch, Blanche Savary, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Emma Bou Hanna, Florian Bressand, Gianna Lengyel, Guillaume Bour, Guillaume Lample, Lélio Renard Lavaud, Lucile Saulnier, Marie-Anne Lachaux, Pierre Stock, Sandeep Subramanian, Sophia Yang, Szymon Antoniak, Teven Le Scao, Théophile Gervet, Thibaut Lavril, Thomas Wang, Timothée Lacroix, and William El Sayed. 2024. Mixtral of Experts. arXiv:2401.04088 https://arxiv.org/abs/2401.04088 arXiv preprint.
[24] Makrina Viola Kosti, Kostas Georgiadis, Dimitrios A. Adamos, Nikos Laskaris, Diomidis Spinellis, and Lefteris Angelis. 2018. Towards an affordable brain computer interface for the assessment of programmers' mental workload. International Journal of Human-Computer Studies 115 (2018), 52–66. doi:10.1016/j.ijhcs.2018.03.002
[25] William B. Levy and Victoria G. Calvert. 2021. Communication Consumes 35 Times More Energy than Computation in the Human Cortex, but Both Costs Are Needed to Predict Synapse Number. Proceedings of the National Academy of Sciences 118, 18 (2021), e2008173118. doi:10.1073/pnas.2008173118
[26] Yun-Fei Liu, Judy Kim, Colin Wilson, and Marina Bedny. 2020. Computer code comprehension shares neural resources with formal logical inference in the fronto-parietal network. eLife 9, Article e59340 (2020). doi:10.7554/elife.59340
[27] Sasha Luccioni, Yacine Jernite, and Emma Strubell. 2024. Power Hungry Processing: Watts Driving the Cost of AI Deployment?. In Proceedings of the 2024 ACM Conference on Fairness, Accountability, and Transparency. 85–99. doi:10.1145/3630106.3658542
[28] Erik Nijkamp, Bo Pang, Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, and Caiming Xiong. 2023. CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis. In International Conference on Learning Representations. https://openreview.net/forum?id=iaYcJKpY2B_
[29] Keith Ando Ogawa, Bruno Lopes Yamamoto, Lucas Lauton de Alcantara, Lucas Pellicer, Rosimeire Pereira Costa, Edson Bollis, Anna Helena Reali Costa, and Artur Jordao. 2026. Layer-Wise LoRA Fine-Tuning: A Similarity Metric Approach. In International Conference on Pattern Recognition. Springer, 370–385. doi:10.1007/978-3-032-31404-8_25
[30] Bowen Pan, Yikang Shen, Haokun Liu, Mayank Mishra, Gaoyuan Zhang, Aude Oliva, Colin Raffel, and Rameswar Panda. 2024. Dense Training, Sparse Inference: Rethinking Training of Mixture-of-Experts Language Models. arXiv preprint arXiv:2404.05567 (2024).
[31] Rui Pan, Xiang Liu, Shizhe Diao, Renjie Pi, Jipeng Zhang, Chi Han, and Tong Zhang. 2024. Lisa: Layerwise importance sampling for memory-efficient large language model fine-tuning. Advances in Neural Information Processing Systems 37 (2024), 57018–57049.
[32] Norman Peitek, Sven Apel, Chris Parnin, Andre Brechmann, and Janet Siegmund. 2021. Program Comprehension and Code Complexity Metrics: An fMRI Study. In 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE). IEEE, 524–536. doi:10.1109/icse43902.2021.00056
[33] Norman Peitek, Annabelle Bergum, Maurice Rekrut, Jonas Mucke, Matthias Nadig, Chris Parnin, Janet Siegmund, and Sven Apel. 2022. Correlates of programmer efficacy and their link to experience: a combined EEG and eye-tracking study. In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering. ACM, 120–131. doi:10.1145/3540250.3549084
[34] Norman Peitek, Janet Siegmund, Sven Apel, Christian Kastner, Chris Parnin, Anja Bethmann, Thomas Leich, Gunter Saake, and Andre Brechmann. 2020. A Look into Programmers' Heads. IEEE Transactions on Software Engineering 46, 4 (2020), 442–462. doi:10.1109/tse.2018.2863303
[35] Norman Peitek, Janet Siegmund, Chris Parnin, Sven Apel, Johannes C. Hofmeister, and André Brechmann. 2018. Simultaneous measurement of program comprehension with fMRI and eye tracking: a case study. In Proceedings of the 12th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement. ACM, 1–10. doi:10.1145/3239235.3240495
[36] Baptiste Rozière, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi, Jingyu Liu, Romain Sauvestre, Tal Remez, Jérémy Rapin, Artyom Kozhevnikov, Ivan Evtimov, Joanna Bitton, Manish Bhatt, Cristian Canton Ferrer, Aaron Grattafiori, Wenhan Xiong, Alexandre Défossez, Jade Copet, Faisal Azhar, Hugo Touvron, Louis Martin, Nicolas Usunier, Thomas Scialom, and Gabriel Synnaeve. 2023. Code Llama: Open Foundation Models for Code. arXiv:2308.12950 https://arxiv.org/abs/2308.12950 arXiv preprint.
[37] Patrick Schober, Christa Boer, and Lothar A. Schwarte. 2018. Correlation Coefficients: Appropriate Use and Interpretation. Anesthesia & Analgesia 126, 5 (2018), 1763–1768. doi:10.1213/ANE.0000000000002864
[38] Martin Schrimpf, Idan Asher Blank, Greta Tuckute, Carina Kauf, Eghbal A. Hosseini, Nancy Kanwisher, Joshua B. Tenenbaum, and Evelina Fedorenko. 2021. The neural architecture of language: Integrative modeling converges on predictive processing. Proceedings of the National Academy of Sciences 118, 45 (2021), e2105646118. doi:10.1073/pnas.2105646118
[39] Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc Le, Geoffrey Hinton, and Jeff Dean. 2017. Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer. arXiv:1701.06538 https://arxiv.org/abs/1701.06538 arXiv preprint.
[40] Janet Siegmund, Christian Kästner, Sven Apel, Chris Parnin, Anja Bethmann, Thomas Leich, Gunter Saake, and André Brechmann. 2014. Understanding understanding source code with functional magnetic resonance imaging. In Proceedings of the 36th International Conference on Software Engineering. ACM, 378–389. doi:10.1145/2568225.2568252
[41] Janet Siegmund, Norman Peitek, Chris Parnin, Sven Apel, Johannes Hofmeister, Christian Kästner, Andrew Begel, Anja Bethmann, and André Brechmann. 2017. Measuring neural efficiency of program comprehension. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering. ACM, 140–150. doi:10.1145/3106237.3106268
[42] Shashank Srikant, Ben Lipkin, Anna Ivanova, Evelina Fedorenko, and Una-May O'Reilly. 2022. Convergent Representations of Computer Programs in Human and Artificial Neural Networks. In Advances in Neural Information Processing Systems, Vol. 35. Curran Associates, Inc., 18834–18849. https://proceedings.neurips.cc/paper_files/paper/2022/hash/77b5aaf2826c95c98e5eb4ab830073de-Abstract-Conference.html
[43] Emma Strubell, Ananya Ganesh, and Andrew McCallum. 2019. Energy and Policy Considerations for Deep Learning in NLP. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Association for Computational Linguistics, Florence, Italy, 3645–3650. doi:10.18653/v1/P19-1355
[44] Robert Wallace, Aakash Bansal, Zachary Karas, Ningzhi Tang, Yu Huang, Toby Jia-Jun Li, and Collin McMillan. 2025. Programmer Visual Attention During Context-Aware Code Summarization. IEEE Transactions on Software Engineering 51, 5 (2025), 1524–1537. doi:10.1109/TSE.2025.3554990
[45] Yue Wang, Hung Le, Akhilesh Gotmare, Nghi Bui, Junnan Li, and Steven Hoi. 2023. CodeT5+: Open Code Large Language Models for Code Understanding and Generation. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 1069–1088. doi:10.18653/v1/2023.emnlp-main.68
[46] Yue Wang, Weishi Wang, Shafiq Joty, and Steven C.H. Hoi. 2021. CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 8696–8708. doi:10.18653/v1/2021.emnlp-main.685
[47] Jiahao Zhang, Yifan Zhang, Kevin Leach, and Yu Huang. 2026. EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarization. In Proceedings of the 34th IEEE/ACM International Conference on Program Comprehension. 61–72. doi:10.1145/3794763.3794799
[48] Qingru Zhang, Minshuo Chen, Alexander Bukharin, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. 2023. Adaptive Budget Allocation for Parameter-Efficient Fine-Tuning. In International Conference on Learning Representations. https://openreview.net/forum?id=lq62uWRJjiY
[49] Yueke Zhang, Zihan Fang, and Kevin Leach. 2026. Stop the Retrieval Thrash: Brain-Guided Episodic Memory for Repository-Scale Coding Agents. In Proceedings of the 34th ACM International Conference on the Foundations of Software Engineering. 1793–1794.
Zhang et al.
[50] Yueke Zhang, Zihan Fang, Greg Trafton, Daniel Levin, Kevin Leach, and Yu Huang. 2025. CodeACT-R: A Cognitive Simulation Framework for Human Attention in Code Reading. In 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE). IEEE, 3871–3875. doi:10.1109/ASE63991.2025.00333
[51] Yifan Zhang, Chen Huang, Zachary Karas, Thuy Dung Nguyen, Kevin Leach, and Yu Huang. 2025. Enhancing Code LLM Training with Programmer Attention. In Companion Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering. ACM, 616–620. doi:10.1145/3696630.3728510
[52] Yifan Zhang, Chen Huang, Yueke Zhang, Jiahao Zhang, Toby Jia-Jun Li, Collin McMillan, Kevin Leach, and Yu Huang. 2026. EyeMulator: Improving Code Language Models by Mimicking Human Visual Attention. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, 25259–25272. doi:10.18653/v1/2026.acl-long.1158
[53] Yifan Zhang, Jiliang Li, Zachary Karas, Aakash Bansal, Toby Jia-Jun Li, Collin McMillan, Kevin Leach, and Yu Huang. 2024. EyeTrans: Merging Human and Machine Attention for Neural Code Summarization. Proceedings of the ACM on Software Engineering 1, FSE (2024), 115–136. doi:10.1145/3643732
[54] Yueke Zhang, Yifan Zhang, Zihan Fang, Greg Trafton, Daniel Levin, Kevin Leach, and Yu Huang. 2026. ScanCoder: Leveraging Human Attention Patterns to Enhance LLMs for Code. Proceedings of the ACM on Software Engineering 3, FSE (2026), 3230–3252. doi:10.1145/3808150
[55] Hongyun Zhou, Xiangyu Lu, Wang Xu, Conghui Zhu, Tiejun Zhao, and Muyun Yang. 2025. Lora-drop: Efficient lora parameter pruning based on output evaluation. In Proceedings of the 31st international conference on computational linguistics. 5530–5543.
[56] Terry Yue Zhuo, Minh Chien Vu, Jenny Chim, Han Hu, Wenhao Yu, Ratnadira Widyasari, Imam Nur Bani Yusuf, Haolan Zhan, Junda He, Indraneil Paul, Simon Brunner, Chen GONG, James Hoang, Armel Zebaze, Xiaoheng Hong, Wen-Ding Li, Jean Kaddour, Ming Xu, Zhihan Zhang, Prateek Yadav, Naman Jain, Alex Gu, Zhoujun Cheng, Jiawei Liu, Qian Liu, Zijian Wang, Binyuan Hui, Niklas Muennighoff, David Lo, Daniel Fried, Xiaoning Du, Harm de Vries, and Leandro Von Werra. 2025. BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructions. In International Conference on Learning Representations, Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu (Eds.), Vol. 2025. 66602–66656. https://proceedings.iclr.cc/paper_files/paper/2025/file/a6a90bcc2aa470c3871b2d39a67d26e8-Paper-Conference.pdf