The sparse-sample goodness of fit problem is considered, in which the number of samples n is smaller than the size of the alphabet m. A convenient setting for analysis is the high-dimensional model in which both $n$ and $m$ tend to infinity, and $n=o(m)$. A new performance criterion is introduced, based on large deviation analysis, which generalizes the classical error exponent applicable for large sample problems (in which $m=O(n)$). The results are: (i) The best achievable probability of error $P_e$ decays as $-log(P_e)=(n^2/m)(1+o(1)) J$ for some $ J>0$. (ii) The coincidence-based test has nonzero generalized error exponent $J$ while the widely-used Pearson's chi-square test has a zero generalized error exponent.