Musing 6: Compositional learning of functions in humans and machines
Preprint from Meta and NYU investigates the foundational capability of both humans and machines to learn and compose functions, a skill crucial for efficient learning and reasoning.
Today’s paper: Compositional learning of functions in humans and machines. Zhou, Lake, and Williams. arXiv:2403.12201v1. Link.
We’ve been covering LLMs and GenAI so much that I thought it wise to take a ‘break’ from that to cover a paper that instead takes a deeper look at humans but that has clear relevance for data science and AI. This paper out of NYU and Meta AI does just that. It studies something called ‘compositional learning of functions,’ which it turns out is really important in the way that we reason in everyday life. Humans possess the skill to sequentially assemble functions, enabling them to creatively merge familiar functions into new configurations. For instance, an individual familiar with vegetable chopping and frying can apply these skills in sequence to prepare fries, even without prior experience in making this specific dish. Additionally, the ability to combine functions manifests at a young age, with children as young as 3.5 years starting to understand how to integrate visual functions together without direct instruction.
Past studies have already established that humans are particularly adept at composing functions when learning through instructions, and have also shown that typical neural network models can be tuned to mimic human behavior by employing a meta-learning strategy that promotes compositional thinking. Although prior research has reported different degrees of success in modeling compositional function learning, a comprehensive investigation into how both humans and machines learn functions and their interplay has not been conducted systematically.
Hence, the authors contribute the following:
Developed a function learning paradigm to explore the capacities of humans and neural network models in learning and reasoning with compositional functions under varied interaction conditions. After brief training on individual functions, human participants were assessed on their ability to compose two learned functions, covering four main interaction types (see figure below from the paper). These interactions include cases where the application of the first function creates or removes the context for applying the second function. The findings reveal that humans can make zero-shot generalizations on novel visual function compositions across different conditions, showcasing sensitivity to contextual changes. Comparatively, a neural network model employing a meta-learning for compositionality (MLC) approach managed to mimic human generalization patterns in function composition through a standard sequence-to-sequence Transformer architecture.
Presented empirical data on the learning of functions and their interactions in both humans and machines, proposing a learning paradigm suitable for testing compositional function learning skills with a focus on several function interactions. The results demonstrate that humans efficiently generalize from newly learned single functions to their compositions, achieving high accuracy levels across different orderings of visual functions. This (interestingly) contradicts previous linguistic theories about human learning biases in function interactions.
Illustrated that generic neural network models can learn to learn function compositions through behaviorally-guided meta-learning, aligning machine performance with human behavior on the same learning tasks.
The paper is quite short, so let’s jump into the key experimental highlights:
After brief training, human participants demonstrated the ability to make zero-shot generalizations on novel visual function compositions across different interaction conditions. This highlights humans' flexibility and adaptability in understanding and applying new function compositions based on previously learned individual functions.
After completing the foundational training, the MLC model achieved an average accuracy of 97.9% in producing the correct output sequences for each type of query, this performance was consistent across various query types and different random starting points. In cases involving single functions, the model demonstrated almost flawless generalization abilities, with a mean accuracy of 98.1% and a standard error of the mean (SEM) of 0.004. When the analysis was broken down by types of interactions, the model maintained high accuracy levels in validating function compositions.
The model’s accuracy results are tabulated below (Fig. 6 in the paper)
In contrast to earlier studies in various fields that reported varying accuracy levels among different types of interactions, the authors’ findings reveal uniformly high generation accuracy across all scenarios. This implies that humans are proficient at managing changes in context while assembling functions. Although no significant average differences were noted among various interaction types, it was discovered that humans tend to make systematic, non-random errors when sequentially processing two functions. These errors predominantly fall into two categories: either incomplete application of functions or an incorrect reversal of the order in which functions are applied.
My final thoughts: the paper is a nice example of psychology research that is relevant to AI. Like many papers in the natural sciences and psychology these days, there were several dense statistics, and careful use of controls. I’ve always liked that about scientific studies. In predictive modeling, we tend to be less focused on statistics than on a race to getting better-and-better performance over the previous baselines, sometimes by narrow margins. To each his own, I suppose. But reading such papers reminds me that engineering research can, and should be, be complemented by more traditional scientific rigor. I’m looking forward to learning more about functional compositionality and seeing whether the authors follow this paper up with more results. '