Skip to content

Converting MLPs to closed-form polynomialsConverting MLPs into Polynomials in Closed Form

arXiv· arXiv:2502.01032· Nora Belrose, Alice RiggEleutherAIIndexed by this site · 2026-10-14· Originally publishedAlignment

Quick read

Interpretability

Based on the paper PDF (AI-generated); refer to the original

Closed-form conversion of MLP/GLU to polynomials; at the end of MNIST training, the quadratic approximation explains over 95% of the variance.

Questions
SAEs can extract MLP features, but the authors say they cannot tell whether they come from the model or the data. The authors aim to convert trained MLPs and GLUs in closed form into least-squares polynomials under a maximum-entropy Gaussian, in order to read the network via spectral decomposition and test whether training first fits low-order polynomials.
Methods
Under Gaussian inputs, the linear coefficients are written in closed form via the covariance and Stein's lemma; higher orders are reduced to OLS through a feature map, and the Master Theorem splits multivariate integrals into univariate ones. Mixture inputs use the law of total covariance. The quadratic analytic solution on MNIST is infeasible, so it is first solved under N(0,1) and then fine-tuned.
Experiments and results
A single-hidden-layer ReLU MLP is trained on MNIST. From 500 to 1K steps linear FVU rises while quadratic FVU is nearly unchanged, which the authors call the quadratic stage. At the end, the quadratic approximation explains over 95% of the output variance. After ablating 4 SVD components accuracy is below 50%, and after removing 10/784 dimensions the authors call it near random.
Limitations and future work
The authors say the derivation relies on a Gaussian mixture, and it is unclear whether it generalizes to other distributions; at high-dimensional activations the analytic order stops at quadratic, and if the quadratic approximation is poor, the method alone is hard to use for explanation. The experiment is a single-hidden-layer ReLU MLP on MNIST, and the paper does not report hidden width or number of repeats.
Experimental setupsingle hidden layer MLP with ReLU activation (ReluMLP) · MNIST、Gaussian mixture imitating the MNIST training set · FVU、R² et al.
Evaluated models
single hidden layer MLP with ReLU activation (ReluMLP)
Benchmarks
MNISTGaussian mixture imitating the MNIST training set
Metrics
FVUR²KL divergenceaccuracy
AI summaryThe researchers derive closed-form least-squares optimal solutions for approximating feedforward networks (multilayer perceptrons and gated linear units, GLU) as polynomials of arbitrary degree. When the fitted R² is high, MLPs and GLUs can be interpreted by visualizing the eigendecomposition of the linear and quadratic approximation coefficients; the quadratic approximation still explains over 95% of the variance in network outputs at the end of training. The paper also shows these approximations can be used to construct SVD-based adversarial examples. By tracking the R² of the linear and quadratic approximations during training, the authors find that the network starts simple and gradually becomes complex.

The researchers derive closed-form least-squares optimal solutions for approximating feedforward networks (multilayer perceptrons and gated linear units, GLU) as polynomials of arbitrary degree. When the fitted R² is high, MLPs and GLUs can be interpreted by visualizing the eigendecomposition of the linear and quadratic approximation coefficients; the quadratic approximation still explains over 95% of the variance in network outputs at the end of training. The paper also shows these approximations can be used to construct SVD-based adversarial examples. By tracking the R² of the linear and quadratic approximations during training, the authors find that the network starts simple and gradually becomes complex.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Closed-form conversion of trained MLPs and GLUs into least-squares polynomials under a maximum-entropy Gaussian, to inspect the network and track complexity.

    How to turn trained MLPs and GLUs into polynomials inspectable with linear algebra, while making few assumptions about data features.

    • Problem setting: In mechanistic interpretability, MLP neurons often activate across diverse, seemingly unrelated contexts, i.e., polysemanticity (Elhage et al., 2022). The authors say the current practice is dictionary learning, minimizing mean squared error with a wide, sparse MLP against the original activations; SAEs can extract features (Huben et al., 2023; Paulo et al., 2024), but it is unclear how much comes from the model versus the data.
    • Authors' assumption: The data distribution is taken as the maximum-entropy distribution under low-order moment constraints. Given the mean and covariance, this is the Gaussian N(µ, Σ). The approximation globally minimizes MSE over that distribution, thereby depending less on the specific samples of the training set.
    • Difference from quadratic bases: Pearce et al. (2024) start from bilinear layers and use eigendecompositions of interaction matrices for interpretation, steering, and adversarial examples. The authors say that requires an unconventional base; this paper instead approximates already-trained MLPs and GLUs.
    • What the paper provides: Closed-form least-squares optimal approximations of arbitrary polynomial order; when R² is high, visualization of eigendecompositions of linear and quadratic coefficients; testing distributional simplicity bias via the fit of the approximation across training steps; and SVD input interventions using the linear coefficients to see whether accuracy changes together with the approximation.
  2. What related research exists?

    The discussion focuses on polysemanticity and SAEs, spectral decomposition of quadratic architectures, and the rise in statistical order during training.

    Related discussion appears in the introduction, Background, and Section 4; there is no separate Related Work.

    Polysemy and sparse dictionaries

    • Elhage et al. (2022): MLP neurons are often polysemous. The authors use this to argue for learning features of the model itself, rather than just a dictionary on the data.
    • Huben et al. (2023) and Paulo et al. (2024): Use SAE to extract interpretable features from MLP activations and outputs; the latter also does large-scale automated interpretation. The authors state it is unclear whether SAE learns model features or data features.

    Quadratic layers and spectral methods

    • Pearce et al. (2024): Each output unit of a bilinear layer is a quadratic form of the input; they perform eigendecomposition on the Hessian (interaction matrices). The authors paraphrase that the largest-magnitude eigenvectors are often directly interpretable and used for steering and adversarial attacks. The authors state this line of work starts from unconventional bilinear or quadratic bases; the quadratic approximation here has tensor parameters that allow similar spectral decomposition.
    • Shazeer (2020), Mnih and Hinton (2007), Dauphin et al. (2017): GLU is commonly used after attention blocks; identity activation gives a bilinear layer. The authors state its performance is similar to SwiGLU and ReGLU. The paper does not use these architectures as experimental baselines.

    Complexity increases with training

    • Nakkiran et al. (2019), Refinetti et al. (2023), Belrose et al. (2024): Networks represent more complex functions with SGD and use statistical moments by order. The authors refer to the latter two as distributional simplicity bias and test it with the closed-form linear and quadratic approximations here.
    • Teney et al. (2024): Random networks tend to be simple. The authors use this to explain the FVU drop in the first few hundred steps of training.

    Baselines and data

    The paper does not use external interpretability or attack methods as experimental baselines. The comparisons are linear and quadratic least-squares approximations of the same ReLU MLP, and test accuracy of the original network and both approximations under SVD projection. The data is MNIST (LeCun et al., 1998). The authors state that samples from a Gaussian mixture fitted to MNIST are hard for humans to distinguish from real samples (Belrose et al., 2023, Figure 2).

    The authors position this work as: closed-form polynomial approximation of a trained MLP/GLU on a maximum-entropy Gaussian, rather than replacing the base or training an SAE.

  3. How does the paper address this problem?

    Under Gaussian or Gaussian mixture distributions, polynomial coefficients for MLPs and GLUs are computed in closed form using covariances, Stein's lemma, and feature maps.

    Under Gaussian or Gaussian mixture inputs, compute closed-form least-squares polynomial coefficients for single-hidden-layer MLP and GLU, rather than estimating coefficients with SGD on arbitrary distributions. The authors' rationale: SGD is expensive and not conducive to understanding inductive bias. First handle a single Gaussian, then extend to mixture distributions in Section 3.4.

    Linear coefficients

    • The approximation takes an affine form. The least-squares solution for the slope is β=Cov[x]−1Cov[f(x),x]. The intercept α equals E[f(x)] minus the product of β transpose and E[x], corresponding to equation (5).
    • The network is written as f(x)=W₂ ϕ(W₁x+b₁)+b₂, where ϕ acts elementwise. When x is Gaussian, the pre-activation y remains Gaussian. E[ϕ(y)] for ReLU and GELU has closed forms (Appendix A); for other activations, use Gauss-Hermite quadrature. Then by linearity of expectation, obtain E[f(x)].
    • The cross-covariance reduces to E[ϕ(y)x^T]. Since x and y are jointly Gaussian, Stein's lemma gives 𝔼[ϕ(yi)xj]=Cov(yi,xj)𝔼[ϕ′(yi)]. The expectations of ReLU and GELU derivatives under Gaussian can also be computed in closed form.

    Quadratic and arbitrary degree

    • The quadratic feature map collects x_i x_j (i≤j), concatenated with x to form z. Any quadratic function of x is an affine function of z, and coefficients are still estimated by OLS. The same substitution works for arbitrary degree.
    • Need E[ϕ(y_i) x_k x_l] in Cov[f(x), z], and higher moments of z. Higher moments use Isserlis' theorem generalized to noncentral Gaussians: sum over partitions into singletons and pairs.
    • Theorem 3.1 writes E[g(X) times the product of several Y_i] as a linear combination of univariate integrals E[g(X) X^k]. The coefficients are obtained analytically from the OLS intercept, slope, and residual covariance of Y_i on X. For n=2, the paper gives a simplified three-term expression. Univariate integrals are then computed numerically or via closed forms in Appendix A.

    Mixture distributions and GLU

    • When the component indicator is a categorical distribution, the cross-covariance equals the expectation of conditional covariances plus the cross-covariance between conditional means. Applying this to the input itself gives the input covariance; replacing one term with f(X) gives the cross-covariance between input and MLP output.
    • GLU is the elementwise product of ϕ(xW+b) and (xV+c). Under Gaussian input, the two pre-activations are jointly Gaussian. Each mean component is E[ϕ(Y_i) Z_i], using Stein's lemma; cross-covariance with the input uses Theorem 3.1. The authors state that higher-degree polynomials can be handled similarly.

    Fitting trade-offs in experiments

    • The experimental network is a single-hidden-layer ReLU MLP, of the same form as equation (1). Training uses schedule-free AdamW, warmup 1K steps, batch size 64, weight decay 0.1, with checkpoints saved at logarithmic intervals.
    • The linear approximation is fitted in closed form to a Gaussian mixture matching the class means and covariances of MNIST. The analytic solution for the quadratic mixture distribution is infeasible on MNIST: the quadratic feature dimension is d(d+1)/2, which is 307,720 for d=784, the covariance has 9.47×10^10 entries, and a typical linear solve is O(d^6). When x is N(0,1), this covariance is diagonal with entries in {1, 2}.
    • Therefore, quadratic coefficients are first computed in closed form under N(0,1), then fine-tuned with schedule-free SGD on Gaussian mixture samples. The authors state the objective is convex, so these coefficients should approximate the true least-squares values well, and state that the noise in the quadratic FVU in Figure 2 comes from this step.

    Spectral decomposition and input interventions

    • Perform SVD on the linear coefficients, write the sum up to 10 terms, and U maps the input dimension to R^10. Apply the same orthogonal projection to each test sample, subtracting the component spanned by the first k left singular vectors.
    • Linear and quadratic networks can also be decomposed into important terms via SVD or eigendecomposition. The authors state that if an attack transfers to the ReLU network, it indicates the approximation captures the original network's out-of-distribution behavior. Effectiveness is measured by test accuracy, not by a separate harm review.
  4. What experiments did the paper conduct?

    The quadratic approximation of a ReLU MLP on MNIST explains over 95% of output variance; after 4 SVD components, accuracy drops below 50%.

    Experimental setup

    • Model and training: A single-hidden-layer ReLU MLP trained on MNIST with schedule-free AdamW. Warmup 1K steps, batch size 64, weight decay 0.1, checkpoints saved at log intervals. Figure 1 includes one longer training run. The paper does not report hidden width, learning rate, number of repeats, or number of test set examples.
    • Fitting distribution: A Gaussian mixture matching the per-class means and covariances of MNIST. The authors state that samples from this mixture are hard for humans to distinguish from real samples (Belrose et al., 2023, Figure 2).
    • Two approximations: The linear approximation is fit in closed form under this mixture. The quadratic approximation is first solved in closed form under N(0,1), then fine-tuned on mixture samples with schedule-free SGD (footnote 3, Appendix B).
    • Metrics: FVU, R², and the KL between the approximation and the network output (nats). Input interventions use test-set accuracy. The paper does not use LLM judges and does not report human agreement.
    • Figure axes: The main text and the Figure 2 caption say proportion of unexplained variance; the vertical axis text in the figure is "Fraction of variance explained (FVU)". Figure 3 vertical axis is KL divergence (nats). Figure 5 vertical axis is Accuracy (%), horizontal axis is SVD Components Ablated, legend is ReluMLP, Linear, Quad for the three SVD attacks.
    • Controls: No external baselines. The controls are the linear approximation, the quadratic approximation, and the original ReLU MLP of the same network.

    Main results

    The paper has no numerical summary table. The original numbers in the abstract, conclusion, and Section 4.2 are as follows.

    Swipe horizontally to read the table

    QuantityConditionValueSource
    Output variance explained by the quadratic approximationAt end of training; the conclusion states the MLP is trained on MNISTover 95%; the conclusion says well over 95%Abstract; Conclusion
    Step at which linear FVU and KL riseGaussian mixture mimicking the MNIST training setStarting at 500 to 1K steps, continuing to about 4K stepsSection 4.2
    • The authors call the period in which the linear fit worsens while the quadratic FVU barely moves the quadratic stage, and argue the network shifts from linear features to largely quadratic nonlinear features, broadly consistent with DSB.
    • Section 4 expectations also include that after the linear R² declines, the quadratic R² also declines nearly monotonically. The main text reports for that period that the quadratic FVU is nearly unchanged, without giving numbers for a quadratic R² decline. In the first few hundred steps both FVUs decline, so from the start of training it is not monotonically worsening either.
    • The authors say the early FVU decline is somewhat unexpected and suggest random initialization is often simple and SGD may first remove noise. The KL in Figure 3 lacks this early decline; the remaining trends are similar to the FVU plots. The paper does not map the over 95% figure to a specific reading in Figure 2.

    Feature visualization

    • Figure 1 plots the top quadratic eigenvector for class "3" and the linear coefficients for that class, at columns 2^4, 2^6, 2^8, 2^10, 2^12, 2^14, 2^16, 2^18. Above each column are labeled 0.01, 0.01, 0.01, 0.01, 0.04, 0.10, 0.13, 0.20; the main text does not separately define these numbers.
    • The caption says recognizable "3"s emerge from noise, consistent with the interval where learning occurs; the linear structure is most intuitive when FVU is minimal, and that step number is not fully printed in the text. The caption says the quadratic features form later, with visual artifacts at the latest stages.
    • Section 4.3 states that the linear and quadratic features are most intuitive between 2^12 and 2^14 steps, after which the model begins to overfit. This is the authors' interpretation of the images; the text conversion cannot see pixels.

    SVD input interventions

    • The same projection is applied to all test-set examples, removing the first k components of the SVD of the linear coefficients, with k from 1 to 10. Test accuracy is recorded for the ReLU MLP, the linear approximation, and the quadratic approximation simultaneously. Figure 4 top row shows interventions on "3" from 1 to 10 components; the bottom row shows each digit after all ten components are removed.
    • The authors say the accuracy of the original network and both approximations declines in lockstep (the caption says perfect lockstep). After ablating 4 components, accuracy is already below 50%. After removing all 10 components, i.e., 10 of 784 dimensions, the authors say the MLP is no better than random. The caption says these images still closely resemble the originals and remain recognizable to humans, but the MLP cannot classify them.
    • The authors take this as evidence that the linear approximation captures input features that are causally relevant to the original model and captures out-of-distribution behavior. In the conclusion, the authors say these adversarial examples can be proven effective. The paper does not give accuracy percentage points for each k.

    Other ablations and analyses

    • Quadratic closed-form solution: at d=784, the z dimension is 307,720, Cov(z) has 9.47×10^10 entries, time complexity O(d^6); under N(0,1), Cov(z) is diagonal with entries in {1, 2} (Appendix B).
    • Quadratic FVU curve noise: the authors attribute it to first solving under N(0,1) and then fine-tuning with SGD, rather than a fully analytic solution under the mixture (footnote 3).
    • FVU vs KL: in the first few hundred steps FVU declines while KL does not (Figure 2, Figure 3).
    • The paper does not report hidden width, learning rate, or number of repeats, nor does it report FVU or accuracy on GLU or GELU networks.
  5. What are some points that can be further explored?

    The authors state that the Gaussian mixture assumption and analytical computations above quadratic order limit the method, and discuss possible applications to transformer feed-forward layers.

    Limitations and future directions noted by the authors

    • Distribution assumption: The analytic derivation assumes the input follows some Gaussian mixture; the authors say it is unclear whether it can be usefully generalized to other distributions (Limitations).
    • Applicability: The authors believe Gaussianity can avoid the approximation overfitting the specific properties of the training set, but it may not suit all applications (Limitations).
    • Use when non-Gaussian: If Gaussianity is too restrictive, the authors suggest initializing a gradient optimizer with the analytic polynomial and then fine-tuning on samples from the target distribution (Limitations).
    • Order and scale: An n-th order approximation requires materializing a tensor with d k^n parameters (k is the input dimension, d the number of neurons). The authors say that when intermediate activation dimensions reach tens of thousands, the highest order computable analytically is n=2; if the best quadratic approximation is poor, the method alone is hard to use for explaining the model (Limitations).
    • Deeper modules: The authors write that the paper focuses on simple image classification and believe the same approximation could be applied to feedforward modules in deeper networks, such as transformers (Future Work).
    • Overcomplete bases: The authors believe that eigendecomposing the quadratic approximation of a transformer FFN could give d² feature vectors for the d-dimensional residual stream; this overcomplete basis might handle polysemanticity in a SAE-like way, and more sophisticated tensor decompositions might be better. Basis vectors could be projected through the unembedding into next-token prediction space for inspection (Future Work).

    Experimental coverage

    • The experimental model is a single-hidden-layer ReLU MLP trained on MNIST; Appendix B writes the input dimension as 784. The paper does not report hidden width, learning rate, or number of repeats.
    • FVU and KL for the linear and quadratic approximations are plotted on a Gaussian mixture mimicking the MNIST training set (Figure 2, Figure 3), with checkpoints at log intervals. Quadratic coefficients are initialized from the closed-form solution under N(0,1) and then fine-tuned with schedule-free SGD.
    • Visualizations are the linear coefficients and top eigenvectors of the quadratic approximation for class "3" in Figure 1, at steps from 2^4 to 2^18. Section 4.3 states the most interpretable steps are 2^12 to 2^14.
    • Input interventions apply a uniform SVD projection of the linear coefficients to the test set, ablating from 1 to 10 components, and report accuracy for the ReLU MLP, linear approximation, and quadratic approximation simultaneously (Figure 4, Figure 5).
    • Appendix A gives Gaussian integrals for ReLU and GELU, and Section 3.5 gives the argument for GLU. Numerical results are reported only for the linear and quadratic approximations of this ReLU MLP; the paper does not report FVU, KL, or accuracy on GLU, GELU, or transformers.
  6. Summarize the main content of the paper

    A closed-form polynomial explains over 95% of the variance on a ReLU MLP on MNIST and is used to observe changes in order during training.

    Closed-form derivations give least-squares polynomials for single-hidden-layer MLPs and GLUs under a Gaussian or Gaussian mixture, used to inspect the network function rather than to train an SAE.

    • Problem: The authors say SAEs cannot distinguish whether features come from the model or the data. They set the input to the maximum-entropy distribution under low-order moment constraints, i.e., the Gaussian given known mean and covariance, and minimize MSE over that distribution.
    • Method: The linear slope is determined by the input covariance and the network–input cross-covariance, with the cross term via Stein's lemma. Higher orders are turned into OLS through a monomial feature map; the Master Theorem splits the required multivariate integrals into univariate ones. Mixture distributions use the law of total covariance. On MNIST, the analytic mixture solution for the quadratic is infeasible, so it is first solved under N(0,1) and then fine-tuned with SGD.
    • Fitting trajectory: The object under study is a single-hidden-layer ReLU MLP on MNIST. The abstract says the quadratic approximation explains over 95% of the output variance at the end of training; the conclusion says well over 95%. From 500 to 1K steps linear FVU and KL rise, continuing to about 4K steps; over the same period quadratic FVU is nearly unchanged. The authors call this the quadratic stage and consider it broadly consistent with DSB. In the first few hundred steps FVU declines; KL lacks this decline.
    • Input interventions: After removing 4 SVD components of the linear coefficients, test accuracy is below 50%; after removing 10/784 dimensions, the authors say the MLP is no better than random, and it declines in lockstep with both approximations. The authors say this indicates the linear approximation captures features that are causally relevant to the original model.
    • Authors' closing: When the fit variance is high, observations on the spectral decomposition can transfer to the original ReLU network. The authors also note that the derivation relies on a Gaussian mixture, and at high dimensions the analytic order stops at quadratic.
Read originalarxiv.org