AI
New Framework Uses Brain Signals to Improve Code AI While Cutting Training Cost by 87%
Researchers developed CogAdapt, a method that harnesses human brain activity during code reading to selectively fine-tune large language models more efficiently.
Researchers have unveiled a technique that taps into human brain signals to make code-generation AI models both more effective and far cheaper to train. The new approach, called CogAdapt, uses cognitive data from programmers to guide precisely where and how much a code model should adapt when fine-tuned.
The Problem with Traditional Fine-Tuning#
Training powerful code-generating language models typically requires updating vast numbers of parameters across the entire network, a computationally expensive process. Most prior work attempting to align models with human cognition still involves adapting large chunks of the network, offering little practical savings. This inefficiency has motivated researchers to explore whether human cognitive signals could pinpoint exactly which parts of a model most need adjustment.
How CogAdapt Works#
The framework leverages two cognitive signals: electroencephalography (EEG) recordings—which capture brain electrical activity—and eye-tracking attention data collected while programmers read and understand code. CogAdapt learns from these signals to build program-level and token-level priors that reflect where humans focus when processing code. When adapting a model to a new task, the system combines these priors with the model's own behavior to decide:
- How much adaptation capacity to allocate to the task
- Which specific transformer blocks (layers) should be updated during fine-tuning
Once these blocks are selected, only they receive gradient updates during training; the rest of the model stays frozen. Crucially, no fresh human recordings are needed during actual inference.
Strong Results on Benchmarks#
CogAdapt was tested on two popular code-generation benchmarks—LiveCodeBench and BigCodeBench—using Qwen and GLM model families. The results exceeded standard fine-tuning:
- On LiveCodeBench, pass@1 performance jumped by 10.86 and 6.29 percentage points respectively over regular fine-tuning
- The approach reduced trainable parameters by 86–87%, slashing computational overhead
- The method maintained consistent gains across both model architectures
The researchers discovered a clear alignment between where humans attend during code reading and how Mixture-of-Experts (MoE) layers activate in the models, suggesting that cognitive signals genuinely reflect meaningful model mechanisms.

