Forget Sudokus and crosswords: if you want to sharpen up your thinking, immerse yourself in Kafka's stories of the surreal.

Research from psychologists at the University of California in Santa Barbara and the University of British Columbia claims to show that exposure to surrealism enhances the cognitive mechanisms which oversee implicit learning functions. The psychologists showed a group of subjects Kafka's story The Country Doctor, a disturbing and surreal tale in which a doctor travels by "unearthly horses" to an ill patient, only to climb into bed naked with him and then escape through the window "naked, exposed to the frost of this most unhappy of ages".

A second group were shown the same story, but rewritten so the plot made more sense. Both groups were then asked to complete an artificial grammar learning task which saw them exposed to hidden patterns in letter strings, and then asked to copy the strings and mark those which followed a similar pattern.

"People who read the nonsensical story checked off more letter strings - clearly they were motivated to find structure," said Travis Proulx, a postdoctoral researcher at UCSB and co-author of the research, which appears in an article published in the September issue of the journal Psychological Science. "But what's more important is that they were actually more accurate than those who read the more normal version of the story. They really did learn the pattern better than the other participants did."

Proulx said that the thinking behind the research was that when we are exposed to something which "fundamentally does not make sense", our brains will respond by "looking for some other kind of structure" within our environment. A second test got the same results by making people feel alienated about themselves as they considered how their past actions were often contradictory.

"You get the same pattern of effects whether you're reading Kafka or experiencing a breakdown in your sense of identity," Proulx said. "People feel uncomfortable when their expected associations are violated, and that creates an unconscious desire to make sense of their surroundings. That feeling of discomfort may come from a surreal story, or from contemplating their own contradictory behaviours, but either way, they want to get rid of it. So they're motivated to learn new patterns."

The effect would not work if the person was expecting to experience a feeling of alienation: they have to be surprised by the unexpected events and have no way of making sense of them, leading them instead to trying to make sense of something else. "It's important to note that sitting down with a Kafka story before exam time probably wouldn't boost your performance on a test," said Proulx.