arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

CogAdapt:基于认知信息的代码大语言模型稀疏适配

CogAdapt: Cognition-informed Sparse Adaptation of Code LLMs

Yueke Zhang, Zihan Fang, Kevin Leach, Yu Huang

arXiv 2610.07446首次发表:更新:

发表机构

Vanderbilt University(范德堡大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

CogAdapt利用人类脑电图和注意力数据学习先验,指导代码大语言模型在微调时仅更新选中的Transformer块,实现稀疏适配,在LiveCodeBench和BigCodeBench上取得最佳pass@1,并大幅减少适配参数。

AI 中文摘要

大型语言模型(LLMs)在生成代码方面已变得日益强大。然而,要实现更强的代码生成性能,仍然常常依赖于代价高昂的模型适配,即对预训练模型参数进行微调。先前的研究已表明,人类代码处理与神经模型的注意力或内部计算之间存在对应关系。人类对齐的学习方法使用认知信号来指导训练,但通常适配模型的大部分,使得训练成本基本不变。人类认知信号不仅可能指示模型必须学习什么,还可能指示适配在何处最为有用。我们研究了代码阅读期间的人类反应是否与代码模型行为相对应,并能否在牺牲性能的情况下指导选择性适配。我们提出了CogAdapt,一个基于认知信息的框架,用于代码模型的任务依赖稀疏适配。CogAdapt首先从人类脑电图(EEG)和注意力数据中学习可迁移的程序级和令牌级先验,然后将这些先验与冻结模型对每个编码任务的响应相结合,以确定分配多少适配以及哪些Transformer块应接收更新。在微调期间,仅更新选中的块,而推理时无需新的人类记录。在Qwen和GLM上,我们发现人类阅读行为与混合专家(MoE)计算之间存在一致的对应关系。CogAdapt在LiveCodeBench和BigCodeBench上均取得了最佳的pass@1,包括在LiveCodeBench上相比匹配的常规微调提高了10.86和6.29个百分点,同时将梯度可用的适配参数减少了86.21%至87.21%。这些结果表明,人类理解信号可以为使代码模型适配更具选择性和有效性提供有用的指导。

英文摘要

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. Prior studies have shown correspondence between human code processing and neural models' attention or internal computation. Human-aligned learning approaches use cognitive signals to guide training, but typically adapt a large portion of the model, leaving training costs largely unchanged. Human cognitive signals may indicate not only what the model must learn from, but also where adaptation is most useful. We investigate whether human responses during code reading correspond to code-model behavior and can guide selective 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 Mixture-of-Experts (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.

Comments22 pages, 6 figures

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑