Asking how intelligent fish are is a relatively new question. It is new in the sense that until fairly recently, the general consensus was that fish had no intelligence and simply reacted to various stimuli like mindless little robots. Gradually, more evidence has accumulated from a range of different studies to suggest that, far from being brainless, fish have excellent cognitive abilities and are able to learn quickly and effectively in a wide variety of circumstances. Much of this research has concerned coral reef fishes, which have to behave adaptively in these "cities of the sea."
Do young fish have any in-built knowledge?
A newly hatched fish is extremely vulnerable to a horde of potential predators. Recognizing what can and what cannot eat you is a vitally important skill for all fish. The problem with learning is that it requires experience, yet an early encounter with a predator can be deadly, allowing no second chance and no opportunity for learning. Young fish, therefore, have an innate ability to recognize predators.
This ability is not learned, but instead is encoded in the genes. It has been shown that humbug damselfish are able to recognize what does and does not present a threat. They do this by responding to certain characteristics of the fish that they encounter, particularly the configuration of their face and their size. The information they use is simple but important -- large eyes and a large mouth spell danger, smaller features are less perilous, even on an equally large fish. Accordingly, vulnerable fry show less fear of the latter.
It is not just the looks of a novel fish that can set off alarm bells in the minds of inexperienced fish; they also respond strongly to the behavior of a stranger. Large trumpetfish stalk reefs hunting for small, unwary juvenile fish, yet they are mostly ignored by their prey unless they assume their characteristic strike pose. Predatory fish often "point" themselves towards their prey, much as a cat gathers itself before pouncing, and it is this threatening posture that the young fish respond to by fleeing.
Can fish learn through experience?
Intelligence is about more than just being born with a blueprint for life encoded in the genes. To be adaptable, animals need to be able to learn. Even starfish are capable of learning basic things: for example, new ways of righting themselves if they are overturned by an inquisitive fish or a wave surge. The living reef is home to a huge number of different organisms, some of which are worth investigating by a young fish to determine their suitability as food. But obviously these organisms are none too keen on ending up as lunch and often have quite formidable defenses, including tough shells or toxicity. Fish gradually overcome these defenses, improving over time as they learn through trial and error the most efficient ways of dealing with their quarry. One good example is the way that fish such as puffers and triggers blow a powerful jet of water to overturn sea urchins, thereby accessing their vulnerable underparts. In most cases, studies have shown that fish confronted by novel prey go from novice to peak performance over the course of approximately five generations. This often leads to fish specializing on a particular type of prey, one they have become particularly adept at finding and eating.