Dakota Fanning's character is named Lucy Diamond from The Beatles song "Lucy in the Sky with Diamonds". Michelle Pfeiffer's character's name is Rita Harrison, from the song "Lovely Rita" and the last name of Beatle George Harrison. Sam, Lucy, and Sam's friends walking across the street with the balloons is a tribute to the case cover of "Abbey Road". Sean Penn wanted the soundtrack to be all Beatles music, but was unable to get the rights, so he asked various artists to cover the Beatles songs he wanted to use. And in order for the re-recorded music to fit into the movie, each of the artists had to use the same tempo as the original Beatles songs.
Many lines or actions by Sean Penn's character Sam are improvised, for example the end of the scene at the new restaurant where Sam shouts "Ask Big Bob!", or the dog-scene. The producers liked many of these improvised scenes much better than the original book.
Michelle Pfeiffer took on the female lead because she was friends with the film's writer and director Jessie Nelson, who had co-wrote the screenplay to the actress' earlier film The Story of Us(1999) and because she wanted the chance to work with Sean Penn.
There was originally to be a line where Brad (Brad Silverman) asks Rita (Michelle Pfeiffer) "Are you wearing a Wonder Bra, because you look wonderful today...". Silverman thought the line was offensive to David E. Kelley (Pfeiffer's husband) and refused to say it.