A misfire detection device for an internal combustion engine, comprising: a storage device; and an execution device (72, 74), wherein the storage device is configured to store mapping data that defines a mapping that takes time series data of instantaneous speed parameters as inputs to output a probability that a misfire has occurred in the internal combustion engine, each instantaneous speed parameter corresponding to one of a plurality of successive second intervals in a first interval, the execution device (72, 74) is configured to perform: an obtainment process that obtains the instantaneous speed parameters based on a detection value of a sensor that detects rotational behavior of a crankshaft of the internal combustion engine; a determination process (S16-S28; S16a, S18-S28; S16b, S70, S18-S28; S16-S26, S28a, S72-78) that determines presence or absence of a misfire based on an output of the mapping, which takes the time series data as inputs; and a response process (S32-S46) that, when the determination process determines that a misfire has occurred, operates predetermined hardware (90, 40, 22, 20, 14) to respond to a situation where the misfire has occurred, the instantaneous speed parameters correspond to rotational speed of the crankshaft, the first interval is a rotational angular interval of the crankshaft in which compression top dead center occurs, the second interval is smaller than an interval between compression top dead center positions, the mapping outputs a probability (y(i), z(i)) that a misfire has occurred in at least one cylinder (#1 to #4) that reaches compression top dead center in the first interval, and the mapping data is data that has been learned by machine learning (S50-S60). a storage device; and an execution device (72, 74), wherein the storage device is configured to store mapping data that defines a mapping that takes time series data of instantaneous speed parameters as inputs to output a probability that a misfire has occurred in the internal combustion engine, each instantaneous speed parameter corresponding to one of a plurality of successive second intervals in a first interval, the execution device (72, 74) is configured to perform: an obtainment process that obtains the instantaneous speed parameters based on a detection value of a sensor that detects rotational behavior of a crankshaft of the internal combustion engine; a determination process (S16-S28; S16a, S18-S28; S16b, S70, S18-S28; S16-S26, S28a, S72-78) that determines presence or absence of a misfire based on an output of the mapping, which takes the time series data as inputs; and a response process (S32-S46) that, when the determination process determines that a misfire has occurred, operates predetermined hardware (90, 40, 22, 20, 14) to respond to a situation where the misfire has occurred, an obtainment process that obtains the instantaneous speed parameters based on a detection value of a sensor that detects rotational behavior of a crankshaft of the internal combustion engine; a determination process (S16-S28; S16a, S18-S28; S16b, S70, S18-S28; S16-S26, S28a, S72-78) that determines presence or absence of a misfire based on an output of the mapping, which takes the time series data as inputs; and a response process (S32-S46) that, when the determination process determines that a misfire has occurred, operates predetermined hardware (90, 40, 22, 20, 14) to respond to a situation where the misfire has occurred, the instantaneous speed parameters correspond to rotational speed of the crankshaft, the first interval is a rotational angular interval of the crankshaft in which compression top dead center occurs, the second interval is smaller than an interval between compression top dead center positions, the mapping outputs a probability (y(i), z(i)) that a misfire has occurred in at least one cylinder (#1 to #4) that reaches compression top dead center in the first interval, and the mapping data is data that has been learned by machine learning (S50-S60).