Independent scholarship · Open accessThe monthly digest

Indexed text attachment

operads-modules-machine-learning.tex

Source for Operads, Modules, and Differentiation in Machine Learning

View paper · Download original file

Lines 934–1033 of 1174. Source text is displayed literally.

934update also requires a choice of metric or optimizer.935 936\subsection{A module of probability perturbations}937\label{sec:stochastic-module}938 939For nonempty finite sets \(X_1,\dots,X_n,Y\), a stochastic operation \(K\)940assigns a probability measure \(K(-\mid\boldsymbol x)\) on \(Y\)941to each input tuple. To substitute a stochastic operation942\(H_i\) into slot \(i\), first sample their results independently943conditional on their respective input blocks \(\boldsymbol u_i\).944The substituted kernel is945\[946 (K(H_1,\ldots,H_n))(y\mid\boldsymbol u)947   =\sum_{\boldsymbol x}K(y\mid\boldsymbol x)948         \prod_i H_i(x_i\mid\boldsymbol u_i).949\]950Rearranging the finite sums verifies associativity. Permuting951inputs reindexes the sums, and identity kernels are units.952Taking these kernels as operations therefore defines a colored953operad in sets.954 955Let \(A_X=\mathbb R^{X}\) be the vector space of signed measures,956\(\epsilon_X(a)=\sum_{x\in X}a(x)\), and \(M_X=\ker\epsilon_X\).957The linearization of the kernel operad acts on \(A\) by958\[959 K_A(a_1,\ldots,a_n)(y)960   =\sum_{\boldsymbol x}K(y\mid\boldsymbol x)\prod_i a_i(x_i).961\]962Since \(\sum_y K(y\mid\boldsymbol x)=1\), its output mass is963\(\prod_i\epsilon_{X_i}(a_i)\). Hence the operation restricts964to \(M_Y\) whenever a chosen input lies in \(M_{X_i}\). These965one-marked-input restrictions satisfy the module axioms by966restricting the algebra substitution identities. In particular967the first-order change in the result under varying one968probability law is the marked-input map on its signed969zero-mass perturbation. Baseline laws are nonnegative and970normalized. At a boundary point of the probability simplex,971a zero-mass direction can be feasible in only one sign.972 973If \(M_X\) is equipped with \(\|m\|_{\rm TV}=\tfrac12\sum_x|m(x)|\),974the marked-input map at probability laws in the remaining slots975has operator norm at most the diameter976\(\sup_{\boldsymbol x,\boldsymbol x'}\|K(-\mid\boldsymbol x)-977K(-\mid\boldsymbol x')\|_{\rm TV}\). Indeed a nonzero \(m\)978is \(\|m\|_{\rm TV}\) times the difference of two probability979laws obtained by normalizing its positive and negative parts.980The two outputs after replacing the marked input are convex981mixtures of rows of \(K\). Their distance is bounded by that982diameter, by comparing all pairs of rows with the product983mixture weights. This is the contraction factor used in the984following consistency test.985 986\subsection{Stochastic substitution and answer consistency}987 988Bottman and Richardson model question decomposition by a989question operad. Their operations are question templates, and990composition plugs the output of one question into a blank991of another. They propose992comparing answers across partial evaluations of a decomposition993tree \cite{bottman2026}. Bottman, Liu, and Richardson report a994companion empirical study of this consistency signal on995multi-hop question-answering datasets \cite{bottmanliu2026}.996One mathematical use of an operadic specification is to say997which evaluation orders should agree under a particular998answer semantics. The following bound quantifies the propagation999of local discrepancies for finite stochastic evaluations.1000 1001Fix a rooted tree with a nonempty finite answer set \(X_v\) at each vertex.1002For an internal vertex \(v\), let \(I_v\) be the product of the1003answer sets of its children. Two evaluators have local Markov1004kernels \(K_v,\widetilde K_v\) from \(I_v\) to distributions on1005\(X_v\). At a leaf \(I_v\) is a singleton and the kernels specify1006its two answer laws. Assume the child evaluations are sampled1007independently for each evaluator, with original query and1008external random context fixed. At each vertex the evaluator1009applies its kernel to the product of those laws. Write1010\(\mu_v,\widetilde\mu_v\) for the resulting output laws. For1011probability laws on a finite set let \(\|\cdot\|_{\rm TV}\)1012denote total variation distance, defined as the supremum of the1013absolute difference in probability over all events. Put1014\begin{align*}1015\delta_v1016 &= \sup_{i\in I_v}1017     \|K_v(i)-\widetilde K_v(i)\|_{\rm TV},\\1018\eta_v1019 &= \sup_{i,j\in I_v}1020     \|K_v(i)-K_v(j)\|_{\rm TV}.1021\end{align*}1022Thus \(0\leq\eta_v\leq 1\).1023 1024\begin{proposition}[Propagation of discrepancies]1025For the root \(r\), the propagated discrepancy satisfies1026\begin{equation}1027\|\mu_r-\widetilde\mu_r\|_{\rm TV}1028 \leq1029 \sum_v \delta_v1030    \prod_{w\in\operatorname{Anc}(v)} \eta_w ,1031\label{eq:ai-tv-tree}1032\end{equation}1033where \(\operatorname{Anc}(v)\) consists of strict ancestors