Stanley Kubrick worked on the project for two decades before his death, but along the way, he asked Steven Spielberg to direct, saying it was “closer to his sensibilities.” The two collaborated for several years, resulting in Kubrick giving Spielberg a complete story treatment and lots of conceptual art for the movie prior to his death, which Spielberg used to write his own scenario. Contrary to popular belief, Spielberg claims he introduced many of the darker elements into the story, while Kubrick’s main contribution consisted mostly of its “sweeter” parts. In a 2002 interview with movie critic Joe Leydon, Spielberg indicated that the middle part of the movie, including the Flesh Fair, was his idea, whereas the first forty minutes, the Teddy bear, and the last twenty minutes were taken straight from Kubrick’s story. lan Watson, who wrote Kubrick’s original treatment, confirmed that even the much-criticized ending, assumed by many to be a typical Spielberg addition, was “exactly what (he) wrote for Stanley, and exactly what he wanted, filmed faithfully by Spielberg.”
Jude Law, Haley Joel Osment, and Jack Angel in A.I. Artificial Intelligence (2001)