\section{Bayesian inference in context}\label{sec:bayes} This section shows that the Bayes and Gibbs in-context predictors of a local class are counting problems, and that they are statistically efficient for every class with short descriptions. \subsection{Algorithms}\label{sec:bayesalg} Without noise, the posterior is uniform on the version space, and the posterior predictive is a ratio of two version-space sizes. With noise, it is a ratio of two weighted sums, and two error profiles determine both. \begin{restatable}[Bayesian inference in context for local classes]{theorem}{thmbayesalg}\label{thm:bayesalg} Let $\cH$ be $\kappa$-local with $N$-bit descriptions, let $S$ be a context of size $m$, and let $x$ be a query. \begin{enumerate}[label=(\alph*)] \item\label{it:noiseless} \emph{Without noise.} If $\VS(S)\ne\emptyset$, then $p_S(x)$ and $\Bayes(S,x)$ can be computed exactly and deterministically in time $\poly(N,m)\cdot2^\kappa\cdot T_\kappa(N)$, and the Gibbs predictor can be run exactly in the same time, given uniform random integers. This is $\poly(m)\cdot2^{o(N)}$ when $\kappa=o((\log N)^{1/4}/\sqrt{\log\log N})$. \item\label{it:noisy} \emph{With noise.} Let $\eta=a/b$ for integers $0