Cognitive Neuroscience of Memory for Software Engineers

35
A COGNITIVE NEUROSCIENCE PERSPECTIVE ON MEMORY FOR PROGRAMMING TASKS Chris Parnin, Georgia Institute of Technology

description

Review of recent findings in cognitive neuroscience and

Transcript of Cognitive Neuroscience of Memory for Software Engineers

Page 1: Cognitive Neuroscience of Memory for Software Engineers

A COGNITIVE NEUROSCIENCE PERSPECTIVE ON MEMORY FOR PROGRAMMING TASKS

Chris Parnin, Georgia Institute of Technology

Page 2: Cognitive Neuroscience of Memory for Software Engineers

In the year 2042, super programmers strapped in SQUIDs (superconducting

quantum interference devices) build programs to save the earth from certain doom.

Page 3: Cognitive Neuroscience of Memory for Software Engineers

SQUID SOUND LIKESCIENCE FICTION?

NO!!

These devices exist right now -- just

waiting to be used!

Page 4: Cognitive Neuroscience of Memory for Software Engineers

COGNITIVE NEUROSCIENCE

Understanding how the functions of the physical

brain can yield the thoughts and ideas of an intangible

mind.George Miller and Michael Gazzaniga

Page 5: Cognitive Neuroscience of Memory for Software Engineers

Benefits?

Image no more keyboards.

Direct measures of function and understanding.

Better predictions and constraints from models.

COGNITIVE NEUROSCIENCE

Page 6: Cognitive Neuroscience of Memory for Software Engineers

BackgroundAnatomy,

techniques, findings with focus

on memory

InsightsInsights from

models old and new

ImpactTools, theories, experiments

OVERVIEW

Page 7: Cognitive Neuroscience of Memory for Software Engineers

LOBES

Frontal Parietal

OccipitalMedial

Regions divided by deep fissures

Page 8: Cognitive Neuroscience of Memory for Software Engineers

LIMBIC SYSTEM

Deep structures within brain.

Page 9: Cognitive Neuroscience of Memory for Software Engineers

FUNCTION LOCALIZATION

Page 10: Cognitive Neuroscience of Memory for Software Engineers

HUMAN TECHNIQUES

Electro/magno-basedMeasures change in neuron activity

Affects visible within milliseconds.

Location within centimeters.

Examples• EEG• MEG

Blood oxygen-basedMeasures change in blood activity.

Affects visible within seconds.

Location within millimeters.

Examples• fMRI• Optical imaging

Page 11: Cognitive Neuroscience of Memory for Software Engineers

ANIMAL TECHNIQUES

Gene TherapyBred mutant rats

DyeDiscover neural pathways

LesionsDamage neural pathways

HabitationThe kitten who only saw vertical lines

Cats, Monkeys, Mice Oh My!

Page 12: Cognitive Neuroscience of Memory for Software Engineers

Stimulate neurons with electricity

LONG-TERM POTENTIATION (LTP)

Effect found even after one year!

Page 13: Cognitive Neuroscience of Memory for Software Engineers

PLACE CELLS

Page 14: Cognitive Neuroscience of Memory for Software Engineers

VIRTUAL NAVIGATION

Participants navigate a virtual town.

Recall paths.

Place cells fire.

Page 15: Cognitive Neuroscience of Memory for Software Engineers

NEUROGENESIS

Larger volume by years of experience!

Size of taxi driver hippocampus?

Page 16: Cognitive Neuroscience of Memory for Software Engineers

HIPPOCAMPAL ACTIVITY

Forgotten words Remembered words

Forgotten words Familiar words

(Entorhinal cortex)

Page 17: Cognitive Neuroscience of Memory for Software Engineers

AUTOMATIC MEMORY

We cannot anticipate important events.We cannot always devote top-down resources to encode and select memory.

Initial memory is largely formed without conscious effort.

Page 18: Cognitive Neuroscience of Memory for Software Engineers

HIPPOCAMPUS ANATOMY

Grand Central of the sensesConnections to sensory processing and semantic recognition. Connections to frontal regions.

Brain HashtableHippocampal neurons cannot store directly, index to original source.

Recording factorsNovel, engaging, high-frequency…

Page 19: Cognitive Neuroscience of Memory for Software Engineers

SNOWBALL TO BOULDER

Hippocampal LTP

Formed and tagged for storage.

Consolidated memory

Replayed and stored at original regions.

Top-down associations

Properties our bound to memory. “Rehearsal” is activation of speech motor.

Page 20: Cognitive Neuroscience of Memory for Software Engineers

INSIGHT

So what?

A review, and new perspectives.

Page 21: Cognitive Neuroscience of Memory for Software Engineers

Sensory Short-term Long-termAttention Encoding

Rehearsal

MODAL MODEL OF MEMORY(1968)

Patients with no short-term memory still have long-term memory…

Page 22: Cognitive Neuroscience of Memory for Software Engineers

Sensory Short-term Long-term

EpisodicBuffer (2000)

Lifetime of seconds!

“Temporarily infinite”

WORKING MEMORY (1974)Phonologica

l loop

Visio-Spatial Sketch pad

Central Executiv

e

Page 23: Cognitive Neuroscience of Memory for Software Engineers

LONG-TERM WORKING MEMORY(1995)

Good insight, theory formed without any neuroscience basis.

Page 24: Cognitive Neuroscience of Memory for Software Engineers

MEMORY 2.0

• Distributed• Specialized• Retained and Replayed• Automatic without Rehearsal• Immediate and Long-Lasting

Page 25: Cognitive Neuroscience of Memory for Software Engineers

MEMORY TYPES

SpatialProspectiveFamiliarityRecencySource

Semantic…

See paper for more details!

Page 26: Cognitive Neuroscience of Memory for Software Engineers

AttentionMaintenanceManipulation

Dynamic filtering

Auto associative

retrieval

Auto associative encoding

Retrieval Encoding

TASK MEMORY MODEL (beta)

Semantic Se

man

tic

Indices

Spatial

Goals

Attention

Bindings

Visual

Frontal

Associative

Perceptual

ProcessRegions

Note, top-down iteration is a “brain design-pattern” found in many neural circuits.

Page 27: Cognitive Neuroscience of Memory for Software Engineers

PROGRAMMING ENVIRONMENTS

Page 28: Cognitive Neuroscience of Memory for Software Engineers

Often do not associate name with memories of programming.

NAME IS NOT ENOUGH

Page 29: Cognitive Neuroscience of Memory for Software Engineers

TOOL DESIGN: MEMORY

• Auto-association– Better distinct cues for learning?

• Spatial memory?– Spatial stability, isolation

• Prospective memory?– Better reminders than a compile error or TODO?

• Forgetting?– Code history and provenance

Page 30: Cognitive Neuroscience of Memory for Software Engineers

THEORIES (BETA)

Visual Chunks

Initial formation of memory.“Below the method with

lots of strings”

Iterative Comprehension

Top-down experiences will bind and update partial

representations. Concepts form.

Navigational Jitter

Tabs, scrolling huge files,

little understanding-- need memory aids.

Page 31: Cognitive Neuroscience of Memory for Software Engineers

EXPERIMENTS

Gender differences in brain activity during programming?

Neurogenesis in programmer’s brain?

Place cells (spatial) during programming navigation?

Your idea?

Page 32: Cognitive Neuroscience of Memory for Software Engineers

MUSCLES OF THE MIND

+ =

Subvocal speech

EMG (electromyograph

y)Cognition

Page 33: Cognitive Neuroscience of Memory for Software Engineers

0 100 200 300 400 500 600 700 800 900

Subvocal Debug

Select Click

Search Edit

FormulatingProblem

Found useful code

Formulatingsolution

EditingFound useful code

Evaluating

Moments of interest and difficulty

Page 34: Cognitive Neuroscience of Memory for Software Engineers

QUESTIONS?

Indices

Spatial

Goals

Attention

Bindings

Visual

Page 35: Cognitive Neuroscience of Memory for Software Engineers

Goal Memoryspace-goal binding.

Lesioned monkeysForget food location.

VariationChange location, keep consistent cue