Vertebrates possess a single major nerve bundle that terminates in the massive (or not...) swelling otherwise known as the brain and just the ticket for higher processing and intelligence.
Molluscs, on the other hand, have to be content with a pair of major nerve bundles running in parallel, with 5 or 6 pairs of knotty ganglia which are fine for reacting to stimuli and running simple motor programmes...and that's about it. Or do they?
Alone among their brethen, cephalopods have managed a quick and dirty hack (but since when was evolution anything but?) of a brain - in their own inimitable style, of course. The forwardmost (topmost if your're thinking what I think you're thinking and it's the thought of a regal, noble, stately octopus perched on a throne reciting John Donne) pair of ganglia have swollen and encircled the oesophagus directly between the eyes.
This arrangement does have its drawbacks: Sea urchins (particularly the young, deliciously soft specimens) are a favoured snack of many cephalopods. Venerable octopuses have been caught with spines lodged in their brain as a result of a meal going down upside-down. This constitutes only a minor inconvenience, however, as an octopus can function normally with large pieces of its brain removed (which makes them targets for studies of how brains work). Intelligent in a manner slightly alien to that of mammals, octopuses can learn by example (highly unexpected for a solitary creature, and unique outside the vertebrates) - see, uh, examples over at octopus - and can be taught (learning faster than rats and pigeons, but leveling off at a less advanced level). Don't underestimate the wily cuttlefish, either; it demonstrates surprising variation in its behaviour.