Crick and Mitchison have presented a hypothesis for the functional role of dream sleep involving an 'unlearning' process. We have independently carried out mathematical and computer modelling of learning and 'unlearning' in a collective neural network of 30-1,000 neurones. The model network has a content-addressable memory or 'associative memory' which allows it to learn and store many memories. A particular memory can be evoked in its entirety when the network is stimulated by any adequate-sized subpart of the information of that memory. But different memories of the same size are not equally easy to recall. Also, when memories are learned, spurious memories are also created and can also be evoked. Applying an 'unlearning' process, similar to the learning processes but with a reversed sign and starting from a noise input, enhances the performance of the network in accessing real memories and in minimizing spurious ones. Although our model was not motivated by higher nervous function, our system displays behaviours which are strikingly parallel to those needed for the hypothesized role of 'unlearning' in rapid eye movement (REM) sleep.