Lihi Catz (MA)

Back to dissertation list…

How working memory supports programming and does programming support it back?

Read the full dissertation

The importance of working memory (WM) in executing mental algorithms is well established, but we still do not understand the precise bi-directional relations between specific WM processes and specific aspects of mental algorithms, i.e., how precisely WM impacts the execution of mental algorithms, and whether and how ‘mental algorithm training’ improves WM. We examined these issues in two experiments that used a novel task focusing on simple computer programming skills.

We centered on a specific WM mechanism – the “Focus of Attention” (FOA), the WM region that contains one information item selected for the current cognitive operation. Previous studies showed that shifting the FOA from one item to another entails a cognitive cost; here, we examined how this applies to programming. Participants followed, in their heads, simple code snippets that set the value of 2-3 variables and then updated them: a series of commands was presented one at a time, and each command updated the values of a single variable. Similar to findings from other domains, we found a switch cost: when a command updated a variable different from the previous command, it took longer, and caused more errors, than commands without a variable-switch – presumably because of the cost involved in shifting the focus of attention from one variable to another.

To see the reverse causality, namely how training in the programming task affects WM, we examined whether and how the participant’s performance improved during the experiment session. In Experiment 1, the performance (errors, reaction times) improved throughout the session, and importantly, the improvement was larger in the variable-switch trials than in the no-switch trials. We conclude that the improvement was not a general improvement in the task, and not even a general improvement in vaguely-defined WM skills, but it was specifically in the FOA-shifting mechanism. Experiment 2, which used a similar method in a slightly different configuration, failed to replicate this finding. We propose that the reason for this discrepancy may be that specific aspects of the training, which were present in Experiment 1 but not in Experiment 2, may have been critical to the effectiveness of the training; and we suggest how future studies may use these discrepancies to identify the factors that are critical for effective WM training.

We also found that the variables that were not used in the current trial (“inactive variables”), and were stored in WM region/s with lower accessibility level than the FOA, were not all stored with the same accessibility levels. To assess this, we examined how the performance in a particular variable is affected by its “inactivity duration” – the number of trials elapsed since it was last used. The performance was poorer in trials with longer inactivity duration, indicating that longer inactivity reduced the variable’s accessibility level. We discuss the implications of this finding to our understanding of how the inactive variables are represented in WM.

Overall, the study shows that our novel paradigm can capture the bi-directional causal relations between specific WM processes and specific aspects of executing programming algorithms mentally.