This paper addresses the issue of accountability in modern AI systems, which are developed in multiple stages (pretraining, fine-tuning, and adaptation/alignment). We address the "attribution problem," which tracks how much responsibility each stage holds for the success or failure of a deployed model, and propose a general framework for answering counterfactual questions about how the model's behavior would have changed had a particular stage not been updated. Within this framework, we present an estimator that efficiently quantifies the effectiveness of each stage by considering key aspects of model optimization dynamics, such as learning rate schedules, momentum, and weight decay, as well as data, without requiring model retraining. We demonstrate that we successfully quantify the responsibility of each stage in image classification and text toxicity detection tasks, and identify and remove erroneous correlations based on the attribution results. This approach provides a practical tool for model analysis and represents an important step toward developing more responsible AI.