Aligning Code Language Models with Human Cognitive Patterns
Date
Authors
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
The rapid integration of Large Language Models (LLMs) into software engineering has exposed a fundamental disconnect between the probabilistic nature of machine code generation and the structured, intent-driven cognitive processes of human developers. This dissertation addresses this gap by proposing a unified framework for Cognitive Alignment, a system designed to ground model behavior in observable human utility and comprehension rather than mere statistical likelihood. By treating human cognition as a structured supervision signal, the research establishes a robust methodology for transforming Code LLMs from stochastic text generators into cognitively aware partners that mirror the problem-solving strategies of expert programmers.
The proposed framework operates through a synergistic, three-layer architecture that bridges data efficiency, architectural attention, and scalable adaptation. First, the system establishes a data-centric foundation via MalMixer, demonstrating that injecting domain-specific expert knowledge into training pipelines creates a necessary baseline for model resilience in data-scarce environments. Second, the architecture advances to EyeTrans, a direct fusion mechanism that integrates granular physiological signals, specifically programmer gaze patterns, into Transformer attention layers, effectively training models to attend to code syntax and semantics with human-like precision. Finally, the framework achieves scalability through EyeMulator, an adaptation layer that distills these biological insights into reusable attention priors. This enables models to emulate human cognitive patterns without requiring real-time physiological sensors, culminating in a comprehensive AI ecosystem that is both interpretably aligned and functionally superior.