A processer-implemented method for training an acoustic model or an end-to-end speech recognition model based on a neural network, the method comprising: determining whether a current iteration for training the neural network is performed by an experience replay iteration using an experience replay set; selecting a sample from at least one of the experience replay set and a training set based on a result of the determining; training the neural network based on the selected sample; and updating the experience replay set, comprising at least one of: - comparing a training error reduction corresponding to the sample selected from the current iteration to training error reductions of the samples included in the experience replay set, and, if the smallest training error reduction among the training error reductions corresponding to the samples included in the experience replay set is less than the training error reduction of the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest training error reduction from the experience replay set, - calculating a difference between a training error reduction corresponding to an iteration prior to the current iteration, and the training error reduction corresponding to the current iteration, comparing a difference corresponding to the sample selected from the current iteration to differences corresponding to the samples included in the experience replay set, and, if the smallest difference among the differences corresponding to the samples included in the experience replay set is less than the difference corresponding to the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest difference from the experience replay set. determining whether a current iteration for training the neural network is performed by an experience replay iteration using an experience replay set; selecting a sample from at least one of the experience replay set and a training set based on a result of the determining; training the neural network based on the selected sample; and updating the experience replay set, comprising at least one of: - comparing a training error reduction corresponding to the sample selected from the current iteration to training error reductions of the samples included in the experience replay set, and, if the smallest training error reduction among the training error reductions corresponding to the samples included in the experience replay set is less than the training error reduction of the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest training error reduction from the experience replay set, - calculating a difference between a training error reduction corresponding to an iteration prior to the current iteration, and the training error reduction corresponding to the current iteration, comparing a difference corresponding to the sample selected from the current iteration to differences corresponding to the samples included in the experience replay set, and, if the smallest difference among the differences corresponding to the samples included in the experience replay set is less than the difference corresponding to the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest difference from the experience replay set. - comparing a training error reduction corresponding to the sample selected from the current iteration to training error reductions of the samples included in the experience replay set, and, if the smallest training error reduction among the training error reductions corresponding to the samples included in the experience replay set is less than the training error reduction of the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest training error reduction from the experience replay set, - calculating a difference between a training error reduction corresponding to an iteration prior to the current iteration, and the training error reduction corresponding to the current iteration, comparing a difference corresponding to the sample selected from the current iteration to differences corresponding to the samples included in the experience replay set, and, if the smallest difference among the differences corresponding to the samples included in the experience replay set is less than the difference corresponding to the sample selected from the current iteration: adding the sample selected from the current iteration to the experience replay set, and excluding a sample corresponding to the smallest difference from the experience replay set.