Comprehension of computer code relies primarily on domain-general executive brain regions

Which parts of our brains light up when reading programs? Is it the language region? Are programs treated as natural languages by the brain? Turns out, no.

Tags: papers cognitive-neuroscience program-representation 

  1. eLife-2020
    Comprehension of computer code relies primarily on domain-general executive resources
    Ivanova, Anna A, Srikant, Shashank, Sueoka, Yotaro, Kean, Hope H, Dhamala, Riva, O’Reilly, Una-May, Bers, Marina U, and Fedorenko, Evelina
    BioRxiv 2020


Do our brains process programming languages as natural language? Or do they process it as math and logic? I will talk about our recent work on identifying brain regions involved in comprehending computer programs. We use functional magnetic resonance imaging (fMRI) to investigate two candidate systems of brain regions which may support code comprehension – the Multiple Demand (MD) system, known to respond to a range of cognitively demanding tasks, and the Language system, known to primarily respond to language stimuli. We devise experiment conditions to isolate the act of code comprehension, and employ a state-of-the-art method to locate brain systems of interest. We administer these experiments in Python and ScratchJr. - which provides a visual interface to programming, thus eliminating the effect of text in code comprehension. From this robust experiment setup, we find that the language system is not consistently involved in code comprehension, while the MD system is. We also find that variable names, the control flow used in the program, and the types of operations performed do not affect brain responses.

This is joint work with Una-May O’Reilly from CSAIL, MIT; Anna Ivanova, Yotaro Sueoka, Hope Kean, Evelina Fedorenko from the department of Brain and Cognitive Sciences, MIT, and Riva Dhamala, Marina Bers from the Eliot-Pearson Department of Child Study and Human Development, Tufts University.

This work appeared in eLife:


PDF - Rewritten for a computer science audience


Tweet summary



Slides from an outreach talk at a high school in Greater Boston

Talk video

Press: [MIT News] [Reddit] [Hackernews]