  Constraining parameters such as the initial mass function high-mass slope and
the frequency of type Ia supernovae is of critical importance in the ongoing
quest to understand galactic physics and create realistic hydrodynamical
simulations. In this paper, we demonstrate a method to precisely determine
these using individual chemical abundances from a large set of stars, coupled
with some estimate of their ages. Inference is performed via the simple
chemical evolution model Chempy in a Bayesian framework, marginalizing over
each star's specific interstellar medium parameters, including an
element-specific `model error' parameter to account for inadequacies in our
model. Hamiltonian Monte Carlo (HMC) methods are used to sample the posterior
function, made possible by replacing Chempy with a trained neural network at
negligible error. The approach is tested using data from both Chempy and the
IllustrisTNG simulation, showing sub-percent agreement between inferred and
true parameters using data from up to 1600 individual stellar abundances. For
IllustrisTNG, strongest constraints are obtained from metal ratios, competitive
with those from other methods including star counts. Analysis using a different
set of nucleosynthetic yields shows that incorrectly assumed yield models can
give non-negligible bias in the derived parameters; this is reduced by our
model errors, which further show how well the yield tables match data. We also
find a significant bias from analyzing only a small set of stars, as is often
done in current analyses. The method can be easily applied to observational
data, giving tight bounds on key galactic parameters from chemical abundances
alone.
