What is CoCoSci?
An introduction to computational cognitive science.
These notes are adapted and framed almost entirely from [1], [2], [3], and [4].
Introduction
Humans are incredibly smart - incomparably to other living beings that we know of.1
But what is this intelligence used for?
The world is built on inherent structure. Our sensory systems work to detect that structure, despite being able to access only a small part of this data (for example, we do not have x-ray vision). To put this computation into context, a second of brain activity would be enough to exhaust forty thousand 300GB hard drives. However, we do not perceive the world as it exists; we instead perceive it in terms of a set of structures extrapolated from sense data. To do this, we form beliefs that go beyond the immediate sensory data available to us. We hear a squishy thwack and believe our daughter dropped an egg in the kitchen; we see a fleeting expression and believe our spouse has tired of these dinner guests; we smell a mix of rotten food and wet fur and believe our dog buried a bone in the compost heap.2
How can we know so much from so little? How is this intelligence engineered? We can see that there is often a strong mismatch between the information (input through our senses) and the outputs of cognition.3
Regardless, we are able to build rich causal models of the world, by making strong generalizations and abstractions - to the extent that we even create new worlds and attempt to understand them. Given that input data is often sparse, noisy, and incomplete - how does this happen? For example: consider a child able to classify things and learn their names in new situations, despite conventional algorithmic approaches from statistics and machine learning requiring far more effort to train.
A similar example: people are usually able to understand the rules of a board game by observing a few played rounds. Even if these inferences were mildly inaccurate guesses with some uncertainty, these would still be far better than you would have made before seeing any play at all.
A third example: suppose you are asked to think of a rule that picks out any subset of numbers between 1 and 100. If you are additionally given four samples of numbers in the target subset, {50, 20, 80, 90}. Most people presume that the rule likely relies on multiples of 10 and respond with other numbers in that subset.
But why? This could just as easily be a subset of even numbers, or a set of numbers from 20 to 90. Why is one way of representing data so much more compelling than others? Perhaps even more interestingly; why would that same rule not have been nearly as compelling if you had been given only two samples, say 20 and 50, and asked to generalize at that point?
Which rule do you mean?
posterior over candidate hypotheses, uniform prior
What else fits?
generalization gradient — P(number is in the concept)
Models
The deepest form of the generalization we discuss above is perhaps human learning over cognitive development - as we construct large-scale systems of knowledge for physics, biology, or even morality and social structure. These are known as world models, i.e. the human mind's models of causality in the world. Since we are not able to capture the entire state of the world, these models are inherently probabilistic and inferential. Any intuitive theory can then be quite transformative, in the sense that a single demonstration is enough to suggest that the world could work differently than previously perceived, and that this observation is eventually understood.
How do we then know, sometimes only from a single example - which observed generalization should hold and which should not? These questions continue to drive discussions about the origins of knowledge and philosophy of science. What does it mean for a property to endure, or to be a law of nature? What is our justification for believing that a universal concept that has held everywhere and always will not be falsified some day?
If the mind goes beyond the given data, then surely some other source of information must make up the difference.
To reverse-engineer the mind, we frame some questions:
- How does abstract knowledge of the world guide learning and inference from sparse data?
- What forms does our abstract world knowledge take across different domains and tasks?
- How are world models themselves acquired or constructed?
We may question this further:
- How do we use our world models to make decisions and act in the world successfully?
- How can learning and inference with complex world models be implemented efficiently in minds with bounded computational resources?
- How are complex world models implemented in a physical machine, brain, or computer?
- What are the origins of our world models in evolution and development - what is built into our mind, and how do we learn within and beyond that starting point?
- What is needed to scale up learning to all the knowledge that a human being acquires over their lifetime and human cultures have built over generations?
While there are several approaches to reverse-engineering the mind, these notes will largely continue to deal with the Bayesian and probabilistic approach, in which world models are mental representations or beliefs. Like any realistic knowledge that any realistic agent has, they will be incomplete and imperfect in many ways. Furthermore, they are approximate and probabilistic. But as we acknowledge; these are the best guesses we can make.
Why Bayes?
Abstract knowledge is encoded in a probabilistic generative model, a kind of mental model that describes the causal processes in the world that give rise to the learner's observations, as well as unobserved latent variables that support effective prediction and action - but only if the learner can infer their hidden state.45
Bayesian inference provides a rational framework for updating beliefs about latent variables in generative models given observed data. Background knowledge is encoded through a constrained space of hypothesis \(\mathcal{H}\) about possible values for latent variables - candidate world structures that could explain the observed data. Finer-grained knowledge comes in the prior probabilities \(P(h)\) that specify the learner's degree of belief in each hypothesis \(h\) prior to (or independent of) the observations. Bayes' rule updates these prior probabilities to posterior probabilities \(P(h\mid d)\) conditional on the observed data \(d\):
For example: if the data is a thwack, one hypothesis is a dropped egg in the kitchen, another hypothesis is a dropped water balloon in the kitchen, and a third hypothesis is a dropped loaf of bread. The first and third have high priors \(P(h)\), while the second does not - eggs and bread are often dropped in kitchens, but water balloons only rarely. The first and second have high likelihoods \(P(d\mid h)\), while the third does not - dropped eggs and water balloons often thwack, but dropped bread rarely does. On this comparative basis, then, the first hypothesis is assigned the highest probability given the data \(P(h\mid d)\).
What form does our abstract world knowledge take across different circumstances? Bayesian models are able to do two fascinating things.
First, they unify a variety of cognitive acts under a single general framework. The very same abstract model usefully explains perception, memory, language, categorization, theory of mind, and much more.
Second, they are rational models; that is, they specify how an idealized agent with unbounded cognitive resources would optimally solve inference problems.
However, to be effective models, they must be:
- Parsimonious: they must accurately fit the data without requiring too many parameters.
- Interpretable: model parameters must specifically map onto something in cognition, or relate to some psychological idea.
- Teachable: these models should teach us something about the human mind.
To achieve a more complete, complementary explanation of behavior, we may also consider Marr's levels of analysis, wherein we have:
- Computational: what are the abstract problems the mind needs to solve, and what would a solution look like?
- Algorithmic: what informational processing steps are followed to arrive at the solution?
- Implementation: how does the brain carry these steps out?
Learning is impossible from data alone; it requires constraints. When we are handed new information, we are never certain how to classify it - instead we assume the world is organised in some structured way, and that assumption is abstract knowledge. So in the Bayesian approach we represent knowledge as structures - trees, graphs, logical rules - and place probabilities over them. Traditional machine learning tends to read structure off the data; here we run it the other way, generating data through structure: chains for political ideologies, trees for species, two-dimensional rings for geography. Intelligence then collapses to minimising the hypothesis space, i.e. knowing which hypotheses are even worth considering.
To study how people learn how to learn, we use Hierarchical Bayesian Models (HBMs), which posit several levels of hypotheses and priors at once. Suppose you have many bags of balls and notice that the first three each hold balls of a single colour. You infer that bags tend to be uniform; so when a new bag yields a single blue ball, you immediately predict the rest are blue too - not because the data demand it, but because you have learned a higher-level rule. HBMs learn the data, the structure, and the priors over structures simultaneously: this object is a dog (level 1), dogs form a category (level 2), categories are shape-based (level 3).
Sometimes the right move is not to sort an object into an existing category but to invent a new one. Nonparametric Bayesian models handle this without committing to a fixed number of groups in advance; the Chinese Restaurant Process, for instance, formalises exactly the choice between joining an existing category and starting a fresh one.
But where does this abstract knowledge come from?
Knowledge informing actions
How do we use our world models to make decisions and act in the world successfully? If our preferences over outcomes obey a few simple rules, they can be summarised by assigning each outcome a utility, where higher utility means more desirable. A rational agent - holding beliefs as a probability distribution over hypotheses - then acts to maximise the expected utility of the outcomes its actions produce.
We can scale this past single decisions. A sequence of interdependent actions is captured by a Markov decision process (MDP): the agent's situation is encoded as a state, actions change that state, reaching the goal yields reward, and each step along the way carries a cost. The aim is to maximise expected long-run reward summed over the whole trajectory. MDPs also allow actions to influence states only probabilistically - an attempted move may simply fail.
More uncertainty still is handled by partially observable MDPs (POMDPs), where the agent does not even know which state it is in and must infer it from whatever it can observe. And reinforcement learning (RL) adds a further layer: the agent does not begin knowing how actions change states, or what rewards follow, and has to learn these consequences from experience - whether by building a model of the environment (model-based) or by caching values directly from trial and error (model-free).
Limited cognitive resources
Every solution so far has been ideal - optimal, and for that very reason unreachable. How can learning and inference with complex world models be carried out efficiently in minds with bounded computational resources?
Here we have to look at the approximations the mind actually uses, and how they echo the approximations engineered into AI. Two broad strategies recur. The first leans on Monte Carlo or stochastic sampling - approximating a distribution by drawing samples from it - as a single lens for how Bayesian inference might run in minds, brains, and machines alike. The second substitutes the awkward distribution with a simpler one that is easier to compute with.
This abundance of methods creates a new, higher-order problem: which algorithm should we use, and how many samples should we draw? And that, finally, is the answer to how we get so much from so little - we spend our limited resources well, making intelligent choices about how and when to approximate, leaning on efficient algorithms and efficient representations both.
Notes
- We have an unusually high encephalisation ratio, i.e. the ratio of brain mass to expected brain mass for any body mass. ↩
- The daughter and spouse are hypothetical, perhaps even the dinner guests if you are antisocial. ↩
- Cognition is the study of the more complex representations we construct, and how we use them to guide actions and behavior. ↩
- Generative models must be probabilistic to handle the learner's uncertainty about the true states of latent variables and the true causal processes at work. ↩
- A generative model describes not only the specific situation at hand but also a broader class of situations over which learning should generalize. ↩
References
- [1] Griffiths, T. L., Chater, N., & Tenenbaum, J. B. (2024). Bayesian Models of Cognition: Reverse Engineering the Mind. Cambridge, MA: The MIT Press.
- [3] Cushman, F. (2024). Computational social psychology. Annual Review of Psychology, 75, 625–652.
- [4] Goodman, N. D., Tenenbaum, J. B., & the ProbMods contributors. Probabilistic Models of Cognition. probmods.org.