acceptodds
Under review as a conference paper at ICLR 2027

Toward a mechanistic understanding of inference in visual cortex and diffusion models

Abstract

We describe a model of perceptual inference in primary visual cortex (V1) equivalent to a minimal diffusion model whose function can be readily understood from its parameters. We use an implicit recurrent network to define the denoising network and train it with implicit differentiation. The recurrent dynamics are derived by generalizing classical sparse coding’s inference dynamics through the addition of learnable pairwise interactions among latent units. After training on natural images, the model exhibits exceptionally good denoising performance, with an emergent ability to restore image features such as extended contours amid extreme visual ambiguity. The model nearly matches the behavior of standard, black-box diffusion architectures. Owing to the model’s simplicity, we provide a mechanistic understanding of how the model learned to resolve ambiguity. The model learns orientated receptive fields and a pairwise interaction matrix that links neurons with similar orientation tuning. These connectivity patterns mirror the structure of horizontal connections in the superficial layers of V1. Besides connectivity, our Jacobian analysis reveals a mechanistic explanation of how the recurrent circuit assigns high probability to a continuous family of natural structural deformations, including the deformation that allows the model to complete contours. Intriguingly, within this circuit, a large fraction of latent variables learn to disconnect from visual input altogether, essentially forming a hierarchical representation that appears to enforce global consistency among image features. Together, the model and results bridge two distinct domains: for neuroscience, they generate concrete, testable hypotheses regarding functional connectivity in recurrent neural circuits during perceptual inference tasks; for machine learning, they elucidate the internal mechanisms learned by diffusion models that allow them to generate infinitely many novel images from a finite training set.

Primary area:
applications to neuroscience & cognitive science
Keywords:
Diffusion model, primary visual cortex, contour completion, contour integration, implicit function, deep equilibrium model, mechanistic interpretability, neuroAI

Reviews

Among:
Shape:
1234this paper, Top 30%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.67 over 3 reviews, above 70% of the others.
Reviewer_f84mOpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

This paper introduces a non-factorial recurrent model trained according to denoising diffusion, based on the sparse coding model for latent representations in the visual cortex. The authors demonstrate how this architecture allows for closed form, analytic solutions to the gradients of the latent representations. These gradients reveal an interpretable decomposition of how basis functions in the sparse coding model activate and suppress one another, and the authors draw comparisons to observed contour completion in their model, an effect which is known to occur in the visual cortex. These interpretable dynamics involve increasingly higher-order multi-hop comparisons amongst active neurons' local orientations. Furthermore, they discover a subset of basis functions which have no direct mapping to pixel-space outputs, but play a crucial role in global dynamics, and suggest this may give insight into traditional UNet-based diffusion models. Finally, the authors make new predictions about visual cortex activity, specifically that in contour completion neurons will excite their neighbors strongest under noisy observations, and that the effects are context-dependent.

Critical strengths
  • The paper applies clean mathematical treatment to their setup, and breaks the architecture down into specific mechanistic principles which are insightful into how sparse coding could result in meaningful latent representations of observed imagery under a diffusion objective. I feel that I have genuinely deeper insight into a connection between sparse coding and diffusion, and how sparse coding can model the visual cortex, after reading this paper.
  • The authors draw meaningful comparisons across visual cortex findings and diffusion models using their new non-factorial sparse coding model, and include a convincing comparison to a parameter-matched UNet based diffusion model, demonstrating similar performance.
Critical weaknesses
  • The mechanistic results seem quite specialized to this specific non-factorial sparse coding architecture. Since the architecture's assumptions are closest to the neuroscience setting, the value added to understanding of the brain seems to be the strongest. Although the authors acknowledge the difference, the main writing may still be over-emphasizing the level of insight this provides for diffusion broadly. E.g. it's not clear to me that the notion of basis functions and especially the global synchronization effects apply to a UNet or DiT.
  • Relatedly, the final takeaway is not entirely clear. The alignment of generative diffusion objectives with visual cortex is quite interesting, but the final claims are fairly modest augmentations to current theory predictions of neural activity in V1.
  • Less critically, the presentation could be improved in a few places. Specifically, earlier introduction to the notion of the basis function dictionary and a more intuitive outline of the sparse coding architecture implementation and how it differs or relates to standard diffusion would likely make the paper easier to read.
Questions for authors
  1. Please elaborate on how the principles of basis functions and global synchronization in the non-factorial sparse coding architecture may transfer to typical diffusion (UNet and/or DiT). In general, I'd be interested to hear a clarification of what findings you expect to transfer over, and which seem specific to your implementation.
  2. Please clarify what you see as the primary contributions of the research, and how it may advance our understanding or future design of generative diffusion models (if you see that as a possibility). This is related to question 1, as the paper does not seem to state how the mechanisms of generalization found in the sparse coding architecture would or would not translate to diffusion processes in general.
Reviewer_k5YTOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper shows a learnable inter-neuronal interaction matrix into a classical sparse coding model, utilizing the fixed points of recurrent dynamics as a denoiser to construct a minimalist diffusion model with interpretable parameters. The model develops Gabor-like receptive fields when trained on natural images, which are similar to those found in the V1. This assigns the model to complete occluded contours, producing image quality comparable to that of small-scale U-Net architectures. Given the model’s concise structure, the authors decompose the denoising Jacobian into components representing activity propagation among neurons and diffusion along contours. This explains how the model generates coherent structural deformations and synthesizes new images. Then, the authors identify a subset of neurons that do not participate in pixel reconstruction but instead serve a global coordination function, leading to testable predictions regarding V1 circuitry.

Critical strengths
  1. The model is concise that the denoising Jacobian can be precisely decomposed into a gating diffusion process at the level of individual neurons, and giving predictions for V1 circuits that can be tested via optogenetic experiments.

  2. The authors don't prespecify the connectivity between neurons. Instead, by simply learning to denoise natural images, the model developed a structure where neurons with similar orientation preferences and collinear arrangements form mutually excitatory connections, which is a pattern consistent with the connections observed in the V1 area.

Critical weaknesses
  1. The authors don't use a symmetry constraint on the interaction matrix, which makes the claim that the principal directions of the Jacobian correspond to high-probability directions mathematically imprecise. Also, the mechanistic decomposition presented in the main text is derived from a simplified formulation assuming a single scale and synchronous updates. However, the actual trained model employs multi-scale convolutional dictionaries and some other techniques. Since the paper neither rederives nor validates this decomposition for the actual model, it remains unclear whether the step-by-step diffusion process illustrated in the paper truely reflects the behavior of the model in practice.

  2. The conclusion that the generalization of diffusion models is explained may have problem: the paper only demonstrates the mechanism of diffusion along activated neurons within its own simplified model. For standard U-Net, it only shows a similarity in the final results, without proving that the same mechanism works internally.

Questions for authors

Could the authors provide more direct evidence that a similar mechanism works within the standard U-Net? For example, one could examine the Jacobian of the intermediate features in a U-Net to see if it also exhibits a gating structure, where signals propagate exclusively between activated units. Also, may use the model to predict the feature vectors of a U-Net and quantify the degree of alignment between the two.

Reviewer_WRGGOpenReview ↗
Rating
2
Confidence
4
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes a formulation of an unconditional diffusion model where the denoising transformation between a noisy input xx and its reconstruction y^\hat{y} is parameterized by a recurrent neural network, with linear input drive Φ⊤\Phi^\top, nonlinear recurrent transformations TθT_\theta, and linear decoder Φ\Phi. The network is trained using a standard denoising score-matching objective, while the recurrent dynamics are derived from the energy function of a sparse coding model augmented with a learned non-factorial prior. The authors use implicit differentiation to compute gradients through the fixed point of the recurrent dynamics, avoiding full backpropagation through the recurrent trajectory. The explicit structure of the model allows for a functional interpretation of the learned dictionary Φ\Phi and recurrent interactions MM. When trained on natural images, the model learns Gabor-like dictionary elements and collinear interactions between spatially separated latent units, which resemble receptive fields and horizontal connectivity in V1. This model outperforms a model augmented with a factorial prior in denoising and contour completion, and achieves performance similar to conventional U-Net denoisers. The authors decompose the denoising Jacobian in terms of the dictionary, recurrent connectivity, and sparse activation gates, which they use to investigate how local perturbations propagate through the recurrent network. They argue that recurrent interactions give rise to geometry-adaptive Jacobian eigenvectors, corresponding to likely image deformations. Finally, they find that a large fraction of the latent units have near-zero dictionary weights but substantial recurrent connectivity, and hypothesize these units code form an emergent second layer that mediate long-range semantic dependencies.

Critical strengths
  1. The authors propose a recurrent architecture that can achieve diffusion-like performance.
  2. The proposed architecture enables an analytical decomposition of the denoising Jacobian in terms of interpretable components (ie. dictionary, recurrent interactions, activation gates). This provides a potentially useful circuit-level account of how local interactions give rise to structured perturbation responses, extending previous work that primarily characterized the geometry of the input-output Jacobian.
  3. The learned interactions exhibit biologically meaningful structure without explicitly imposing it. Training on natural images produces collinear facilitation between spatially separated neurons with similarly oriented receptive fields. This is an interesting result because the connectivity resembles known properties of horizontal connections in V1, even though the model is not explicitly constrained to learn collinear interactions (Fig. 3B). Moreover, imbuing the recurrent network with a structured prior allows the model to replicate traditional results from the sparse coding literature and enables functional interpretation of the recurrent dynamics.
  4. Empirical comparison with factorial sparse coding demonstrates the benefit of learned latent interactions. The authors show that incorporating the non-factorial prior substantially improves denoising performance and produces better contour completion. This provides empirical support for the importance of modeling statistical dependencies between visual features (Figs 2 & S5).
  5. The model provides experimentally testable predictions about cortical dynamics. In Section 4.4, the authors predict that the effects of recurrent interactions depend on both stimulus context and noise level, including a shift from suppression toward facilitation as sensory ambiguity increases. Although the relationship between the model and biological V1 remains speculative, generating testable predictions from an interpretable computational model is a meaningful contribution.
Critical weaknesses
  1. The paper can be quite difficult to parse. For example, there is no mention of the dimensionality of zz, Φ\Phi, γ\gamma, σ\sigma, or MM. Variables appear in equations without being properly defined immediately before or after. This includes TT (Eq, 1), w(σ)w(\sigma) (Eq. 2), and λ\lambda and γ\gamma (Eq. 3). It is also unclear which parameters are captured by θ\theta and thus trained using backprop (Eq. 5). Eq. 6 also introduces xcleanx_{\text{clean}} instead of using the already established yy. Section 3 is ordered in a way that is generally difficult to follow.
  2. In Section 2, the authors motivate recurrence partly by suggesting that deep feedforward networks may perform some kind of repeated refinement, but this motivation is speculative and the fact that recurrent networks can approximate feedforward networks does not mean their internal mechanisms are shared. The paper does not establish whether diffusion models possess the same mechanisms that are established in this model. On the biological side, while denoising is a good objective for learning a distribution over natural images, is it unclear what the normative justification is for using a denoising objective to learn a model of V1.
  3. While the proposed Jacobian decomposition provides an interesting account of how local perturbations propagate through the recurrent network, I am not convinced that the analyses establish the broader mechanistic claims made in the paper. In particular, the authors demonstrate that the learned connectivity exhibits collinear structure and that the denoiser's Jacobian has geometry-adaptive eigenvectors, but they do not clearly establish the causal relationship between these observations. The Neumann-series decomposition provides a plausible account of recurrent activity propagation, yet the relative contributions of the learned interaction matrix, sparse gating, and dictionary structure to the resulting eigenvectors are not systematically isolated. Consequently, it remains unclear whether the proposed recurrent mechanism is responsible for the observed geometric properties or is simply one possible implementation of them.
  4. The central geometric phenomena used to motivate the proposed mechanism were already established in Kadkhodaie et al. (2024), which demonstrated geometry-adaptive harmonic representations in conventional denoisers and investigated their relationship to generalization. Consequently, the main potential novelty of the present paper lies in its proposed circuit-level explanation of these phenomena. However, given the limited evidence establishing a causal relationship between the identified recurrent mechanisms and the resulting eigenstructure, it remains unclear how much additional explanatory understanding is provided beyond the preceding work.
  5. I also think that some of the claims in Section 4.2 are overstated. A Jacobian provides a local linear approximation, meaning its eigenvectors characterize directions in which the denoiser responds to infinitesimal perturbations, but they do not establish that arbitrary finite interpolations along those directions remain on a high-probability manifold. Demonstrating smooth deformations also do not prove that the model generalizes beyond its training data. To make such a claim the authors need additional evidence connecting these local geometric properties to actual generalization performance, especially because Kadkhodaie et al. 2024 already investigated this relationship much more directly.
  6. There are similar concerns in the analysis of detached neurons. Although the authors show that ablation degrades denoising performance, these effects do not uniquely establish that the neurons maintain global semantic coherence or implement an emergent representational hierarchy. For instance, the qualitative results in Figures 5C and 5F do not clearly demonstrate that the effects of ablation are specifically due to global semantic structure, as opposed to intermediate-scale geometric consistency or general denoising quality. Moreover, the fact that a neuron is not directly connected to the image does not imply that it encodes higher-order information. It could mediate interactions among other neurons without representing a higher level of abstraction. More fundamentally, it is unclear what criterion is being used to identify a representational hierarchy. The existence of latent units with negligible image-space connectivity does not directly imply that those neurons encode higher-order information. Furthermore, the practical architecture in Appx A8 already incorporates explicit multiscale interactions, making it important to distinguish the proposed emergent hierarchy from the hierarchy imposed by the architecture. More targeted interventions and quantitative analyses of the information represented by these neurons would be needed to substantiate the claimed hierarchical mechanism.
  7. Some prior work that contextualizes this work is not cited. First, the statement in Section 2 that learning flexible non-factorial priors can require difficult inference or high-dimensional sampling does not acknowledge a large section of the literature rooted in variational inference (e.g. see: A Structured Variational Auto-encoder for Learning Deep Hierarchies of Sparse Features. Salimans 2016). Moreover, connections between denoisers and (visual) cortex have been made before (see: Expressive probabilistic sampling in recurrent neural networks. Chen et al, 2023; Complex priors and flexible inference in recurrent circuits with dendritic nonlinearities. Lyo and Savin, 2024). Finally, there are also many prior work in diffusion-based representation learning that aim to extract the representations or mechanisms of unconditional denoisers. These references will better contextualize this work, and I suggest the authors explain what distinguishes their approach from these alternatives.
  8. The comparison against factorial sparse coding (M=0) does not isolate the contribution of the learned non-factorial prior, because introducing M simultaneously increases the expressivity of the recurrent network and allows it to learn additional interactions between latent variables. As a result, the improvements in denoising and contour completion do not establish whether they arise from the specific structure of the learned interactions or simply from the greater flexibility of the model. In fact, the paper already demonstrates that a U-Net denoiser can complete contours without an explicit non-factorial sparse-coding prior. This raises the question of whether the failure of the factorial model to perform contour completion is primarily due to the restrictive recurrent dynamics imposed by classical sparse coding, rather than the absence of a particular structured prior.
Questions for authors
  1. The energy contains z⊤Mzz^{\top}Mz, but its corresponding gradient is given by (M+M⊤)z(M+M^{\top})z rather than MzMz as used in Eq. 4. They are only equivalent if (as the authors rightly state) M is symmetric. If not, the learned dynamics do not necessarily correspond to gradient descent on the stated energy function. How well is this assumption supported by the learned MM matrix? Could you quantify the degree of asymmetry in the learned MM?
  2. The authors motivate their recurrent dynamics as energy minimization in a latent-variable probabilistic model, but train the resulting fixed-point mapping directly using a squared-error denoising objective. Since minimizing the latent energy corresponds to MAP inference whereas the optimal squared-error denoiser computes a posterior mean, how should the learned denoising function be interpreted as inference under the stated generative model?
  3. is Gaussian denoising intended as a biologically plausible model of sensory inference or simply as a mathematically convenient task that produces V1-like connectivity?
  4. Could you compare your network against an equally expressive recurrent network without the proposed energy-based parameterization, and see if the same effects (eg contour completion) appear? This would establish whether the non-factorial, sparse-coding formulation actually provides an important inductive bias towards biologically relevant perceptual effects, or if it simply a convenient and interpretable parameterization of a sufficiently expressive recurrent network.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.