  Lorentz invariance violation in quantum gravity (QG) models or a nonzero
photon mass, $m_\gamma$, would lead to an energy-dependent propagation speed
for photons, such that photons of different energies from a distant source
would arrive at different times, even if they were emitted simultaneously. By
developing source-by-source, Monte Carlo-based forward models for such time
delays from gamma ray bursts, and marginalising over empirical noise models
describing other contributions to the time delay, we derive constraints on
$m_\gamma$ and the QG length scale, $\ell_{\rm QG}$, using spectral lag data
from the BATSE satellite. We find $m_\gamma < 4.0 \times 10^{-5} \, h \, {\rm
eV}/c^2$ and $\ell_{\rm QG} < 5.3 \times 10^{-18} \, h \, {\rm \, GeV^{-1}}$ at
95% confidence, and demonstrate that these constraints are robust to the choice
of noise model. The QG constraint is among the tightest from studies which
consider multiple gamma ray bursts and the constraint on $m_\gamma$, although
weaker than from using radio data, provides an independent constraint which is
less sensitive to the effects of dispersion by electrons.
