Although he had initially agreed to play the part of Sonny, Al Pacino told Sidney Lumet near the start of production that he couldn't play it. Pacino had just completed production on Le Parrain, 2ᵉ partie (1974) and was physically exhausted and depressed after the shoot. With his reliance on the Method, Pacino didn't relish the thought of working himself up to a state of near hysteria every day. Lumet unhappily accepted the actor's decision and dispatched the script to Dustin Hoffman. Pacino reportedly changed his mind when he heard that his rival was being considered for the role.
Another notable improvisation in the film was John Cazale's answer to Al Pacino's question of which country he'd like to fly to: "Wyoming." Pacino's surprised response was absolutely genuine, as he had no idea what Cazale was going to say.
Much of the film's dialogue is improvised, while completely honoring the structure of the original screenplay. After rehearsing for three weeks with his cast, Sidney Lumet took the improvisations from those rehearsals and made that the official screenplay.
John Cazale was cast at Al Pacino's insistence, despite being nowhere near the age of the real Sal, who was 18 at the time. Sidney Lumet was opposed to the idea because the actor was clearly inappropriate for the part. However, when Cazale came in to read for the part, Lumet was sold on him within 5 minutes.
During production, Al Pacino reportedly only slept a couple of hours a night, ate sparingly, and would sometimes take cold showers; this was in order to emphasize Sonny's disheveled, exhausted and yet wired appearance.