Charlie Kaufman may be both the most original screenwriting talent to emerge in the past ten years and the most exasperating. He inspires fervent loyalty among some film buffs because his ideas are playful and heady; they don’t start out or play out like anyone else’s, and at their best they can liberate actors’ most inventive impulses.

The airiest example so far has been Adaptation. In that film, under Spike Jonze’s direction, a gifted cast brought a vaudevillian bravado to Kaufman’s comic essay on the problems of adapting a quirky work of nonfiction (Susan Orlean’s The Orchid Thief) to film. Adaptation lets you down in the last third, when Kaufman shifts gears and his alter ego’s alter ego—the “Charlie Kaufman” character’s fictitious brother Donald—takes over the movie and the script becomes a parody of the kind of Hollywood pap Donald wants to write.

Yet the film is more consistent than Being John Malkovich, which put Kaufman on the map. That film is a mélange of inspired, hilarious ideas and flat, unfunny ones. And Being John Malkovich is light years ahead of Human Nature, which is a concept in search of a comedy, or Confessions of a Dangerous Mind, which is flash in search of a concept.

Kaufman is amazingly prolific; he produces scripts the way yeast works on dough. The latest is a science-fiction narrative set loose on a reverse romantic comedy. Eternal Sunshine of the Spotless Mind stars Jim Carrey as Joel Barish, who hires a company named Lacuna to erase his memories of his ex–girl friend Clementine (Kate Winslet). It’s a desperate, heartbreak move: she had him erased first, at the nadir of their romance, and when he finds it out from mutual friends, he’s so demoralized that he can’t think of anything to do but sign up for the same procedure.

The process involves creating a “map” of his recollections of Clementine, which Lacuna computer geeks blot out while he’s in a chemically induced sleep. But in the midst of the process, from his unconscious, Joel has second thoughts. So he takes Clem by the hand and they run for their lives through the landscape of his dream, struggling to keep one step ahead of the technology that brings each memory crashing down around him.

There’s more. In Kaufman’s pictures, there’s always more. One of the geeks, Patrick (Elijah Wood, in long sideburns and a fatuous goatee), falls for Clem while he and his co-worker Stan (Mark Ruffalo) are erasing her, and then he woos her, armed with all the romantic phrases and brainstorms that worked for Joel. Stan’s girl friend Mary (Kirsten Dunst) has a crush on the man they all work for, Howard (Tom Wilkinson); when she acts on it, the surprise she receives has an unexpected domino effect on Joel and Clem.

The main difference between Eternal Sunshine of the Spotless Mind (the title is a quotation from Alexander Pope) and Kaufman’s previous scripts is mostly a matter of tone: it’s more solemn and woeful. And that tone seems to work for a lot of people, even some who haven’t been in his corner all along.

But if you don’t respond to the unvaried Sad Sack anguish of Jim Carrey’s performance, the whipped-up Scenes from a Marriage turbulence of the romance-gone-sour flashbacks, or the way Jim Brion’s music keeps cueing your emotions, then you might find the movie sappy. Kaufman’s detractors have always complained that his self-consciousness signals a smug pretentiousness.

I’d quarrel with the charge of smugness. His screenplays sincerely try to do something unconventional. But his bad ideas do feel inflated, and that’s the case here, even if the blanket of sentimentality he and director Michel Gondry lay over the movie creates the illusion that they’re up to something profound and important.

Winslet, a marvelous actress, gives Clementine a jagged quality that saves her from going down in the movie’s swirl of generalized melancholy, and Dunst and Wood are both worth watching, for different reasons (her authenticity of feeling, his comic spark). Some of the dream imagery is nifty, and the notion that even when you’ve erased someone’s romantic memories you haven’t paralyzed the emotional and erotic energies that created the romance is an ingenious one. It’s the amorous equivalent of the flaw that devils the brainwashing villains in The Manchurian Candidate: you can program a man to kill, but you can’t eliminate his guilt. Eternal Sunshine isn’t negligible, but Kaufman is better at being breezy.