Add Batch 83bc96b4-77f4-4a68-b874-5e8f14d95d3a
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_content_list.jsonAdded+3
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_model.jsonAdded+3
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_origin.pdfAdded+3
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/full.mdAdded
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/images.zipAdded+3
- ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/layout.jsonAdded+3
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_content_list.jsonAdded+3
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_model.jsonAdded+3
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_origin.pdfAdded+3
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/full.mdAdded+565
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/images.zipAdded+3
- ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/layout.jsonAdded+3
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_content_list.jsonAdded+3
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_model.jsonAdded+3
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_origin.pdfAdded+3
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/full.mdAdded
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/images.zipAdded+3
- ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/layout.jsonAdded+3
- ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_content_list.jsonAdded+3
- ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_model.jsonAdded+3
- ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_origin.pdfAdded+3
- ICML/2025/Clustering Properties of Self-Supervised Learning/full.mdAdded+640
- ICML/2025/Clustering Properties of Self-Supervised Learning/images.zipAdded+3
- ICML/2025/Clustering Properties of Self-Supervised Learning/layout.jsonAdded+3
- ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_content_list.jsonAdded+3
- ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_model.jsonAdded+3
- ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_origin.pdfAdded+3
- ICML/2025/Clustering via Self-Supervised Diffusion/full.mdAdded+486
- ICML/2025/Clustering via Self-Supervised Diffusion/images.zipAdded+3
- ICML/2025/Clustering via Self-Supervised Diffusion/layout.jsonAdded+3
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_content_list.jsonAdded+3
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_model.jsonAdded+3
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_origin.pdfAdded+3
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/full.mdAdded+552
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/images.zipAdded+3
- ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/layout.jsonAdded+3
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_content_list.jsonAdded+3
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_model.jsonAdded+3
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_origin.pdfAdded+3
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/full.mdAdded+612
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/images.zipAdded+3
- ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/layout.jsonAdded+3
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_content_list.jsonAdded+3
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_model.jsonAdded+3
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_origin.pdfAdded+3
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/full.mdAdded+531
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/images.zipAdded+3
- ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/layout.jsonAdded+3
- ICML/2025/CoPINN_ Cognitive Physics-Informed Neural Networks/25e85583-5294-43b0-9529-8cfb9838845c_content_list.jsonAdded+3
- ICML/2025/CoPINN_ Cognitive Physics-Informed Neural Networks/25e85583-5294-43b0-9529-8cfb9838845c_model.jsonAdded+3
123version https://git-lfs.github.com/spec/v1oid sha256:e5fcffa248e810378cbf4849e7b29955cd97cebecb6331d68248d74678869d1fsize 165418123version https://git-lfs.github.com/spec/v1oid sha256:9474b3045635bd88e10fef876f76a68e051f16d33d55b71320bb2877b65ee886size 200717123version https://git-lfs.github.com/spec/v1oid sha256:bf9154cd4960759f72b2de47642566585690a7723cb1dd5920134da9b5362e5csize 2705357123version https://git-lfs.github.com/spec/v1oid sha256:20da46ab01fd1e1a3e4a636e101c915148e61800c8d4c2948aa9011fd57d4407size 945435123version https://git-lfs.github.com/spec/v1oid sha256:1ea7a7a7fce9a06957ea9bc08a3449e4c32fc72be3d8af2de5eda2df86cb9168size 749106123version https://git-lfs.github.com/spec/v1oid sha256:3cbd0f9ea3a4cb63d6a919c79d5a34a777080ca86c1659215b1e773e1a1a9274size 146346123version https://git-lfs.github.com/spec/v1oid sha256:3339615e9936edf3dd5a7cdea436f7be49f85d8bda37d215b0ab326894bcb173size 173045123version https://git-lfs.github.com/spec/v1oid sha256:495f494ccb953c6bc01babe5fbedecfd465867f99bb85aa726d65229039e33f0size 869704123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565# Closed-form Solutions: A New Perspective on Solving Differential Equations
Shu Wei $^{12}$ Yanjie Li $^{1}$ Lina Yu $^{12}$ Weijun Li $^{134}$ Min Wu $^{1}$ Linjun Sun $^{1}$ Jingyi Liu $^{1}$ Hong Qin $^{13}$ Yusong Deng $^{12}$ Jufeng Han $^{13}$ Yan Pang $^{14}$
# Abstract
The quest for analytical solutions to differential equations has traditionally been constrained by the need for extensive mathematical expertise. Machine learning methods like genetic algorithms have shown promise in this domain, but are hindered by significant computational time and the complexity of their derived solutions. This paper introduces SSDE (Symbolic Solver for Differential Equations), a novel reinforcement learning-based approach that derives symbolic closed-form solutions for various differential equations. Evaluations across a diverse set of ordinary and partial differential equations demonstrate that SSDE outperforms existing machine learning methods, delivering superior accuracy and efficiency in obtaining analytical solutions.
# 1. Introduction
Differential equations (DEs) are foundational to mathematics, physics, and the natural sciences, providing abstract models for diverse physical phenomena. For example, Poisson's equation governs the distribution of electrostatic potential, while the heat equation describes temperature variations within an object (Evans, 2022). Solving these DEs is critical for understanding and predicting the dynamics of complex physical systems (Alkhadhr & Almekkawy, 2021; Savovic et al., 2023).
Deriving analytical solutions requires rigorous analysis of their existence, uniqueness, stability, and behavioral properties, often leveraging advanced mathematical theories and
$^{1}$ AnnLab, Institute of Semiconductors, Chinese Academy of Sciences, Beijing, China $^{2}$ College of Materials Science and Optoelectronic Technology, University of Chinese Academy of Sciences, Beijing, China $^{3}$ School of Integrated Circuits, University of Chinese Academy of Sciences, Beijing, China $^{4}$ School of Industry-education Integration, University of Chinese Academy of Sciences, Beijing, China. Correspondence to: Lina Yu <yulina@semi.ac.cn>, Min Wu <wumin@semi.ac.cn>.
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
computational techniques (Beck, 2012; Friz et al., 2020; Aderyani et al., 2022). For example, solving linear partial differential equations (PDEs) via the superposition principle involves determining Green's functions, $G(\mathbf{x}, \mathbf{x}^{\prime})$ , which represent solutions to PDEs with a point source at $\mathbf{x}^{\prime}$ . This process demands deep insights into the properties of Green's functions, especially under complex boundary conditions or in multidimensional domains (Duffy, 2015). Nonlinear PDEs, however, pose greater challenges due to their inherent complexity, rendering analytic solutions intractable and necessitating numerical methods. Traditional numerical methods, such as the finite volume method, are prone to discretization errors and rely heavily on meshing, which can lead to convergence issues, especially with finely granulated meshes (Moukalled et al., 2016; Li et al., 2023b). Machine learning (ML) methods have emerged as powerful tools to address these limitations, significantly enhancing the ability to model and solve complex PDEs.
Physics-Informed Neural Networks (PINNs) (Raissi et al., 2019; Cuomo et al., 2022), grounded in the universal approximation theorem (Hornik et al., 1989), effectively approximate solutions to diverse physical systems. However, due to the nature of neural networks, these methods often exhibit low computational efficiency and struggle to accurately satisfy physical constraints, resulting in compromised convergence accuracy, particularly for stiff or high-frequency problems (Wang et al., 2021; Rao et al., 2023). The advent of neural operator methods, such as Deep Operator Network (DeepONet) (Lu et al., 2021a) and the Fourier Neural Operator (FNO) (Li et al., 2023b), which learn mappings between functions, offers a promising avenue to tackle these issues. Yet, these neural operator algorithms typically require extensive labeled data for training. Moreover, both traditional numerical methods and deep learning approaches sacrifice the interpretability of analytical solutions. This lack of interpretability poses challenges in accurately grasping system dynamics and limits the ability to extrapolate beyond the computational domain, thereby constraining their applicability in scientific research and engineering applications.
Recent advances in symbolic regression have enabled the derivation of interpretable solutions to DEs without requiring expert mathematical knowledge, through data-driven approaches. Genetic programming (GP)-based approaches
employ physics-regularized fitness functions to evolve symbolic solutions. Tsoulos et al. (2006) propose a GP method that evolves solution expression genomes modeled using Formal Grammars (HOPCROFT, 1979). Oh et al. (2023) introduce a customizable GP approach (Randall et al., 2022) that directly evolves expression trees as solutions for this task. Cao et al. (2023; 2024) enhance GP algorithms with pruning techniques and transfer learning. Similarly, Kamali et al. (2015) and Boudouaoui et al. (2020) develop population-based methods that emulate heuristic search behaviors inspired by resource-seeking populations. However, these approaches often yield complex solutions with limited interpretability and incur high computational costs, particularly in high-dimensional problems, where finding accurate solutions remains challenging. In parallel, alternative paradigms have emerged. Liang and Yang propose the FEX method (2022), which uses reinforcement learning to search for weighted symbolic networks to solve differential equations. Liu's Kolmogorov-Arnold Networks (2025) can be used to derive symbolic solutions through network symbolization. While both methods improve fitting performance by introducing additional parameters, they frequently lack interpretability. Majumdar et al. propose an approach utilizing trained PINNs to generate datasets, subsequently applying symbolic regression to extract expressions (2023). This method falls short of adhering to physical constraints, primarily due to inherent limitations in numerical precision and error propagation. The core challenge lies in balancing three critical aspects: (1) maintaining strict adherence to physical laws, (2) ensuring computational efficiency, and (3) preserving human-interpretable symbolic forms. Current symbolic regression approaches either sacrifice interpretability for accuracy or face scalability issues in complex problems. Alternative paradigms, while offering improved fitting capabilities, fundamentally differ from our goal of deriving precise, physics-compliant symbolic solutions. To overcome these limitations, we propose a novel reinforcement learning (RL)-based method for deriving closed-form symbolic solutions to DEs. Our contributions are as follows:
- The introduction of the Symbolic Solver for Differential Equations (SSDE), an RL-based paradigm that directly derives closed-form symbolic solutions to differential equations with high interpretability. - The development of the Risk-Seeking Constant Optimization (RSCO) algorithm, which accelerates constant optimization while preserving accuracy and convergence. - A novel form of symbolic solutions expressed as parametric expressions, enhancing the applicability of SSDE for discovering symbolic solutions to DEs in any single dimension.
- An innovative exploration technique that enables SSDE to recursively solve high-dimensional PDEs, achieving superior performance across tested DE types and outperforming mainstream comparative methods.
# 2. Related Work
Numerical methods based on ML PINNs leverage the nonlinear representation power of neural networks to solve PDEs by embedding physical constraints directly into the training process as inductive biases (Raissi et al., 2019). This approach enables unsupervised learning relying on PDE residuals while faces several challenges. For example, their dependency on soft constraints for embedding physical laws may not thoroughly integrate exact physical priors and they often exhibit inefficiency when handling with stiff problems, characterized by rapidly changing solutions (Wang et al., 2021; Rao et al., 2023). To address these limitations, enhancements have been developed, including the hard-coding boundary conditions (Lu et al., 2021c), and employing temporal representations (Rao et al., 2023). In contrast, operator learning methods (Lu et al., 2021a; Cai et al., 2021; Li et al., 2023c;b) utilize neural networks to approximate nonlinear operators, providing a supervised learning approach to solving PDEs that depends on paired input-output data. While these methods offer significant potential, their substantial requirement for labeled data in scientific contexts poses a significant challenge. Both PINNs and neural operator learning methods yield approximate solutions to PDEs. These solutions frequently lack interpretability with respect to the underlying physical phenomena and demonstrate limited generalization beyond the specific scenarios used for training.
Symbolic regression methods Symbolic regression methods can be broadly categorized into two main categories: search-based and supervised learning-based approaches. Search-based methods explore the solution space to identify optimal symbolic expressions, encompassing traditional techniques such as genetic programming (GP) and heuristic search strategies (Forrest, 1993; Koza, 1994; Schmidt & Lipson, 2009; Staelens et al., 2013; Arnaldo et al., 2015; Iwo & Krawiec, 2019; Randall et al., 2022; Jiang & Xue, 2023). These conventional approaches, however, often grapple with an expansive search space, leading to computationally intensive tasks. Moreover, they tend to produce increasingly complex symbolic expressions without corresponding performance gains. To mitigate these challenges, recent advancements have integrated neural networks to guide and constrain the search process, enhancing efficiency (Sahoo et al., 2018; Zhang et al., 2023; Dong et al., 2024). Additionally, reinforcement learning techniques, including policy gradient methods and Monte Carlo tree searches, have been employed for symbolic regression (Petersen et al., 2020;
Mundhenk et al., 2021; Sun et al., 2023; Li et al., 2024). Although these methods exhibit slower inference times since they necessitate iterative searches during inference and the time-consuming evaluation of regressed symbolic expressions, they demonstrate promising performance in SRBench Black-box dataset (La Cava et al., 2021). In contrast, supervised learning-based approaches leverage large-scale pretraining on synthetic datasets to directly generate symbolic expressions (Biggio et al., 2021; Kamienny et al., 2022; Li et al., 2023a). By producing expressions in a single forward pass, these methods achieve significantly faster inference speeds compared to search-based techniques. A notable hybrid approach, TPSR (Shojae et al., 2024), combines elements of search and supervised learning, yielding impressive performance. However, the effectiveness of supervised methods diminishes when the training data distribution diverges from that of the target physical system, leading to reduced model accuracy.
ML for solving DEs analytically Symbolic regression's ability to uncover expressive and interpretable formulations makes it a promising tool for deriving understandable symbolic solutions to DEs. Genetic algorithm-based symbolic regression methods have been employed to solve DEs (Tsoulos & Lagaris, 2006; Oh et al., 2023; Cao et al., 2023). Oh et al. introduce Bingo (Randall et al., 2022), using automatic differentiation to assess physical residuals in DEs as a fitness function to optimize symbolic expressions. Heuristic algorithms inspired by swarm intelligence, such as ant colony programming (Kamali et al., 2015) and artificial bee colony programming (Boudouaoui et al., 2020) emulate resource-seeking behaviors to search for solutions. However, these methods are computationally intensive, particularly for high-dimensional problems, where the expansive search space poses significant challenges. To address this, transfer learning has been explored to reduce the search space by leveraging solutions from single-dimensional instances of high-dimensional PDEs (HD-PDEs) (Cao et al., 2024). Yet, this approach is limited, as most physical systems governed by PDEs lack known single-dimensional equations. Liang and Yang (2022) propose a reinforcement learning pipeline to guide a weighted symbolic network toward approximate solution of DEs. The introduction of weights reduces interpretability and complicates the discovery of minimalist analytical expressions. Kolmogorov-Arnold Networks (KANs) (Liu et al., 2025) offer a novel approach for deriving symbolic solutions to DEs by incorporating a physics-regularized loss function. However, converting KANs' learned representations into symbolic expressions often degrades accuracy, resulting in solutions that fail to precisely satisfy the underlying equations. Majumdar et al. (2023) perform symbolic regression on numerical solutions from PINNs to identify interpretable expressions. Since PINN-derived solutions are inherently approximate,
the resulting symbolic expressions may not fully adhere to physical constraints, introducing inaccuracies due to error propagation.
# 3. Preliminary Studies
Differential equations Differential equations (DEs) are equations related to unknown univariate or multivariate functions and their derivatives or partial derivatives. Consider a bounded domain $\Omega \subset \mathbb{R}^n$ , with a point $\mathbf{x} = (x_1, x_2, \ldots, x_n) \in \Omega$ . Let $u(\mathbf{x})$ denote the unknown function to be determined. For a positive integer $k$ , $D^k u \in \mathbb{R}^{n^k}$ represents all $k$ -th order partial derivatives of $u$ . Given a function $\mathcal{F}: \Omega \times \mathbb{R} \times \mathbb{R}^n \times \dots \times \mathbb{R}^{n^{k-1}} \times \mathbb{R}^{n^k} \to \mathbb{R}$ , the general form of a $k$ -th order partial differential equation (PDE) can be expressed as in Eq. (1). When $n = 1$ , the PDE reduces to an ordinary differential equation (ODE).
$$\mathcal {F} [ \mathbf {x}, u (\mathbf {x}), D u (\mathbf {x}), \dots , D ^ {k - 1} u (\mathbf {x}), D ^ {k} u (\mathbf {x}) ] = 0 \tag {1}$$
Prominent examples include Poisson's equation:
$$- \Delta u (\mathbf {x}) = - \sum_ {i = 1} ^ {n} \frac {\partial^ {2} u}{\partial x _ {i} ^ {2}} = f (\mathbf {x}), \tag {2}$$
defined on the spatial domain $\Omega$ , and the heat equation:
$$\frac {\partial u (\mathbf {x} , t)}{\partial t} - a ^ {2} \Delta u (\mathbf {x}, t) = f (\mathbf {x}, t), \quad a > 0, \tag {3}$$
defined on the spatiotemporal domain $(x,t)\in \Omega \times \tau$ , where $a$ is a constant and $T > 0$ . To ensure a well-posed problem for analytical solutions, a PDE must be accompanied by appropriate boundary conditions (BCs) and, for time-dependent PDEs, initial conditions (ICs). BCs are typically specified as $\mathcal{B}(u;\mathbf{x}\in \partial \Omega) = 0$ on the boundary $\partial \Omega$ , while ICs for time-dependent problems are given as $\mathcal{I}(u;t = 0,\mathbf{x}\in \Omega) = 0$ . Together, the differential equation, BCs, and ICs define a complete mathematical problem.
Closed-form solution The closed-form solution $\hat{u} (\mathbf{x})$ to a differential equation (DE) is composed of a finite combination of known functions, such as elementary functions (e.g., polynomials, exponentials, trigonometric functions), special functions (e.g., Bessel or hypergeometric functions), or, in some contexts, neural operators. Within a bounded domain, the solution must satisfy the DE along with its associated boundary conditions (BCs) and, for time-dependent problems, initial conditions (ICs). For example, $\hat{u} = c\cosh (x_1)\sin (x_2)$ , involving the constant $c$ , operators $\{\times ,\cosh ,\sin \}$ and variables $x_{1}$ and $x_{2}$ , is a candidate closed-form solution to the Laplace equation $-\Delta u(\mathbf{x}) = 0$
# 4. Methodology
SSDE identifies closed-form solutions using an unsupervised reinforcement learning framework, as depicted in Fig.
 Figure 1. Algorithm overview (using spatiotemporal dynamical systems as an example). (a) The RNN generates skeletons for candidate solutions. (b) Sampled points are fed into the candidate skeletons to construct computational graphs with constants $c_{i}$ as parameters. (c) Physical constraints are built via automatic differentiation. (d) Constants are optimized to minimize $\mathcal{L}_{\mathrm{s - t}}$ . (e) The evaluator computes rewards based on physical constraints to train RNN. The process iterates until a valid solution is found.
1. To accelerate convergence while maintaining precision, we propose a risk-seeking constants optimization method. Additionally, for solving high-dimensional partial differential equations (HD-PDEs), we develop a recursive exploration technique. Pseudocode for the proposed algorithms is included in the appendix A.
# 4.1. Physics-Regularized Reinforcement Learning
Expression skeleton generator We leverage symbolic expression trees, where internal nodes denote mathematical operators, and terminal nodes represent input variables or constants. The pre-order traversal of the corresponding expression tree $\tau$ represents the expression skeleton of $\hat{u}$ . Each constant within the skeleton is a column vector of length $|c_{\mathrm{dim}}|$ . Therefore, when $|c_{\mathrm{dim}}| \neq 1$ , a single expression skeleton can yield multiple outputs for identical inputs, as detailed in Section 4.3. Inspired by automated machine learning (AutoML) works (Bello et al., 2017; Cuomo et al., 2022), we employ a Recurrent Neural Network (RNN) to generate categorical distributions over tokens from a given symbolic library $\mathcal{L}$ . For each token $\tau_i$ (e.g., $+$ , $\times$ , $x_1$ , $c$ , ...) we sample with likelihood $P(\tau_i | \tau_{1:(i-1)}; \theta)$ in an autoregressive manner to ensure contextual dependencies on previously chosen sym
bolts. The likelihood of the entire sampled expression $\hat{u}$ is computed as $p(\hat{u}|\theta) = \prod_{i=1}^{|\tau|} p(\tau_i|\tau_{1:i-1};\theta)$ , where $|\tau|$ is the length of the pre-order traversal. The RNN inputs include representations of the parent and sibling nodes of the token being sampled, reinforcing the model's understanding of the expression's tree structure.
Physics-regularized local constant optimization(LCO) To ensure the expression skeleton complies with physical constraints, we employ PyTorch's automatic differentiation method (Paszke et al., 2017) to compute the differential term associated with the constraints. The constants in $\hat{u}$ are optimized by minimizing the discrepancy between predicted values and the given conditions. For instance, in a spatiotemporal dynamical system satisfying Dirichlet conditions, data points are sampled from the spatiotemporal domain $\Omega \times \mathcal{T}$ . We use nonlinear optimization algorithms such as the BFGS algorithm (Fletcher, 2000), to optimize the constants by minimize the sum of mean squared errors $\mathcal{L}_{\mathrm{s - t}}$ (Eq. (4), where 's-t' denotes the spatio-temporal system). The loss terms for the collocation points corresponding to the differential term $\mathcal{F}$ (defined in Eq. (1)), boundary conditions $\mathcal{B}$ and initial conditions $\mathcal{I}$ , where $\{\mathbf{x}_f^i,t_f^i\}_{i = 1}^{N_{\mathcal{F}}}$ , $\{\mathbf{x}_b^i,t_b^i,u_b^i\}_{i = 1}^{N_{\mathcal{B}}}$ , $\{\mathbf{x}_0^i,u_0^i\}_{i = 1}^{N_{\mathcal{I}}}$ represent the respective collocation points, and $\lambda_{i}$ denotes the relative weight of each loss term.
$$\left\{ \begin{array}{l} \mathcal {L} _ {\mathrm {s - t}} = \lambda_ {0} \mathrm {M S E} _ {\mathcal {F}} + \lambda_ {1} \mathrm {M S E} _ {\mathcal {B}} + \lambda_ {2} \mathrm {M S E} _ {\mathcal {I}} \\ \mathrm {M S E} _ {\mathcal {F}} = \frac {1}{N _ {\mathcal {F}}} \sum_ {i} ^ {N _ {\mathcal {F}}} | \mathcal {F} \left(x _ {f} ^ {i}, t _ {f} ^ {i}\right) | ^ {2} \\ \mathrm {M S E} _ {\mathcal {B}} = \frac {1}{N _ {\mathcal {B}}} \sum_ {i} ^ {N _ {\mathcal {B}}} | \hat {u} \left(x _ {b} ^ {i}, t _ {b} ^ {i}\right) - u _ {b} ^ {i} | ^ {2} \\ \mathrm {M S E} _ {\mathcal {I}} = \frac {1}{N _ {\mathcal {I}}} \sum_ {i} ^ {N _ {\mathcal {I}}} | \hat {u} \left(x _ {0} ^ {i}, 0\right) - u _ {0} ^ {i} | ^ {2} \end{array} \right. \tag {4}$$
Solution Evaluator We conceptualize the task of discovering closed-form solutions as a Markov Decision Process (MDP) comprising the elements $(S, \mathcal{A}, \mathcal{P}, \mathcal{R})$ . The siblings and parent nodes of the current symbolic node act as the observation $S$ . The policy is defined by the distribution of tokens produced by the RNN, $p(\tau_i | \theta)$ , from which the action (token $\tau_i$ ) is sampled, leading to a transition to a new expression state. Each generation of the expression is guided by terminal and undiscounted reward functions, where each episode reflects one cycle. To evaluate the generated expression under physics regularization, we apply a squashing function to the average of the root mean square errors (RMSE) of physical constraints across different systems. The reward for the expression skeleton $\hat{u}$ in a spatiotemporal dynamical system is computed as:
$$\mathcal {R} _ {\mathrm {s - t}} (\hat {u}) = \frac {1}{1 + \operatorname {A v e r a g e} \left(\sqrt {\operatorname {M S E} _ {\mathcal {F}}} + \sqrt {\operatorname {M S E} _ {\mathcal {B}}} + \sqrt {\operatorname {M S E} _ {\mathcal {I}}}\right)} \tag {5}$$
Training RNN using policy gradients Standard policy gradient methods typically focus on optimizing the average
performance of the policy, which deviates from the objective of finding an optimal closed-form solution. To maximize the best-case performance, we employ risk-seeking policy gradients with genetic programming introduced in (Petersen et al., 2020; Mundhenk et al., 2021), with the learning objective $J_{\mathrm{risk}}(\theta ;\epsilon)$ parameterized by $\epsilon$ as:
$$J _ {\text {r i s k}} (\theta ; \epsilon) \approx \mathbb {E} _ {\hat {u} \sim p (\hat {u} | \theta)} [ \mathcal {R} (\hat {u}) | \mathcal {R} (\hat {u}) \geq \mathcal {R} _ {\epsilon} (\theta) ] \tag {6}$$
where $\mathcal{R}_{\epsilon}(\theta)$ is the reward distribution's $(1 - \epsilon)$ -quantile under the current policy. To foster exploration, we integrate the hierarchical entropy of the sampled expressions into the reward term, weighted by $\lambda_{\mathcal{H}}$ (Landajuela et al., 2021):
$$\mathcal {H} (\theta) = \lambda_ {\mathcal {H}} \mathbb {E} _ {\hat {u} \sim p (\hat {u} | \theta)} \left[ \sum_ {i = 1} ^ {| \tau |} \gamma^ {i - 1} H [ p (\tau_ {i} | \tau_ {1: (i - 1)}; \theta) ] \right] \tag {7}$$
# 4.2. Risk-Seeking Constant Optimization (RSCO)
Optimizing constants within the expression skeleton to satisfy physical constraints, particularly those related to differential equations (e.g., $\mathrm{MSE}_{\mathcal{F}}$ ), incurs considerable computational costs. Building on the risk-seeking policy gradients introduced in (Petersen et al., 2020), the training objective focuses solely on the top $\epsilon$ fraction of episodes. Note that the skeleton must satisfy deterministic conditions to meet physical constraints. As $\hat{u}$ approaches these deterministic conditions, the likelihood of satisfying the differential equation's physical constraints increases. Therefore, we propose a risk-seeking constant optimization method.
In each iteration, the constants of a batch of sampled expression skeletons are optimized based on deterministic conditions by minimizing the modified loss $\mathcal{L}_{\mathrm{s - t}}^{\prime}$ (defined in Eq. (8)). The reward $\tilde{\mathcal{R}}$ for each expression is still computed by Eq. (5). The top $\epsilon$ fraction of samples incorporates all physical constraints as defined in Eq. (4), while the constants are refined and the rewards are recalculated to yield more accurate evaluations. The accurate rewards of the precise top $\epsilon$ fraction are then used to calculate the policy gradient $\nabla_{\theta}J_{\mathrm{risk}}(\theta ,\epsilon)$ via Eq. (9), which will guide the RNN. By enforcing boundary or initial conditions before optimization, this strategy eliminates unnecessary constant optimization based on differential relationships for expression skeletons that already violate physical constraints, echoing the philosophy of hard constraint embedding. (Lu et al., 2021c).
$$\begin{array}{l} \mathcal {L} _ {\mathrm {s - t}} ^ {\prime} = \lambda_ {1} \mathrm {M S E} _ {\mathcal {B}} + \lambda_ {2} \mathrm {M S E} _ {\mathcal {I}} (8) \\ \nabla_ {\theta} J _ {\text {r i s k}} (\theta , \epsilon) = \mathbb {E} _ {\hat {u} \sim p (\hat {u} | \theta)} [ (\mathcal {R} (\hat {u}) - \mathcal {R} _ {\epsilon} (\theta)) \cdot \\ \left. \nabla_ {\theta} \log p (\hat {u} | \theta) \mid \tilde {\mathcal {R}} (\hat {u}) \geq \tilde {\mathcal {R}} _ {\epsilon} (\theta) \right] (9) \\ \end{array}$$
# 4.3. Recursion-Based Exploration
As the solution dimensionality increases, the symbol library expands, leading to an exponential growth in the search
space. The pre-order traversal length $|\tau|$ , and the size of the symbol library $|\mathcal{L}|$ result in a combinatorial search space of size $|\mathcal{L}|^{|\tau|}$ . The computational complexity of solving HD-PDEs also grows with dimensionality, due to the increased number of variables in the physical constraints. To mitigate this, we propose a recursive exploration scheme that decomposes the solution of multidimensional differential equations into sequential, dependent rounds, with each round focusing on a single variable.
Parametric expression We focus on finding the expression skeleton for the single variable $\{x_{i}\}_{i = 1}^{d}$ . The terms formulated using other variables $\mathbf{x}_{-i}$ are treated as fluctuating parameters $\vec{\alpha} (\mathbf{x}_{-i})\in \mathbb{R}^m$ , where $m$ denotes the number of such parameters. The skeleton $\hat{u} (\mathbf{x})$ is transformed into a parametric expression $\tilde{u} (x_i;\vec{\alpha} (\mathbf{x}_{-i}))$ . For the first $k$ observed variable, we can get the solution a parametric form: $\hat{u} = \tilde{u} (x_1,x_2,\dots ,x_k;\vec{\alpha}_k(\mathbf{x}_{-1,2,\ldots ,k}))$ . Here, $\mathbf{x}_{-1,2,\ldots ,k}$ represents all variables except $x_{1},x_{2},\ldots ,x_{k}$ .
Recursive call When $k = 0$ , the close-form solution is viewed as a parameter $\hat{u} = \vec{\alpha}_0 = \alpha_0$ . For each round $k > 0$ , we update the expression for the $k$ -th observed variable $x_k$ . The last round's parametric expressions $\vec{\alpha}_{k-1}$ are viewed as new parametric expressions $\tilde{u}_k$ dependent on $x_k$ and the new parameters $\vec{\alpha}_k(\mathbf{x}_{-\{...,k\}})$ . Namely, $\vec{\alpha}_{k-1} = \tilde{u}_k(x_k; \vec{\alpha}_k(\mathbf{x}_{-\{...,k\}}))$ , which forms a typical recursive relation.
Recursive case We ascertain the parametric skeletons $\tilde{u}_k$ on the single dimension, as well as the parameter vector $\vec{\alpha}_k$ by the reinforcement learning method proposed above. In the parametric expression, each parameter is a vector of length $|c_{\mathrm{dim}}|$ , corresponding to the varying values calculated from data points collected within the $\mathbf{x}_{-i}$ space. Here, $|c_{\mathrm{dim}}|$ represents the number of points. These parameters are optimized in accordance with the specified physical constraints, and the resulting parametric expressions are evaluated. If the variance of the $|c_{\mathrm{dim}}|$ dimensional parameters falls below a predetermined threshold, we surmise that this parameter does not vary with $\mathbf{x}_{-i}$ and it degenerates to a constant. This approach allows us to distinguish between fixed constants and $\vec{\alpha}$ parameters.
Base case When the identified parametric skeleton has no remaining parameters, $\tilde{u}$ is considered a symbol expression independent of the other variables. In the final round, the parameter expression from the previous round, $\vec{\alpha}_{d - 1}$ , becomes a symbolic expression dependent only on the last variable $x_{d}$ . Further, the closed-form solution to a $d$ -dim DE is given as:
$$\begin{array}{l} \hat {u} = \tilde {u} \left(x _ {1}, x _ {2}, \dots , x _ {k}; \vec {\alpha} _ {k} \left(\mathbf {x} _ {- \{1, 2, \dots , k \}}\right)\right) \\ = \tilde {u} _ {1} (x _ {1}; \tilde {u} _ {2} (x _ {2}; \dots \tilde {u} _ {d} (x _ {d}; \vec {c}))) \\ \end{array}$$
Ultimately, by substituting all parameters with their corresponding symbolic expressions regarding the other variables and further optimizing the constants within the expression skeleton based on physical constraints, we can derive a closed-form solution for the multidimensional differential equation.
The recursive process enables SSDE to learn in a focused manner, addressing one variable dimension at a time.
# 5. Experimental Settings
We present experimental settings used to evaluate SSDE by answering the following research questions (RQs):
RQ1: How does SSDE compare to other mainstream methods in finding closed-form solutions to differential equations?
RQ2: Can RSCO and the recursive exploration strategies improve SSDE's ability to find closed-form solutions?
RQ3: Does SSDE produce more accurate solutions than performing symbolic regression methods based on numerical solutions?
All details regarding datasets, computing infrastructures, baselines and their parameter settings, along with additional comparative experiments and results, are reported in appendix.
# 5.1. Metrics
The evaluation of our methodology and baselines is conducted from two distinct perspectives:
- The mean Root Mean Squared Error (RMSE) between the predicted closed-form solution and physical constraints, denoted by $\mathcal{L}_{\mathrm{PHY}}$ . Taking the spatiotemporal dynamical system as an example and referring to Eq. (4), it is defined as:
$$\mathcal {L} _ {\mathrm {P H Y}} = \text {A v e r a g e} \left(\sqrt {\mathrm {M S E} _ {\mathcal {F}}} + \sqrt {\mathrm {M S E} _ {\mathcal {B}}} + \sqrt {\mathrm {M S E} _ {\mathcal {I}}}\right) \tag {10}$$
This measure assesses whether the identified solutions are consistent with physical constraints.
- The complete recovery rate of closed-form solution expressions. For a given closed-form solution $u$ , if the skeleton of the found expression $\hat{u}$ after simplification is exactly the same or equivalent to $u$ , and after the final optimization of constants, the mean square error between the expression and the true solution is less than $1 \times 10^{-8}$ , the expression is considered to have completely recovered the true solution. $P_{\mathrm{RE}}$ represents the proportion of closed-form solution expressions that
completely recover the true solution in 20 independent experiments. This metric quantifies the symbolic and numerical differences between the regressed expression and the true solution.
# 5.2. Baselines
We evaluate the performance of the proposed recursive exploration method by comparing it with the following methods used for seeking the closed-form solutions:
- PINN+DSR: Performs symbolic regression with DSR (Petersen et al., 2020) on the numerical solutions obtained from PINNs (Raissi et al., 2019). - Kolmogorov-Arnold Networks (KAN): A recently proposed method designed to replace Multi-Layer Perceptrons (MLP) (Liu et al., 2025). Compared to MLP, KAN performs better in symbolic formula representation tasks (Yu et al., 2024) and shows promise for discovering closed-form solutions to HD-PDEs. - PR-GPSR: Uses genetic programming to search for a function that satisfies the given PDE and boundary conditions (Oh et al., 2023).
# 5.3. Benchmark Problem Sets
To evaluate the performance of our method across a diverse range of differential equations, we selected the following equations for testing:
- 2D and 3D Poisson's Equations: As a classic example of time-independent partial differential equation, Poisson's equation is widely used in fields such as electrostatics, fluid dynamics, and mechanical engineering. - 2D and 3D Heat Equations: These equations are canonical examples of spatio-temporal dynamic systems, describing the phenomena related to heat transfer. - 2D and 3D Nonlinear Wave Equations: Nonlinear wave equations are fundamental models for describing the propagation of waves in various media, where the wave amplitude depends on both space and time.
The equations and their deterministic conditions are provided in Table 1.
# 6. Results on Benchmarks
(RQ1) Solution accuracy on benchmarks Table 2 presents a comparative analysis of solutions from SSDE against other methods used to derive closed-form solutions. SSDE consistently outperforms the other methods across all benchmarks, discovering solutions with significantly smaller
Table 1. Summary of tested differential equations with their deterministic conditions
<table><tr><td>NAME</td><td>PDE</td><td>DETERMINISTIC CONDITIONS</td></tr><tr><td>POISSON2D</td><td>∂2u/∂x1+ ∂2u/∂x2=30x12-7.8x1+1,X∈[-1,1]2</td><td>u(X)=2.5x14-1.3x13+0.5x22-1.7x2,X∈∂[-1,1]2</td></tr><tr><td>POISSON3D</td><td>∂2u/∂x1+ ∂2u/∂x2+ ∂2u/∂x3=30x12-7.8x2+1,X∈[-1,1]3</td><td>u(X)=2.5x14-1.3x23+0.5x32,X∈∂[-1,1]3</td></tr><tr><td rowspan="2">HEAT2D</td><td rowspan="2">∂u/∂t-(∂2u/∂x12+∂2u/∂x22)=-30x12+7.8x2+t,X∈[-1,1]2</td><td>u(X,t)=2.5x14-1.3x23+0.5t2,X∈∂[-1,1]2,t∈[0,1]</td></tr><tr><td>u(X,0)=2.5x14-1.3x23,X∈[-1,1]2</td></tr><tr><td rowspan="2">HEAT3D</td><td>∂u/∂t-(∂2u/∂x12+∂2u/∂x22+∂2u/∂x32)=-30x12+7.8x2-2.7</td><td>u(X,t)=2.5x14-1.3x23+0.5x32-1.7t,X∈∂[-1,1]3,t∈[0,1]</td></tr><tr><td>,X∈[-1,1]3</td><td>u(X,0)=2.5x14-1.3x23+0.5x32,X∈[-1,1]3</td></tr><tr><td rowspan="2">WAVE2D</td><td>∂2u/∂t2-(∂2u/∂x12+∂2u/∂x22)=-u-u3+((0.25-4x12).</td><td>u(X,t)=exp(x12)sin(x2)e-0.5t,X∈∂[-1,1]2,t∈[0,1]</td></tr><tr><td>ex12-0.5t+3x12-1.5t sin(x2)2)sin(x2),X∈[-1,1]2</td><td>u(X,0)=exp(x12)sin(x2),X∈[-1,1]2</td></tr><tr><td rowspan="2">WAVE3D</td><td>∂2u/∂t2-(∂2u/∂x12+∂2u/∂x22+∂2u/∂x32)=u2-((4x12+4x32+2.75).</td><td>u(X,t)=exp(x12+x32)cos(x2)e-0.5t,X∈∂[-1,1]3,t∈[0,1]</td></tr><tr><td>ex12+x32-0.5t+ex212+2x32-t cos(x2))cos(x2),X∈[-1,1]3</td><td>u(X,0)=exp(x12+x32)cos(x2),X∈[-1,1]3</td></tr></table>
Table 2. Comparison of average ${\mathcal{L}}_{\mathrm{{PHY}}}\left( \widehat{u}\right)$ and recovery rates among SSDE and baselines for solving differential equations. 95% confidence intervals are obtained from the standard error between mean ${\mathcal{L}}_{\mathrm{{PHY}}}\left( \widehat{u}\right)$ on each problem set.
<table><tr><td rowspan="2">NAME</td><td colspan="2">SSDE</td><td colspan="2">PINN+DSR</td><td colspan="2">KAN</td><td colspan="2">PR-GPSR</td></tr><tr><td>\( \mathcal{L}_{\text{PHY}} \downarrow \)</td><td>\( P_{\text{RE}} \uparrow \)</td><td>\( \mathcal{L}_{\text{PHY}} \downarrow \)</td><td>\( P_{\text{RE}} \uparrow \)</td><td>\( \mathcal{L}_{\text{PHY}} \downarrow \)</td><td>\( P_{\text{RE}} \uparrow \)</td><td>\( \mathcal{L}_{\text{PHY}} \downarrow \)</td><td>\( P_{\text{RE}} \uparrow \)</td></tr><tr><td>POISSON2D</td><td>7.20E-5±2.57E-6</td><td>100%</td><td>5.71E-1±7.88E-2</td><td>0%</td><td>7.20E+0±1.46E+0</td><td>0%</td><td>1.90E-2±2.32E-3</td><td>0%</td></tr><tr><td>POISSON3D</td><td>5.70E-5±1.33E-6</td><td>100%</td><td>2.60E+0±1.11E-1</td><td>0%</td><td>6.16E+0±1.52E+0</td><td>0%</td><td>1.80E-1±1.76E-2</td><td>0%</td></tr><tr><td>HEAT2D</td><td>1.47E-6±7.64E-7</td><td>100%</td><td>3.21E+0±1.35E-1</td><td>0%</td><td>1.16E+1±1.24E+0</td><td>0%</td><td>2.15E-1±1.28E-2</td><td>0%</td></tr><tr><td>HEAT3D</td><td>1.05E-5±1.23E-6</td><td>100%</td><td>2.69E+0±3.24E-1</td><td>0%</td><td>1.15E+1±1.72E+0</td><td>0%</td><td>8.87E-1±2.96E-1</td><td>0%</td></tr><tr><td>WAVE2D</td><td>4.25E-5±2.35E-6</td><td>100%</td><td>9.56E-1±2.14E-1</td><td>0%</td><td>2.04E+0±1.42E-1</td><td>0%</td><td>4.24E-1±3.69E-1</td><td>0%</td></tr><tr><td>WAVE3D</td><td>8.17E-6±1.56E-6</td><td>100%</td><td>1.34E+1±4.16E+0</td><td>0%</td><td>1.36E+1±2.38E+0</td><td>0%</td><td>9.87E-1±2.46E-1</td><td>0%</td></tr></table>
 Figure 2. Ablation study of SSDE on benchmarks of PDE.
$L_{\mathrm{PHY}}$ values. The increased dimensionality poses a substantial challenge for the other methods, as they struggle to
navigate the exponentially expanded search space to find accurate closed-form solutions. In contrast, SSDE's recursive exploration strategy, which employs reinforcement learning independently for each dimension, exhibits a remarkable advantage in solving higher-dimensional PDEs. Specifically, SSDE reliably identifies correct closed-form solutions for both linear and nonlinear differential equations. We also provide a detailed illustration of how SSDE progressively isolates each variable and recursively constructs the correct solution through stepwise regression in the appendix F.
(RQ2) Ablation studys We conducted a series of ablation studies to evaluate the individual contributions of key components, including RSCO and the recursive exploration strategy (RecurExp). Figure 2 illustrates the complete recovery rate of SSDE on the PDE benchmarks under the same execution time for each ablated configuration. The results highlight the critical role of these components in enhancing overall performance. Specifically, the absence of RSCO significantly impairs SSDE's ability to identify correct closed-form solutions within the same time frame. Similarly, disabling the recursive exploration strategy drastically diminishes SSDE's capability to solve high-dimensional partial differential equations, preventing it from discovering accurate closed-form solutions.
Table 3. Identified Solutions $\widehat{u}$ by SSDE on DEs
<table><tr><td>NAME</td><td>GROUND TRUTH</td><td>IDENTIFIED SOLUTIONˆ</td></tr><tr><td>POISSON2D</td><td>x12(2.5x12-1.3x1)+0.5x2(x2-1.4)-x2</td><td>x12(2.5000x12-1.3000x1)+0.4999x2(x2-1.4002)-x2</td></tr><tr><td>POISSON3D</td><td>2.5x14-1.3x23+0.5x32</td><td>2.5000x14-1.3000x23+0.4999x32+2.3763e-5</td></tr><tr><td>HEAT2D</td><td>0.5t2+2.5x14-1.3x23</td><td>0.5000t2+log(e2.5000x14-x2(1.3000x2-8.1811e-7))</td></tr><tr><td>HEAT3D</td><td>-1.7t+2.5x14-1.3x23+0.5x32</td><td>-1.7003t+2.5000x14-1.3000x23+0.4999x32+0.0002</td></tr><tr><td>WAVE2D</td><td>exp(x12)sin(x2)e-0.5t</td><td>exp(-0.5000t+x12)sin(x2)</td></tr><tr><td>WAVE3D</td><td>exp(x12+x32)cos(x2)e-0.5t</td><td>exp(-0.5000t+1.000x12+x32)cos(x2)1.000</td></tr></table>
Table 4. Comparison of average $\mathcal{L}_{\mathrm{PHY}}(\hat{u})$ and recovery rates between SSDE and PINN+DSR for Poisson's equations within $\Gamma$ dataset. $95\%$ confidence intervals are obtained from the standard error between mean $\mathcal{L}_{\mathrm{PHY}}(\hat{u})$ on each problem set.
<table><tr><td rowspan="2">NAME</td><td rowspan="2">DIFFERENTIAL EQUATION</td><td colspan="2">SSDE</td><td colspan="2">PINN+DSR</td></tr><tr><td>\( \mathcal{L}_{\text{PHY}}\downarrow \)</td><td>\( P_{\text{RE}}\uparrow \)</td><td>\( \mathcal{L}_{\text{PHY}}\downarrow \)</td><td>\( P_{\text{RE}}\uparrow \)</td></tr><tr><td>\( \Gamma_1 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=6x_1+2 \)</td><td>8.70E-8±7.72E-9</td><td>100%</td><td>2.93E-5±2.36E-6</td><td>100%</td></tr><tr><td>\( \Gamma_2 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=12x_1^2+6x_1+2 \)</td><td>3.65E-7±2.62E-7</td><td>100%</td><td>6.55E-5±5.78E-6</td><td>100%</td></tr><tr><td>\( \Gamma_3 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=20x_1^3+12x_1^2+6x_1+2 \)</td><td>3.98E-7±9.22E-8</td><td>100%</td><td>2.52E-4±3.38E-5</td><td>100%</td></tr><tr><td>\( \Gamma_4 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=30x_1^4+20x_1^3+12x_1^2+6x_1+2 \)</td><td>7.24E-7±7.79E-8</td><td>100%</td><td>2.47E-3±7.83E-4</td><td>0%</td></tr><tr><td>\( \Gamma_5 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=(2\cos(x_1)-4x_1\sin(x_1))\cos(x_1^2)-(4x_1^2+1)\cdot \sin(x_1^2)\cos(x_1) \)</td><td>1.39E-6±2.06E-6</td><td>100%</td><td>8.66E-5±4.05E-6</td><td>100%</td></tr><tr><td>\( \Gamma_6 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=2\cos(x_1^2+x_1)-\sin(x_1)-(2x_1+1)^2\sin(x_1^2+x_1) \)</td><td>7.60E-7±8.75E-7</td><td>100%</td><td>1.26E-5±8.48E-7</td><td>100%</td></tr><tr><td>\( \Gamma_7 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=-4x_1^2/(x_1^2+1)^2+2/(x_1^2+1)-1/(x_1+1)^2 \)</td><td>4.06E-6±5.82E-6</td><td>100%</td><td>8.42E-3±1.15E-3</td><td>0%</td></tr><tr><td>\( \Gamma_8 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}=-0.25/x_1^{1.5} \)</td><td>1.23E-6±2.01E-6</td><td>100%</td><td>1.98E-5±1.87E-6</td><td>70%</td></tr><tr><td>\( \Gamma_9 \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}+\frac{\partial^2u}{\partial x_2^2}=2\cos(x_2^2)-4x_2^2\sin(x_2^2)-\sin(x_1) \)</td><td>3.22E-7±3.27E-8</td><td>100%</td><td>5.15E-3±1.32E-3</td><td>0%</td></tr><tr><td>\( \Gamma_{10} \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}+\frac{\partial^2u}{\partial x_2^2}=-4\sin(x_1)\cos(x_2) \)</td><td>1.27E-6±1.92E-6</td><td>100%</td><td>2.58E-3±3.17E-4</td><td>0%</td></tr><tr><td>\( \Gamma_{11} \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}+\frac{\partial^2u}{\partial x_2^2}=x_1^{x_2}\log(x_1)^2+x_1^{x_2}x_2(x_2-1)/x_1^2 \)</td><td>1.24E-5±2.29E-5</td><td>100%</td><td>4.89E-3±2.69E-3</td><td>0%</td></tr><tr><td>\( \Gamma_{12} \)</td><td>\( \frac{\partial^2u}{\partial x_1^2}+\frac{\partial^2u}{\partial x_2^2}=12x_1^2-6x_1+1.0 \)</td><td>1.22E-5±2.32E-5</td><td>100%</td><td>6.68E-1±1.48E-1</td><td>0%</td></tr></table>
# 7. (RQ3) Compared with SR on Numerical Solutions
To further demonstrate the superiority of SSDE over symbolic regression methods that operate on numerical solutions, we conduct a series of benchmarks based on the Nguyen dataset, adapted for Poisson's equations with known source terms. Each differential equation is designed so that its analytical solution corresponds to one of the expressions in the Nguyen dataset (Uy et al., 2011). The baseline method first computes numerical solutions for these equations using PINNs and then applies DSR directly to the numerical outputs.
Table 4 reports the results of SSDE and the baseline method in terms of $\mathcal{L}_{\mathrm{PHY}}$ and recovery rate $P_{\mathrm{RE}}$ . Due to the approximation errors inherent in numerical solutions and the compounding of these errors during the symbolic regression process, the baseline methods occasionally recover the correct solution skeletons, but frequently yield significant inaccuracies during constant optimization. In contrast,
SSDE bypasses the reliance on numerical surrogates entirely and consistently recovers accurate closed-form expressions across all test cases.
# 8. Conclusion
We propose SSDE, a reinforcement learning-based framework for discovering closed-form symbolic solutions to differential equations. SSDE employs a recurrent neural network to generate symbolic candidates, guided by an evaluator grounded in physical constraints. To improve learning efficiency and convergence, we introduce a risk-seeking constant optimization technique. By formulating symbolic solutions as parametric expressions, SSDE can decompose high-dimensional PDEs into recursively solvable, single-dimensional components. This recursive formulation allows SSDE to efficiently recover closed-form solutions to complex differential equations. Extensive experiments on various types of differential equations demonstrate that SSDE can discover accurate symbolic solutions without
prior mathematical knowledge, offering a promising new direction for analytical DE solving.
# Software and Data
To facilitate reproducibility and further research, we provide the complete implementation of SSDE, including training scripts, benchmark configurations, and symbolic expression evaluation tools. The source code is publicly available at:
https://github.com/Hintonein/SSDE
In addition, all benchmark datasets constructed for this study, including the high-dimensional PDEs and Poisson problems derived from Nguyen expressions, are included in the repository. The code is implemented in Python and relies on PyTorch and standard scientific computing libraries.
# Acknowledgement
This work was supported by National Natural Science Foundation of China (No.92370117) and the CAS Project for Young Scientists in Basic Research (No.YSBR-090).
# Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
# References
Aderyani, S. R., Saadati, R., O'Regan, D., and Alshammari, F. S. Existence, uniqueness and stability analysis with the multiple exp function method for npdes. Mathematics, 10(21):4151, 2022. Alkhadhr, S. and Almekkawy, M. A combination of deep neural networks and physics to solve the inverse problem of burger's equation. In 2021 43rd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), pp. 4465-4468. IEEE, 2021. Arnaldo, I., O'Reilly, U.-M., and Veeramachaneni, K. Building predictive models via feature synthesis. In Proceedings of the 2015 annual conference on genetic and evolutionary computation, pp. 983-990, 2015. Beck, M. A brief introduction to stability theory for linear pdes. In SIAM conference on Nonlinear Waves and Coherent Structures, 2012. Bello, I., Zoph, B., Vasudevan, V., and Le, Q. V. Neural optimizer search with reinforcement learning. In International Conference on Machine Learning, pp. 459-468. PMLR, 2017.
Biggio, L., Bendinelli, T., Neitz, A., Lucchi, A., and Paras-candolo, G. Neural symbolic regression that scales. In International Conference on Machine Learning, pp. 936-945. PMLR, 2021. Boudouaoui, Y., Habbi, H., Ozturk, C., and Karaboga, D. Solving differential equations with artificial bee colony programming. Soft Computing, 24:17991-18007, 2020. Cai, S., Wang, Z., Lu, L., Zaki, T. A., and Karniadakis, G. E. Deepm&mnet: Inferring the electroconvection multiphysics fields based on operator approximation by neural networks. Journal of Computational Physics, 436: 110296, 2021. Cao, L., Zheng, Z., Ding, C., Cai, J., and Jiang, M. Genetic programming symbolic regression with simplification-pruning operator for solving differential equations. In International Conference on Neural Information Processing, pp. 287-298. Springer, 2023. Cao, L., Liu, Y., Wang, Z., Xu, D., Ye, K., Tan, K. C., and Jiang, M. An interpretable approach to the solutions of high-dimensional partial differential equations. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 20640-20648, 2024. Cuomo, S., Di Cola, V. S., Giampaolo, F., Rozza, G., Raissi, M., and Picciali, F. Scientific machine learning through physics-informed neural networks: Where we are and what's next. Journal of Scientific Computing, 92(3):88, 2022. Dong, J., Zhong, J., Liu, W.-L., and Zhang, J. Evolving equation learner for symbolic regression. IEEE Transactions on Evolutionary Computation, pp. 1-1, 2024. doi: 10.1109/TEVC.2024.3404650. Duffy, D. G. Green's functions with applications. Chapman and Hall/CRC, 2015. Evans, L. C. *Partial differential equations*, volume 19. American Mathematical Society, 2022. Fletcher, R. Practical methods of optimization. John Wiley & Sons, 2000. Forrest, S. Genetic algorithms: principles of natural selection applied to computation. Science, 261(5123):872-878, 1993. Friz, P. K., Nilssen, T., and Stannat, W. Existence, uniqueness and stability of semi-linear rough partial differential equations. Journal of Differential Equations, 268(4): 1686-1721, 2020. HOPCROFT, J. Introduction to automata theory. Languages, and Computations, 127, 1979.
Hornik, K., Stinchcombe, M., and White, H. Multilayer feedforward networks are universal approximators. Neural networks, 2(5):359-366, 1989. Iwo, B. and Krawiec, K. Solving symbolic regression problems with formal constraints. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 977-984, 2019. Jiang, N. and Xue, Y. Symbolic regression via control variable genetic programming. In Koutra, D., Plant, C., Gomez Rodriguez, M., Baralis, E., and Bonchi, F. (eds.), Machine Learning and Knowledge Discovery in Databases: Research Track, pp. 178-195, Cham, 2023. Springer Nature Switzerland. ISBN 978-3-031-43421-1. Kamali, M., Kumaresan, N., and Ratnavelu, K. Solving differential equations with ant colony programming. Applied Mathematical Modelling, 39(10):3150-3163, 2015. ISSN 0307-904X. doi: https://doi.org/10.1016/j.apm.2014.11.003. URL https://www.sciencedirect.com/science/article/pii/S0307904X14005356. Kamienny, P.-A., d'Ascoli, S., Lample, G., and Charton, F. End-to-end symbolic regression with transformers. Advances in Neural Information Processing Systems, 35: 10269-10281, 2022. Koza, J. R. Genetic programming as a means for programming computers by natural selection. Statistics and computing, 4:87-112, 1994. La Cava, W., Burlacu, B., Virgolin, M., Kommenda, M., Orzechowski, P., de Franca, F. O., Jin, Y., and Moore, J. H. Contemporary symbolic regression methods and their relative performance. Advances in neural information processing systems, 2021(DB1):1, 2021. Landajuela, M., Petersen, B. K., Kim, S., Santiago, C. P., Glatt, R., Mundhenk, N., Pettit, J. F., and Faissol, D. Discovering symbolic policies with deep reinforcement learning. In International Conference on Machine Learning, pp. 5979-5989. PMLR, 2021. Li, W., Li, W., Sun, L., Wu, M., Yu, L., Liu, J., Li, Y., and Tian, S. Transformer-based model for symbolic regression via joint supervised learning. In The Eleventh International Conference on Learning Representations, 2023a. URL https://openreview.net/forum?id=ULzyv9M1j5. Li, W., Li, W., Yu, L., Wu, M., Sun, L., Liu, J., Li, Y., Wei, S., Deng, Y., and Hao, M. A neural-guided dynamic symbolic network for exploring mathematical expressions from data. In Proceedings of the 41st International Conference on Machine Learning, pp. 28222-28242, 2024.
Li, Z., Huang, D. Z., Liu, B., and Anandkumar, A. Fourier neural operator with learned deformations for pdes on general geometries. Journal of Machine Learning Research, 24(388):1-26, 2023b. Li, Z., Meidani, K., and Farimani, A. B. Transformer for partial differential equations' operator learning. Transactions on Machine Learning Research, 2023c. ISSN 2835-8856. URL https://openreview.net/forum?id=EPPqt3uERT. Liang, S. and Yang, H. Finite expression method for solving high-dimensional partial differential equations. arXiv preprint arXiv:2206.10121, 2022. Liu, Z., Wang, Y., Vaidya, S., Ruehle, F., Halverson, J., Soljacic, M., Hou, T. Y., and Tegmark, M. KAN: Kolmogorov-arnold networks. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=Ozo7qJ5vZi. Lu, L., Jin, P., Pang, G., Zhang, Z., and Karniadakis, G. E. Learning nonlinear operators via deeponet based on the universal approximation theorem of operators. Nature machine intelligence, 3(3):218-229, 2021a. Lu, L., Meng, X., Mao, Z., and Karniadakis, G. E. DeepXDE: A deep learning library for solving differential equations. SIAM Review, 63(1):208-228, 2021b. doi: 10.1137/19M1274067. Lu, L., Pestourie, R., Yao, W., Wang, Z., Verdugo, F., and Johnson, S. G. Physics-informed neural networks with hard constraints for inverse design. SIAM Journal on Scientific Computing, 43(6):B1105-B1132, 2021c. Majumdar, R., Jadhav, V., Deodhar, A., Karande, S., Vig, L., and Runkana, V. Symbolic regression for pdes using pruned differentiable programs. arXiv preprint arXiv:2303.07009, 2023. Moukalled, F., Mangani, L., Darwish, M., Moukalled, F., Mangani, L., and Darwish, M. The finite volume method. Springer, 2016. Mundhenk, T., Landajuela, M., Glatt, R., Santiago, C. P., Petersen, B. K., et al. Symbolic regression via deep reinforcement learning enhanced genetic programming seeding. Advances in Neural Information Processing Systems, 34:24912-24923, 2021. Oh, H., Amici, R., Bomarito, G., Zhe, S., Kirby, R., and Hochhalter, J. Genetic programming based symbolic regression for analytical solutions to differential equations, 2023. URL https://arxiv.org/abs/2302.03175.
Paszke, A., Gross, S., Chintala, S., Chanan, G., Yang, E., DeVito, Z., Lin, Z., Desmaison, A., Antiga, L., and Lerer, A. Automatic differentiation in pytorch. NeurIPS Autodiff Workshop, 2017. URL https://openreview.net/forum?id=BBJsrmfCZ. Petersen, B. K., Larma, M. L., Mundhenk, T. N., Santiago, C. P., Kim, S. K., and Kim, J. T. Deep symbolic regression: Recovering mathematical expressions from data via risk-seeking policy gradients. In International Conference on Learning Representations, October 2020. Raissi, M., Perdikaris, P., and Karniadakis, G. E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational physics, 378:686-707, 2019. Randall, D. L., Townsend, T. S., Hochhalter, J. D., and Bomarito, G. F. Bingo: a customizable framework for symbolic regression with genetic programming. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, pp. 2282-2288, 2022. Rao, C., Ren, P., Wang, Q., Buyukozturk, O., Sun, H., and Liu, Y. Encoding physics to learn reaction-diffusion processes. Nature Machine Intelligence, 5(7):765-779, 2023. Sahoo, S., Lampert, C., and Martius, G. Learning equations for extrapolation and control. In International Conference on Machine Learning, pp. 4442-4450. PMLR, 2018. Savović, S., Ivanović, M., and Min, R. A comparative study of the explicit finite difference method and physics-informed neural networks for solving the burgers' equation. *Axioms*, 12(10):982, 2023. Schmidt, M. and Lipson, H. Distilling free-form natural laws from experimental data. science, 324(5923):81-85, 2009. Shojae, P., Meidani, K., Barati Farimani, A., and Reddy, C. Transformer-based planning for symbolic regression. Advances in Neural Information Processing Systems, 36, 2024. Staelens, N., Deschrijver, D., Vladislavleva, E., Vermeulen, B., Dhaene, T., and Demeester, P. Constructing a no-reference h. 264/avc bitstream-based video quality metric using genetic programming-based symbolic regression. IEEE Transactions on Circuits and Systems for Video Technology, 23(8):1322-1333, 2013. Sun, F., Liu, Y., Wang, J.-X., and Sun, H. Symbolic physics learner: Discovering governing equations via monte carlo tree search. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=ZTK3SefE8_Z.
Takamoto, M., Praditia, T., Leiteritz, R., MacKinlay, D., Alesiani, F., Pflüger, D., and Niepert, M. Pdebench: An extensive benchmark for scientific machine learning. Advances in Neural Information Processing Systems, 35: 1596-1611, 2022. Tsoulos, I. G. and Lagaris, I. E. Solving differential equations with genetic programming. Genetic Programming and Evolvable Machines, 7:33-54, 2006. Uy, N. Q., Hoai, N. X., O'Neill, M., McKay, R. I., and Galván-López, E. Semantically-based crossover in genetic programming: application to real-valued symbolic regression. Genetic Programming and Evolvable Machines, 12:91-119, 2011. Wang, S., Teng, Y., and Perdikaris, P. Understanding and mitigating gradient flow pathologies in physics-informed neural networks. SIAM Journal on Scientific Computing, 43(5):A3055-A3081, 2021. Wolfram Research, Inc. Mathematica, Version 14.2, 2024. URL https://www.wolfram.com/mathematica.Champaign, IL, 2024. Yu, R., Yu, W., and Wang, X. Kan or mlp: A fairer comparison. CoRR, abs/2407.16674, 2024. URL https://doi.org/10.48550/arXiv.2407.16674. Zhang, M., Kim, S., Lu, P. Y., and Soljacic, M. Deep learning and symbolic regression for discovering parametric equations. IEEE Transactions on Neural Networks and Learning Systems, 2023.
# A. Pseudocode for SSDE
In this section, we present the pseudocode of SSDE. The overall procedure is described in Alg. 1, and the recursive exploration mechanism is shown in Alg. 3. Additionally, we provide the subroutines SampleSkeleton (line 5 in Alg. 1), ReplaceParameters (line 12 in Alg. 3), and SingleDimensionalSSDE (line 9 in Alg. 3) in Algs. 2, 4, and 5, respectively.
Alg. 1 describes the overall SSDE framework with the risk-seeking constant optimization (RSCO) strategy. An RNN generates candidate symbolic skeletons, and the constants within each skeleton are optimized using boundary and initial conditions. A reward is then computed based on physical constraints. After collecting a batch of rewards, the $(1 - \epsilon)$ -quantile is computed to select top-performing skeletons. These selected expressions are further refined by re-optimizing constants, and the updated rewards are used to compute risk-seeking policy gradients and entropy regularization for RNN parameter updates. This process continues until the termination criterion is met. Alg. 2 defines the symbolic skeleton sampling process using the RNN. The ApplyConstraints function (line 8) filters infeasible tokens to reduce the search space, while Arity (line 11) returns the argument count for each token. ParentSibling (line 12) calculates the parent and sibling nodes to guide the next token generation. This top-down sampling process follows a similar mechanism as DSR (Petersen et al., 2020); readers are referred to the original paper for further details.
In Alg. 3, we propose a recursive algorithm based on single-dimensional SSDE (described in Alg. 5) to identify the closed-form solutions to high-dimensional partial differential equations (HD-PDEs). For an HD-PDE with $d$ variables, the algorithm iteratively represents the symbolic solution as a hierarchical parametric traversal. At iteration $k$ , the traversal corresponding to the $k$ -th dimension is denoted as $\tilde{\tau}^{(k)}(x_k; \vec{\alpha}_k)$ about single variable $x_k$ and containing parameters $\vec{\alpha}_k$ , where $\vec{\alpha}_k$ contains parameters dependent on subsequent variables $\mathbf{x}_{-\{\dots,k\}}$ . Initially, the entire solution is regarded as a
Algorithm 1 SSDE: Reinforcement Learning Framework for Discovering Closed-Form PDE Solutions with RSCO Input: differential equation $\mathcal{F}$ ; deterministic conditions (boundary conditions $\mathcal{B}$ , initial conditions $\mathcal{I}$ ) Parameter: RNN learning rate $\eta$ ; entropy coefficient $\lambda_{\mathcal{H}}$ ; risk factor $\epsilon$ ; batch size $N$ ; sample epochs $M$ ; reward function $R$ Output: identified closed-form solution $\hat{u}^*$ that best satisfies the physical constraints 1: Initialize RNN with parameters $\theta$ 2: Randomly sample the domain to build the dataset $\mathcal{D} = \{\mathbf{x}_f^i\}_{i=1}^{N_{\mathcal{F}}} \cup \{\mathbf{x}_b^i, u_b^i\}_{i=1}^{N_{\mathcal{B}}} \cup \{\mathbf{x}_0^i, u_0^i\}_{i=1}^{N_{\mathcal{I}}}$ 3: for $i \gets 1$ to $M$ do 4: for $j \gets 1$ to $N$ do 5: $\hat{u}_j \gets \text{SampleSkeleton}(\theta)$ 6: $(\mathcal{L}_{s-t}')_j \gets \text{BConstraintsCalc}(\hat{u}_j, \mathcal{D})$ 7: $\hat{u}_j' \gets \text{BFGS}(\hat{u}_j, \mathcal{D}, (\mathcal{L}_{s-t}')_j)$ 8: $\tilde{R}(\hat{u}_j') \gets \text{RewardCalc}(\hat{u}_j')$ 9: end for 10: $\tilde{\mathcal{R}} \gets \{\tilde{R}(\hat{u}_j')\}_{j=1}^N$ 11: $\tilde{R}_{\epsilon} \gets (1 - \epsilon)$ -quantile of $\tilde{\mathcal{R}}$ 12: $\mathcal{U}: \{\hat{u}_q\} \gets \{\hat{u}_j': \tilde{R}(\hat{u}_j') \geq \tilde{R}_{\epsilon}\}$ 13: for $q \gets 1$ to $\epsilon \cdot N$ do 14: $(\mathcal{L}_{s-t})_q \gets \text{PrLoss}(\hat{u}_q, \mathcal{D})$ 15: $\hat{u}_q' \gets \text{BFGS}(\hat{u}_q, \mathcal{D}, (\mathcal{L}_{s-t})_q)$ 16: $R(\hat{u}_q') \gets \text{RewardCalc}(\hat{u}_q')$ 17: end for 18: $\mathcal{R} \gets \{R(\hat{u}_q')\}_{q=1}^{\epsilon*N}$ 19: $\hat{g}_1 \gets \text{ReduceMean}((\mathcal{R} - R_{\epsilon})\nabla_\theta \log p(\mathcal{U}|\theta))$ 20: $\hat{g}_2 \gets \text{ReduceMean}(\lambda_{\mathcal{H}}\nabla_\theta \mathcal{H}(\mathcal{U}|\theta))$ 21: $\theta \gets \theta + \eta(\hat{g}_1 + \hat{g}_2)$ 22: if max $\mathcal{R} > R(\hat{u}^*)$ then 23: $\hat{u}^* \gets \hat{u}^{\arg\max\mathcal{R}}$ 24: end if 25: end for
<table><tr><td colspan="2">Algorithm 2 Sampling a closed-form solution's skeleton from the RNN</td></tr><tr><td colspan="2">Input: RNN with parameters θ; tokens library L</td></tr><tr><td colspan="2">Output: The closed-form solution's skeleton u from the RNN</td></tr><tr><td>1: τ← []</td><td>▷ Initialize empty pre-order traversal of skeleton</td></tr><tr><td>2: counter← 1</td><td>▷ Initialize counter for number of unselected nodes</td></tr><tr><td>3: x← empty||empty</td><td>▷ Initial RNN input is empty parent and sibling</td></tr><tr><td>4: C0← 0</td><td>▷ Initialize RNN cell state to zero</td></tr><tr><td>5: i← 1</td><td></td></tr><tr><td>6: while counter ≠ 0 do</td><td></td></tr><tr><td>7: (ψi, ci)← RNN(x, C_i-1; θ)</td><td>▷ Emit probabilities; update state</td></tr><tr><td>8: ψi← ApplyConstraints(ψi, L, τ)</td><td>▷ Adjust probabilities</td></tr><tr><td>9: τi← Categorical(ψi)</td><td>▷ Sample next token</td></tr><tr><td>10: τ← τ||τi</td><td>▷ Append token to traversal</td></tr><tr><td>11: counter← counter + Arity(τi) - 1</td><td>▷ Update number of unselected nodes</td></tr><tr><td>12: x← ParentSibling(τ)</td><td>▷ Compute next parent and sibling</td></tr><tr><td>13: i← i+1</td><td></td></tr><tr><td>14: end while</td><td></td></tr><tr><td>15: u← τ</td><td>▷ Assemble the pre-order traversal τ into an expression skeleton</td></tr><tr><td>16: return u</td><td></td></tr><tr><td colspan="2">Algorithm 3 Recursive Exploration based on single-dimensional SSDE</td></tr><tr><td colspan="2">Input: Differential equation F; deterministic conditions (boundary conditions B, initial conditions I).</td></tr><tr><td colspan="2">Parameter: Number of variables in differential equations d.</td></tr><tr><td colspan="2">Output: Identified closed-form solution u* that best satisfies the physical constraints.</td></tr><tr><td colspan="2">1: Randomly sample the domain to build the dataset D = {xf}Nτi=1 ∪ {xb, ui}Ns i=1 ∪ {xi, u}i=1</td></tr><tr><td colspan="2">2: Treat the solution as a parameter α0, initialize α0 with B, I</td></tr><tr><td>3: τ(0)(x0; α0)← α0</td><td>▷ Initialize empty regressed expression's traversal with α0</td></tr><tr><td>4: |α0|← 1</td><td>▷ Initialize number of parameters of τ(0) as 1</td></tr><tr><td>5: τ← τ(0)(x0; α0)</td><td>▷ Initialize pre-order traversal of regressed skeleton with τ(0)</td></tr><tr><td>6: for k← 1 to d do</td><td></td></tr><tr><td>7: τ(k)(xk; αk)← []</td><td></td></tr><tr><td>8: for m← 1 to |ak-1| do</td><td></td></tr><tr><td>9: τk(m)(xk; αk)← SingleDimSSDE(D, αk-1[m], k)</td><td>▷ Seek parametric expressions for each αd-1</td></tr><tr><td>10: τk(xk; αk)← τk(xk; αk)||τk(m)(xk; αk)</td><td>▷ Append new parametric expression of kth variable</td></tr><tr><td>11: end for</td><td></td></tr><tr><td>12: τ← ReplaceParameters(τ(x0:k-1; αk-k-1), τk)</td><td>▷ Replace parameters in τ with new sub-expressions discovered for the kth variable</td></tr><tr><td>13: if k ≠ d then</td><td></td></tr><tr><td>14: L(s-t)← PartialConstraintsCalc(τ(x0:k; αk), D)</td><td>▷ Calculate constraints across the regressed dimensions</td></tr><tr><td>15: τ← BFGS(τ, D, L(s-t))</td><td>▷ Optimize parameters and constants in the skeleton with BFGS</td></tr><tr><td>16: else</td><td></td></tr><tr><td>17: L(s-t)← PhysicalConstraintsCalc(τ(x0:d), D)</td><td>▷ Calculate the physics-regularized loss</td></tr><tr><td>18: τ*← BFGS(τ, D, L(s-t))</td><td>▷ Optimize constants in the skeleton with BFGS</td></tr><tr><td>19: end if</td><td></td></tr><tr><td>20: end for</td><td></td></tr><tr><td>21: u*← τ*</td><td>▷ Assemble the pre-order traversal τ into an expression skeleton</td></tr><tr><td>22: return u*</td><td></td></tr></table>
single parameter $\alpha_0$ , dependent on all variables $\mathbf{x}_{1:d}$ . We formally denote this as a trivial traversal $\hat{\tau}^{(0)}(x_0,\alpha_0)$ , where $x_0$ is merely a placeholder without practical meaning, simplifying to $\hat{\tau}^{(0)} = \alpha_0$ . At each subsequent iteration $k$ , Alg. 5 generates single-dimensional traversals $\tilde{\tau}_k(x_k;\vec{\alpha}_k)$ for parameters $\vec{\alpha}_{k - 1}$ identified in the previous step. Alg. 4 then substitutes the previous parameters $\vec{\alpha}_{k - 1}$ within the current traversal $\hat{\tau}$ with these newly obtained expressions, producing the updated
Algorithm 4 Replace parameters in regressed skeleton with $k$ th variable's traversals Input: Regressed skeleton $\hat{\tau} (\mathbf{x}_{0:k - 1};\vec{\alpha}_{k - 1})$ ; new identified traversals $\tilde{\tau}_k$ of $k$ -th variable . Output: New traversal $\tau$ of symbolic skeleton of $k$ variables. 1: $\tau = []$ ▷ Initialize empty traversal of $k$ variables 2: for $i\gets 1$ to $|\hat{\tau} (\mathbf{x}_{0:k - 1};\vec{\alpha}_{k - 1})|$ do 3: for $m\gets 1$ to $|\vec{\alpha}_{k - 1}|$ do 4: if $\hat{\tau} [i] = \vec{\alpha}_{k - 1}^{m}$ then 5: $\tau \leftarrow \tau ||\tilde{\tau}_k[m]$ ▷ Replace parameter $\vec{\alpha}_{k - 1}^{m}$ with the corresponding traversal of the kth variable 6: else 7: $\tau \leftarrow \tau ||\hat{\tau}[i]$ ▷ Append regressed traversal 8: end if 9: end for 10: end for 11: return $\tau$
traversal $\tau$ involving $d$ variables. To mitigate error propagation during the recursion, constants in the traversal $\tau$ are refined by minimizing $\mathcal{L}_{\mathrm{s - t}}^{(k)}$ , which incorporates partial physical constraints. At the final iteration $(k = d)$ , when the traversal involves the last variable $x_{d}$ without further parameters, we optimize the traversal $\tau$ against the complete physical constraints $\mathcal{L}_{\mathrm{s - t}}$ , thereby obtaining the final precise symbolic expression.
The underlying principle of Alg. 5 closely parallels that of Alg. 1, yet specifically targets discovering symbolic traversals corresponding to single-dimensional variable skeletons. Here, we employ an RNN to generate candidate traversals $[\tilde{\tau}_k]_j$ associated with the $k$ -th variable during each training batch. Each constant token (c) within these traversals is represented as a vector $[\vec{p_k}]_j$ of dimensionality $|cdim|$ . Initially, the vectors are optimized by minimizing deterministic constraints sampled from boundary $(\mathcal{B})$ and initial conditions $(\mathcal{I})$ .
We denote the $h$ -th $\mathbb{C}$ token within traversal $[\tilde{\tau}_k]_j$ as $[\vec{p_k} ]_j^h$ , thus $|c\mathrm{dim}| = |[\vec{p_k} ]_j^h |$ . If the variance of a given vector $[\vec{p_k} ]_j^h$ falls below a predefined threshold $\delta$ , it is treated as a constant; otherwise, it remains as a parameter. The parameters retained in $[\vec{p_k} ]_j$ subsequently become new parameters for traversal $[\tilde{\tau}_k]_j$ . As in Alg. 1, we utilize the RSCO strategy to select the top- $\epsilon$ traversals within the batch, computing rewards accordingly. Finally, the RNN parameters are updated using risk-seeking policy gradients augmented by entropy regularization.
As an illustrative example, consider discovering the closed-form solution:
$$u = 2. 5 x _ {1} ^ {4} - 1. 3 x _ {2} ^ {3} + 0. 5 x _ {3} ^ {2}$$
Initially, we represent the symbolic solution simply as $\hat{u} = \alpha_0$ . The expression skeleton corresponding to the first variable $x_{1}$ is identified using Alg. 5, yielding a parametric traversal:
$$\tilde {u} (x _ {1}; \vec {\alpha} _ {1}) = c _ {1} x _ {1} ^ {4} + \alpha_ {1}$$
where the parameter $\alpha_{1}$ depends on subsequent variables $x_{2}$ and $x_{3}$ . Next, Alg. 5 identifies the skeleton for the second variable $x_{2}$ :
$$\alpha_ {1} (x _ {2}; \vec {\alpha} _ {2}) = c _ {1} x _ {2} ^ {3} + \alpha_ {2}$$
Using Alg. 4, we combine the skeletons derived from the first two dimensions to form the intermediate traversal:
$$\hat {u} = c _ {1} x _ {1} ^ {4} + c _ {2} x _ {2} ^ {3} + \alpha_ {2}$$
where $\alpha_{2}$ remains dependent on $x_{3}$ . Subsequently, the traversal for the final variable $x_{3}$ is obtained as
$$\alpha_ {2} (x _ {3}) = c _ {1} x _ {3} ^ {2}$$
Combining all traversals results in the complete symbolic expression
$$\hat {u} = c _ {1} x _ {1} ^ {4} + c _ {2} x _ {1} ^ {3} + c _ {3} x _ {2} ^ {2}$$
Finally, optimizing the constants $c_{1}, c_{2}, c_{3}$ against the full set of physical constraints precisely recovers the exact closed-form solution.
Algorithm 5 Single-dimensional SSDE Input: Differential equation $\mathcal{F}$ ; deterministic conditions (boundary conditions $\mathcal{B}$ , initial conditions $\mathcal{I}$ ); the $m$ th last regressed variable's parameter $\vec{\alpha}_{d-1}[m]$ ; the order $d$ th of the variable currently in focus Parameter: RNN learning rate $\eta$ ; entropy coefficient $\lambda_{\mathcal{H}}$ ; risk factor $\epsilon$ ; batch size $N$ ; sample epochs $M$ ; reward function $R$ ; early stop threshold $R_t$ ; constant judgement threshold $\delta$ Output: Pre-order traversal $\tilde{\tau}_k^*$ of the parametric expression of $k$ -th variable that best satisfies the physical constraints 1: Randomly sample the domain to build the dataset $\mathcal{D} = \{\mathbf{x}_f^i\}_{i=1}^{N_{\mathcal{F}}} \cup \{\mathbf{x}_b^i, u_b^i\}_{i=1}^{N_{\mathcal{B}}} \cup \{\mathbf{x}_0^i, u_0^i\}_{i=1}^{N_{\mathcal{I}}}$ 2: Initialize generator RNN with parameters $\theta$ 3: for $i \gets 1$ to $M$ do 4: for $j \gets 1$ to $N$ do 5: $[\tilde{\tau}_k]_j \gets \text{SampleSkeleton}(\theta)$ 6: $[\tilde{\mathcal{L}}_{s-t}]_j^k \gets \text{SingleDimBConstraints}([\tilde{\tau}_k]_j, \mathcal{D}, \vec{\alpha}_{k-1}[m])$ 7: $[\tilde{\tau}_k]_j'(x_k, [\vec{p}_k]_j) \gets \text{BFGS}([\tilde{\tau}_k]_j, \mathcal{D}, \vec{\alpha}_{k-1}[m], [\tilde{\mathcal{L}}_{s-t}]_j^k)$ 8: for $h \gets 1$ to $|[[\vec{p}_k]_j|$ do 9: if variance $([\vec{p}_k]_j^h) < \delta$ then 10: $[\vec{p}_k]_j^h \gets \text{average}([\vec{p}_k]_j^h)$ 11: end if 12: end for 13: $\vec{\alpha}_k \gets \{[\vec{p}_k]_j | [\vec{p}_k]_j^h$ is not const.} 14: $\tilde{R}([\tilde{\tau}_k]_j') \gets \text{RewardCalc}([\tilde{\tau}_k]_j')$ 15: end for 16: $\tilde{\mathcal{R}} \gets \{\tilde{R}([\tilde{\tau}_k]_j')\}_{j=1}^N$ 17: $\tilde{R}_e \gets (1 - \epsilon)$ -quantile of $\tilde{\mathcal{R}}$ 18: $\mathcal{T}: [\tilde{\tau}_k]_q \} \gets \{[\tilde{\tau}_k]_j': \tilde{R}([\tilde{\tau}_k]_j') \geq \tilde{R}_e\}$ 19: for $q \gets 1$ to $\epsilon \cdot N$ do 20: $[\tilde{\mathcal{L}}_{s-t}]_q^k \gets \text{SingleDimPhysicalConstraints}([\tilde{\tau}_k]_q, \mathcal{D}, \vec{\alpha}_{k-1}[m])$ 21: $[\tilde{\tau}_k]_q'(x_k, [\vec{p}_k]_q) \gets \text{BFGS}([\tilde{\tau}_k]_q, \mathcal{D}, \vec{\alpha}_{k-1}[m], [\tilde{\mathcal{L}}_{s-t}]_q^k)$ 22: for $h \gets 1$ to $|[[\vec{p}_k]_q|$ do 23: if variance $([\vec{p}_k]_q^h) < \delta$ then 24: $[\vec{p}_k]_q^h \gets \text{average}([\vec{p}_k]_q^h)$ 25: end if 26: end for 27: $\vec{\alpha}_k \gets \{[\vec{p}_k]_q | [\vec{p}_k]_q$ is not const.} 28: $R([\tilde{\tau}_k]_q') \gets \text{RewardCalc}([\tilde{\tau}_k]_q')$ 29: end for 30: $\mathcal{R} \gets \{R([\tilde{\tau}_k]_q')\}_{k=1}^{\epsilon*N}$ 31: $\hat{g}_1 \gets \text{ReduceMean}((\mathcal{R} - R_\epsilon) \nabla_\theta \log p(\mathcal{T}|\theta))$ 32: $\hat{g}_2 \gets \text{ReduceMean}(\lambda_{\mathcal{H}} \nabla_\theta \mathcal{H}(\mathcal{U}|\theta))$ 33: $\theta \gets \theta + \eta(\hat{g}_1 + \hat{g}_2)$ 34: if max $\mathcal{R} > R([\tilde{\tau}_k]^*)$ then 35: $[\tilde{\tau}_k]^* \gets [\tilde{\tau}_k]^{\text{arg max } R}$ 36: end if 37: end for
# B. Computing Infrastructure and Hyperparameter Settings
In this section, we provide additional experimental details, including the computing infrastructure and the specific hyperparameter configurations for SSDE.
Computing infrastructure All experiments reported in this work were conducted on an Intel(R) Xeon(R) Gold 6138 CPU @ $2.00\mathrm{GHz}$ . The algorithm implementation can also leverage GPU acceleration for improved computational efficiency.
Table 5. Hyperparameters for SSDE.
<table><tr><td>HYPERPARAMETER</td><td>SYMBOL</td><td>VALUE</td></tr><tr><td>LEARNING RATE</td><td>η</td><td>0.0010</td></tr><tr><td>ENTROPY WEIGHT</td><td>λH</td><td>0.07</td></tr><tr><td>ENTROPY GAMMA</td><td>γ</td><td>0.7</td></tr><tr><td>RNN CELL SIZE</td><td>-</td><td>32</td></tr><tr><td>RNN CELL LAYERS</td><td>-</td><td>1</td></tr><tr><td>RISK FACTOR</td><td>ε</td><td>0.05</td></tr><tr><td>MAX EPOCH</td><td>M</td><td>200</td></tr><tr><td>BATCH SIZE</td><td>N</td><td>1000</td></tr><tr><td>PDE CONSTRAINT WEIGHT</td><td>λ0</td><td>1</td></tr><tr><td>BC CONSTRAINT WEIGHT</td><td>λ1</td><td>1</td></tr><tr><td>IC CONSTRAINT WEIGHT</td><td>λ2</td><td>1</td></tr></table>
Table 6. Convergent relative ${\mathcal{L}}_{2}$ error of baselines on high-dimensional dataset
<table><tr><td>NAME</td><td>SSDE</td><td>MATHEMATICA</td><td>PR-GPSR</td><td>KAN</td><td>FEX</td><td>DSR</td><td>PINN</td></tr><tr><td>POISSON2D</td><td>1.55E-05</td><td>X</td><td>1.49E-02</td><td>3.24E+00</td><td>2.00E-02</td><td>9.85E-02</td><td>6.24E-04</td></tr><tr><td>POISSON3D</td><td>3.58E-06</td><td>X</td><td>2.01E-02</td><td>2.57E+00</td><td>9.13E-02</td><td>2.15E-01</td><td>3.93E-03</td></tr><tr><td>HEAT2D</td><td>4.45E-06</td><td>X</td><td>4.57E-02</td><td>6.54E+00</td><td>4.70E-02</td><td>2.19E-01</td><td>6.98E-03</td></tr><tr><td>HEAT3D</td><td>9.34E-06</td><td>X</td><td>1.39E+00</td><td>5.58E+00</td><td>3.63E-01</td><td>3.20E-01</td><td>1.15E-02</td></tr><tr><td>WAVE2D</td><td>3.11E-05</td><td>X</td><td>1.80E-01</td><td>1.18E+00</td><td>2.34E-01</td><td>7.40E-02</td><td>1.34E-02</td></tr><tr><td>WAVE3D</td><td>7.62E-06</td><td>X</td><td>4.56E-01</td><td>7.26E+00</td><td>3.97E-01</td><td>1.95E+00</td><td>3.69E-02</td></tr></table>
Hyperparameter settings The hyperparameters of our method mainly include the hyperparameters for the reinforcement learning policy gradient optimization, and weighting coefficients of the physical constraints defined in the loss function $\mathcal{L}_{\mathrm{s - t}}$
$$\mathcal {L} _ {\mathrm {s - t}} = \lambda_ {0} \mathrm {M S E} _ {\mathcal {G}} + \lambda_ {1} \mathrm {M S E} _ {\mathcal {B}} + \lambda_ {2} \mathrm {M S E} _ {\mathcal {I}} \tag {11}$$
For the policy optimizer, we considered the following hyperparameter search spaces: learning rate $\in$ $\{0.0001, 0.0005, 0.0010\}$ , entropy weight $\lambda_{\mathcal{H}} \in \{0.04, 0.07, 0.10\}$ , and hierarchical entropy's coefficient $\gamma \in \{0.5, 0.7, 0.9\}$ . Hyperparameter tuning was performed via grid search on benchmark problems $\Gamma_5$ and $\Gamma_{10}$ from the $\Gamma$ dataset, and the best hyperparameters were selected by minimizing the average $\mathcal{L}_{PHY}$ . The optimal hyperparameters identified through this tuning process are summarized in Table 5, and these configurations were consistently used across all benchmark experiments.
# C. Additional Experiments and Results
# C.1. Experiments with Additional Baselines
To facilitate fair comparison across different methods, we adopt the relative $\mathcal{L}_2$ error (defined by Eq. (12)) as a unified evaluation metric in our supplementary experiments.
$$\text {M e a n R e l a t i v e} L _ {2} \text {L o s s} = \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\left\| \mathbf {y} _ {\text {t r u e} , i} - \mathbf {y} _ {\text {p r e d} , i} \right\| _ {2}}{\left\| \mathbf {y} _ {\text {t r u e} , i} \right\| _ {2}} \tag {12}$$
In the main text, we compare SSDE with the baseline method PINN+DSR, which performs symbolic regression on numerical solutions of differential equations. Additionally, we evaluate both methods on a suite of PDE benchmarks. To further enrich the comparison, we introduce two additional baselines. The first is Mathematica (Wolfram Research, Inc., 2024), a commercial software capable of computing analytical solutions to differential equations. The second is FEX (Liang & Yang, 2022), a reinforcement learning-based framework for solving differential equations. Detailed descriptions of these two baselines are provided in Appendix D. Table 6 summarizes the performance of all methods across the PDE benchmarks. SSDE consistently identifies correct closed-form solutions and outperforms all baseline methods in terms of accuracy.

 Figure 3. Ablation study on RSCO efficiency (results averaged over 20 benchmark runs) (a) Time efficiency comparison: RSCO achieves $4.65 \times$ speedup ( $\mu = 934\mathrm{s}$ vs. $200\mathrm{s}$ ) in solution discovery time. (b) Search space comparison: While requiring $22\%$ more expression evaluations, RSCO maintains superior time efficiency.
# C.2. Complexity Analysis
We conduct a complexity analysis to address two research questions (RQs):
RQ1 Does the proposed risk-seeking constant optimization (RSCO) algorithm accelerate the discovery of closed-form solutions?
RQ2 How does the size of the symbolic library affect the computational complexity of the algorithm?
To answer RQ1, we perform 20 independent trials on each of the $\Gamma_{1} - \Gamma_{8}$ benchmarks, comparing the average convergence time and number of iterations required with and without RSCO. As shown in Figure 3, RSCO consistently reduces the total solving time across all benchmarks, despite only marginally improving the average number of iterations. Interestingly, under the same random seed, RSCO sometimes achieves convergence in fewer iterations, highlighting the benefit of prioritizing boundary condition satisfaction early in the optimization process.
To investigate RQ2, we evaluate the impact of symbolic library size on solving complexity using the $\Gamma_1 - \Gamma_4$ benchmarks. As shown in Figure 4, we start with a minimal operator set $+, -, \times, \div$ and progressively expand it by adding transcendental functions such as $\sin$ , $\cos$ , $\exp$ , and $\log$ . We observe that enlarging the symbolic library significantly increases the average time and number of iterations required to recover the correct solution. Moreover, the addition of higher-order operators like $\exp$ introduces a much larger increase in complexity than trigonometric functions. This is likely due to the presence of high-order polynomial terms in the target solutions, which can be easily confused with exponential or logarithmic expressions during symbolic search, especially given the close derivative relationships among $e^x$ , $\ln x$ , and certain polynomial approximations.

 Figure 4. Computational complexity scaling with library size. Average (a) time and (b) explored expression count for SSDE in $\Gamma 1-4$ experiments across 20 independent runs.
# D. Details of Baselines Algorithms
In this section, we introduce the mainstream methods used for identifying the closed-form symbolic solution to high-dimensional PDEs.
Kolmogorov-Arnold Networks (KAN) A newly proposed method designed to replace Multi-Layer Perceptrons(MLP) incorporates capabilities for automatic symbolic regression(Liu et al., 2025). Compared with MLP, it performs better on symbolic formula representation tasks(Yu et al., 2024) and is promising for discovering closed-form solutions to HD-PDEs. Moreover, compared to EQL((Sahoo et al., 2018)), which is a fully-connected work where elementary functions are used as activation functions, this method does not require additional sparsification for symbolic regression and only requires a small number of nodes to complete the task of fitting the data. In this work, we use the open-source code and implementation provided by the authors<sup>1</sup>. The open source code has been implemented for the 2D Poisson's equation merely. We have also implemented the algorithm for the 3D Poisson's equation, 2D and 3D heat equations based on the open source code. It is imperative to note that due to the automatic symbolic regression process, expressions involving basic operations such as addition, subtraction, multiplication, and division can be directly derived from KAN's network structure. Therefore, the symbol library used in the KAN method for automatic regression does not include these operators. Additionally, $\cos$ token can also be directly obtained from sin by adding a bias (i.e., $\sin(x + \frac{\pi}{2}) = \cos(x)$ ), therefore, the $\cos$ token is also absent from the symbol library. To ensure a fair comparison, apart from the symbol library employed in our algorithm, we also introduced $\{\circ^2, \circ^3, \circ^4\}$ as additional symbols for use in the KAN method. In addition, we utilized the same hyperparameters and network architecture settings as those employed in the KAN repository's source code on partial differential equations.
Physics-regularized Genetic Programming Based Symbolic Regression(PR-GPSR) PR-GPSR((Oh et al., 2023)) is a physics-regularized genetic programming(GP) based symbolic regression method for analytical solutions to differential equations. They use the mean-squared error with physical constraints as the fitness of population to measure how well
the found expression $\hat{u}$ satisfies the differential equations. In this work, we use the open-source code and implementation provided by the authors<sup>2</sup>. The open source code has been implemented for the 2D Poisson's equation. We have also implemented the PR-GPSR algorithm for the 3D Poisson's equation, 2D and 3D heat equations based on the open source code. To ensure fair comparison, we use the hyperparameters settings reported in the original paper. In addition, we use the same symbol library as our algorithm and add the CONST token to give it the ability to generate constants.
PINN+DSR To demonstrate that SSDE has better solution accuracy than the natural paradigm of directly applying symbolic regression algorithms to numerical solutions, we designed this baseline. It consists of two parts: the PINN algorithm and the DSR algorithm. The PINN algorithm is used to generate numerical solutions for each equation in the $\Gamma$ dataset, and the DSR algorithm directly regresses the corresponding symbolic expressions based on the numerical solutions. The following will introduce these two algorithms and their implementation in detail.
Physics-Informed Neural Network (PINN) A neural network method proposed by (Raissi et al., 2019), which is widely used to solve the partial differential equations numerically. PINN directly uses a fully connected neural network to approximate the solution function of the partial differential equation. Its numerical solution has high accuracy when solving low-dimensional PDEs with uncomplicated computational domains and boundary conditions. In this work, we use the open-source code and implementation by DeepXDE $^3$ (Lu et al., 2021b). To ensure fair and effective comparison, we train the network with PDEs and deterministic conditions defined in $\Gamma$ dataset until the network convergent. And sample the points in the computational domain identically to our approach used for subsequent symbolic regression. The convergent mean relative $\mathcal{L}_2$ error on the $\Gamma$ dataset is shown in Table 7.
Deep Symbolic Regression (DSR) DSR((Petersen et al., 2020)) is a symbolic regression method based on reinforcement learning. The risk-seeking policy gradient is used to guide the RNN to generate the symbolic expressions corresponding to the given observational data. In this work, we use the open-source code and implementation provided by the authors<sup>4</sup>. To ensure fair comparison, we use the same library as our algorithm and add the CONST token to give it the ability to generate constants. In addition, we used the hyperparameter combination reported in table 5 for the policy optimizer.
Finite Expression Method (FEX) FEX is a reinforcement learning-based method for solving high-dimensional partial differential equations by discovering solutions expressed as finite mathematical expressions (Liang & Yang, 2022). Instead of parameterizing the solution with neural networks, FEX formulates the PDE-solving process as a combinatorial optimization problem over the space of mathematical expressions, represented as binary trees with both discrete operators and continuous parameters. While FEX is theoretically designed to recover compact, interpretable expressions that approximate the true solution, in practice, its symbolic structures are often coarse approximations, and the accuracy is largely achieved by tuning the continuous parameters. As a result, the discovered expressions tend to resemble parameterized symbolic networks, wherein most of the fitting power comes from weight optimization rather than symbolic structure. This compromises interpretability and makes it difficult to recover exact closed-form solutions, especially when the symbolic search fails to capture the core structure of the ground truth. Nonetheless, FEX still presents a promising approach for symbolic approximation of PDEs with lower memory cost and offers partial interpretability compared to black-box neural solvers. In this work, we use the official open-source implementation of FEX provided by the authors<sup>5</sup>. The repository includes support for 2D and 3D Poisson equations. To enable fair and comprehensive comparison, we further extend the implementation to support 2D and 3D heat equations and wave equations.
Mathematica Mathematica is a commercial symbolic computation software developed by Wolfram Research, widely used for solving mathematical problems involving algebraic manipulation, symbolic integration, and differential equations. It provides a built-in solver for obtaining analytical solutions to a wide range of ordinary and partial differential equations, leveraging rule-based rewriting systems and symbolic inference engines. In contrast to data-driven approaches, Mathematica relies on curated mathematical knowledge and a comprehensive symbolic engine to derive closed-form solutions. However, Mathematica's performance is strongly tied to the internal heuristics and rule libraries it employs, which are generally optimized for classical PDEs with known solution templates. For high-dimensional PDEs, equations with nonstandard
Table 7. Convergent mean relative ${\mathcal{L}}_{2}$ error of PINN on $\Gamma$ dataset
<table><tr><td>NAME</td><td>EPOCH</td><td>MEAN RELATIVE L2 ERROR</td></tr><tr><td>Γ1</td><td>30000</td><td>2.25E-05</td></tr><tr><td>Γ2</td><td>30000</td><td>6.32E-06</td></tr><tr><td>Γ3</td><td>30000</td><td>7.04E-05</td></tr><tr><td>Γ4</td><td>30000</td><td>5.28E-05</td></tr><tr><td>Γ5</td><td>30000</td><td>2.57E-05</td></tr><tr><td>Γ6</td><td>30000</td><td>2.14E-05</td></tr><tr><td>Γ7</td><td>30000</td><td>1.08E-05</td></tr><tr><td>Γ8</td><td>30000</td><td>1.05E-05</td></tr><tr><td>Γ9</td><td>50000</td><td>2.59E-03</td></tr><tr><td>Γ10</td><td>50000</td><td>5.91E-04</td></tr><tr><td>Γ11</td><td>50000</td><td>3.61E-04</td></tr><tr><td>Γ12</td><td>50000</td><td>2.88E-03</td></tr></table>
Table 8. Configuration of high-dimensional PDEs dataset.
<table><tr><td>NAME</td><td>DOMAIN</td><td>LIBRARY L*</td><td>GROUND TRUTH</td></tr><tr><td>POISSON2D</td><td>[−1,1]2</td><td>L0 ∪ {x2}</td><td>u(x) = 2.5x14 - 1.3x13 + 0.5x22 - 1.7x2</td></tr><tr><td>POISSON3D</td><td>[−1,1]3</td><td>L0 ∪ {x2,x3}</td><td>u(x) = 2.5x14 - 1.3x23 + 0.5x32</td></tr><tr><td>HEAT2D</td><td>[0,1] × [−1,1]2</td><td>L0 ∪ {x2,t}</td><td>u(x,t) = 2.5x14 - 1.3x23 + 0.5t2</td></tr><tr><td>HEAT3D</td><td>[0,1] × [−1,1]3</td><td>L0 ∪ {x2,x3,t}</td><td>u(x,t) = 2.5x14 - 1.3x23 + 0.5x32 - 1.7t</td></tr><tr><td>WAVE2D</td><td>[0,1] × [−1,1]2</td><td>L0 ∪ {x2,t}</td><td>u(x,t) = exp(x12) sin(x2)e-0.5t</td></tr><tr><td>WAVE3D</td><td>[0,1] × [−1,1]3</td><td>L0 ∪ {x2,x3,t}</td><td>u(x,t) = exp(x12 + x32) cos(x2)e-0.5t</td></tr></table>
* Owing to the structure of the KAN network, the symbol library employed in the KAN baseline encompasses variables and constants, as well as the operators $\{\circ^2, \circ^3, \circ^4$ , sin, log, exp\}.
boundary conditions, or synthetic benchmarks designed outside its built-in library scope, Mathematica often fails to return exact symbolic solutions or may produce no result at all. In this work, we use Mathematica (Version 14.2) as a baseline to assess its symbolic solving capabilities on our PDE benchmarks.
# E. Details of Datasets
# E.1. Dataset on High-dimensional PDEs
Despite the availability of existing datasets for validating numerical PDE solvers based on deep learning methods (Takamoto et al., 2022), these datasets typically do not provide explicitly defined symbolic solutions. Consequently, evaluating symbolic-solution discovery algorithms on such datasets is not only computationally expensive and inefficient but also does not guarantee the correctness or interpretability of the resulting symbolic expressions.
To comprehensively assess the effectiveness of our algorithm in discovering diverse symbolic solutions, we constructed a new benchmark dataset consisting of various types of differential equations (DEs). This dataset enables rigorous performance evaluation of our proposed method and other state-of-the-art symbolic-solution discovery algorithms. Specifically, each benchmark example (see Table 8) includes the differential equation itself, the computational domain, associated boundary conditions, and a symbol library defining permissible functional forms. For clarity and brevity, we define symbol libraries relative to a base library $\mathcal{L}_0$ , given by $\mathcal{L}_0 = \{+, -, \times, \div, \sin, \cos, \exp, \log, x_1, \text{const.}\}$ . The notation $[-1,1]^d$ denotes a spatial domain represented by a $d$ -dimensional hypercube, while the notation $[0,1] \times [-1,1]^d$ explicitly differentiates between the temporal domain (the first interval) and the spatial domain (the second interval). The benchmark differential equations encompass a range of scenarios, including both stationary and spatiotemporal dynamics, as well as linear and nonlinear PDEs, thereby providing comprehensive coverage for validating symbolic solution discovery methods.
Table 9. Configuration of $\Gamma$ dataset on Poisson's Equation
<table><tr><td>NAME</td><td>DOMAIN</td><td>LIBRARY L</td><td>GROUND TRUTH</td></tr><tr><td>Γ1</td><td>[-1,1]</td><td>L0</td><td>u(x) = x13 + x12 + x1</td></tr><tr><td>Γ2</td><td>[-1,1]</td><td>L0</td><td>u(x) = x14 + x13 + x12 + x1</td></tr><tr><td>Γ3</td><td>[-1,1]</td><td>L0</td><td>u(x) = x15 + x14 + x13 + x12 + x1</td></tr><tr><td>Γ4</td><td>[-1,1]</td><td>L0</td><td>u(x) = x16 + x15 + x14 + x13 + x12 + x1</td></tr><tr><td>Γ5</td><td>[-1,1]</td><td>L0</td><td>u(x) = sin(x12) cos(x1) - 1</td></tr><tr><td>Γ6</td><td>[-1,1]</td><td>L0</td><td>u(x) = sin(x1) + sin(x1 + x12)</td></tr><tr><td>Γ7</td><td>[0.5,1.5]</td><td>L0</td><td>u(x) = log(x1 + 1) + log(x12 + 1)</td></tr><tr><td>Γ8</td><td>[0.5,1.5]</td><td>L0</td><td>u(x) = √x1</td></tr><tr><td>Γ9</td><td>[0.5,1.5]2</td><td>L0 ∪ {x2}</td><td>u(x) = sin(x1) + sin(x22)</td></tr><tr><td>Γ10</td><td>[0.5,1.5]2</td><td>L0 ∪ {x2}</td><td>u(x) = 2 sin(x1) cos(x2)</td></tr><tr><td>Γ11</td><td>[0.5,1.5]2</td><td>L0 ∪ {x2}</td><td>u(x) = x1x2</td></tr><tr><td>Γ12</td><td>[-1,1]2</td><td>L0 ∪ {x2}</td><td>u(x) = x14 - x13 + 1/2 x2 - x2</td></tr></table>
# E.2. Benchmarks on Poisson's Equation
To compare SSDE with methods that apply symbolic regression (SR) directly to numerical solutions of differential equations, we constructed a dataset inspired by the symbolic regression task in the Nguyen benchmark (Uy et al., 2011). Specifically, we selected 12 target expressions from the Nguyen benchmark and used them as closed-form solutions to derive corresponding Poisson equations. The complete configuration of this dataset is summarized in Table 9. It is worth noting that expressions involving only a single variable result in ordinary differential equations (ODEs), while those involving two variables give rise to partial differential equations (PDEs). This setup allows us to evaluate the performance of SSDE and other baselines on both ODE and PDE settings in a controlled, ground-truth-aware environment. Leveraging its recursive exploration strategy, SSDE successfully recovers the Nguyen-12 expressions as exact closed-form solutions, whereas conventional symbolic regression methods like DSR (Petersen et al., 2020) and DSO (Mundhenk et al., 2021) are unable to fully reconstruct the target forms.
# F. Details of Experimental Results
SSDE successfully recovered the symbolic solutions for all tested partial differential equations, with the intermediate regressed expressions presented in Table 10. In contrast, the solutions obtained by PINN+DSR often omitted essential variables. We hypothesize that DSR's failure to identify correct solutions stems from two key limitations: (1) the increased dimensionality significantly expands the search space, making exploration more difficult; and (2) the policy gradients corresponding to different variables may interfere with each other during training, hindering convergence to the correct expression. Although the KAN method can approximate numerical solutions of PDEs with high accuracy through its network architecture, its symbolic regression capability remains limited. The resulting expressions tend to be dense and lack interpretability due to insufficient sparsity. In terms of efficiency, PR-GPSR performs poorly: in our experiments, it required approximately one day to complete 1500 generations. To ensure a fair comparison across methods, we capped the number of generations for PR-GPSR at 1500. Even within this limit, PR-GPSR consistently failed to recover the correct symbolic solutions across all benchmark equations.
Table 10. The stepwise regressed solutions of SSDE used to solve PDEs
<table><tr><td>STEP</td><td>POISSON2D</td><td>POISSON3D</td><td>HEAT2D</td><td>HEAT3D</td><td>WAVE2D</td><td>WAVE3D</td></tr><tr><td>STEP 1</td><td>x12(2.5000x12-1.3x1)+α1</td><td>2.5000x14+α1</td><td>0.5001t2+α1</td><td>α1-1.7000t-1</td><td>α1e-0.5002t</td><td>exp(-α1-0.4999t)</td></tr><tr><td>STEP 2</td><td>x12(2.5000x12-1.3x1)+0.4997x2(x2-1.4005)-x2</td><td>2.5000x14+0.6502α2-1.3003x23-1.6502x2</td><td>0.5001t2+log(exp(α2+2.4995x14))</td><td>α2-1.7000t+2.5000x14-1</td><td>α2cos(1)e-0.5002t</td><td>exp(α2+1.0010x12-0.4999t)</td></tr><tr><td>STEP 3</td><td>x12(2.5000x12-1.3x1)+0.4999x2(x2-1.4002)-x2</td><td>2.5000x14-1.3003x2+0.5000x32-0.0003</td><td>0.5001t2+log(exp(2.4995x14-x2(1.3000x2-0.0008))</td><td>α3-1.7000t+2.5000x14-1.3000x23-1</td><td>1.8508cos(1)sin(x2)e-0.5002t</td><td>exp(1.0010x12-0.4999t)·exp(α3+1.0010ln(cos(x2)))</td></tr><tr><td>STEP 4</td><td>-</td><td>2.5000x14-1.3000x23+0.4999x32+2.3763e-5</td><td>0.5000t2+log(exp(2.5000x14-x2(1.3000x2-8.1811e-7))))</td><td>0.4998x32-1.7000t+2.5000x14-1.3000x23-0.0006</td><td>1.0000sin(x2)e-0.5000t</td><td>exp(1.0010x12-0.4999t)·exp(x32+1.0010ln(cos(x2)))</td></tr><tr><td>STEP 5</td><td>-</td><td>-</td><td>-</td><td>-1.7003t+2.5000x14-1.3000x23+0.4999x32+0.0002</td><td>-</td><td>exp(x32+1.0001x12-0.5000t)·cos(x2)</td></tr></table>123version https://git-lfs.github.com/spec/v1oid sha256:be8668d994c47c7ff7849e3c371ff44da9f0841ce4451e064d204356f0ac7564size 1285613123version https://git-lfs.github.com/spec/v1oid sha256:7413ccdb1119d9b472c186949c3c55d5e2e4a615f4bdd94439b194d700c801b9size 805686123version https://git-lfs.github.com/spec/v1oid sha256:0cef600c5ba9d4b7152410fdbd067dbeaf55a62ec606036976783eb7c21701b5size 241645123version https://git-lfs.github.com/spec/v1oid sha256:e58a0048e7dd115a96c633a65fa4e8aa2c39900ff66444f09c76c043d74fd494size 285801123version https://git-lfs.github.com/spec/v1oid sha256:110e52037ee111612700ca7f32cac7c1190ee684fd6094c2aff69f4dbd21b628size 658357123version https://git-lfs.github.com/spec/v1oid sha256:c1e155a8969abe5a0364d52628bf7b0ec0e4db6081c9b9187c4c8b2d716f19f0size 1492205123version https://git-lfs.github.com/spec/v1oid sha256:6fd9ea868e3293884246b46db25eadab83846135786dc8f74880aa26b2231854size 1893477123version https://git-lfs.github.com/spec/v1oid sha256:07c587e391006e15ec6090b4ff3bae9e67eded6fc1cf8cba9ac9311ab28ff4e0size 153452123version https://git-lfs.github.com/spec/v1oid sha256:87078e2f8397851bbebd5a7ce81c5b33a4160bc8f12b24596a713743d716d06esize 177717123version https://git-lfs.github.com/spec/v1oid sha256:4bac6efce4f03e375906ccf80579ba5c2ac188b6cc5d5e04309aa26375c2ed6fsize 4386208123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640# Clustering Properties of Self-Supervised Learning
Xi Weng12
Jie Luo
Jianing An
Xi Yang
Xudong Ma
Jin Song Dong
Binhang Qi
Lei Huang 14
# Abstract
Self-supervised learning (SSL) methods via joint embedding architectures have proven remarkably effective at capturing semantically rich representations with strong clustering properties, magically in the absence of label supervision. Despite this, few of them have explored leveraging these untapped properties to improve themselves. In this paper, we provide an evidence through various metrics that the encoder's output encoding exhibits superior and more stable clustering properties compared to other components. Building on this insight, we propose a novel positive-feedback SSL method, termed Representation Self-Assignment (ReSA), which leverages the model's clustering properties to promote learning in a self-guided manner. Extensive experiments on standard SSL benchmarks reveal that models pretrained with ReSA outperform other state-of-the-art SSL methods by a significant margin. Finally, we analyze how ReSA facilitates better clustering properties, demonstrating that it effectively enhances clustering performance at both fine-grained and coarse-grained levels, shaping representations that are inherently more structured and semantically meaningful.
# 1. Introduction
Self-supervised learning (SSL) has emerged as a transformative paradigm in universal representation learning (Oord et al., 2018; Bachman et al., 2019; He et al., 2020; Chen et al., 2020a; Bao et al., 2021; Oquab et al., 2023; Assran et al., 2023), consistently surpassing supervised learning in downstream performance. Joint embedding architectures (JEA), in particular, aim to learn invariance of the same data
$^{1}$ SKLCCSE, School of Artificial Intelligence, Beihang University $^{2}$ School of Computing, National University of Singapore $^{3}$ Beijing Academy of Artificial Intelligence $^{4}$ Hangzhou International Innovation Institute, Beihang University. Correspondence to: Lei Huang <huangleiAI@buaa.edu.cn>. Our code is available at https://github.com/winci-ai/resa
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
 Figure 1. The positive-feedback SSL framework. It involves the model generating representations that possess semantically clustering information. This clustering information is leveraged to design self-supervised loss function, which is then employed to more effectively guide the model's learning process.
under different transformations and noise (Bachman et al., 2019; He et al., 2020; Chen et al., 2020a), with demonstrated exceptional effectiveness in visual representation learning. Although such a pretext task may intuitively seem unrelated to capturing semantic relationships, extensive studies (Caron et al., 2018; 2021; Assran et al., 2022b) have demonstrated the strong correlation between its learned representations and semantic information.
Ben-Shaul et al. (2023) take a further step to characterize the semantic structures learned by JEA into hierarchic clustering properties, indicating SSL-trained representations exhibit a centroid-like geometric structure and induce three levels of semantic clustering: augmentation sample level, semantic classes, and superclass level. This intriguing finding reveals that SSL methods based on JEA can facilitate strong clustering capabilities during training, but also raises the question of whether these properties hold untapped potential that can be further leveraged to improve SSL itself.
Contributions. In this paper, we aim to investigate the design of SSL methods by leveraging the inherent clustering properties of representations, enabling a closed-loop positive-feedback SSL framework, as illustrated in Figure 1. To achieve this goal, we propose three key questions and our main contributions are summarized as follows:
- Where to extract clustering properties from? We demonstrate through various metrics that the encoder's output, referred to as encoding, exhibits superior and more stable clustering properties compared to other
components, such as embedding and the hidden layer outputs within the projector.
- How to leverage clustering properties? We propose a novel SSL method, termed Representation Self-Assignment (ReSA), which employs an online self-clustering mechanism to leverage the model's inherent clustering properties, thereby facilitating positive feedback learning. Standard experiments demonstrate that ReSA surpasses existing state-of-the-art methods in both performance and training efficiency. - Whether it facilitates better clustering properties? We examine whether and how ReSA facilitates better clustering properties, demonstrating that it excels at both fine-grained and coarse-grained learning, shaping representations that are inherently more structured and semantically meaningful.
# 2. Background, Related Work, & Notation
# 2.1. Self-Supervised Learning
 Figure 2. The basic notations for joint embedding architectures (JEA) in SSL.
Joint embedding architectures (JEA). Let $\mathbf{B}$ denote a mini-batch input sampled uniformly from a set of images $\mathbb{D}$ , and $\mathbb{T}$ denote the set of data transformations available for augmentation. We consider a pair of neural networks $F_{\theta}$ and $F_{\theta^{\prime}}^{\prime}$ , parameterized by $\theta$ and $\theta^{\prime}$ respectively. They take as input two randomly augmented views, $\mathbf{X} = \mathcal{T}(\mathbf{B})$ and $\mathbf{X}^{\prime} = \mathcal{T}^{\prime}(\mathbf{B})$ , where $\mathcal{T},\mathcal{T}^{\prime}\in \mathbb{T}$ ; and they output the embeddings $\mathbf{Z} = F_{\theta}(\mathbf{X})$ and $\mathbf{Z}^{\prime} = F_{\theta^{\prime}}^{\prime}(\mathbf{X}^{\prime})$ . The networks are trained with an objective function that minimizes the distances between embeddings obtained from different (two) views of the same images:
$$\mathcal {L} (\mathbf {B}, \theta) = \mathbb {E} _ {\mathbf {B} \sim \mathbb {D}, \mathcal {T}, \mathcal {T} ^ {\prime} \sim \mathbb {T}} \ell \left(F _ {\theta} \left(\mathcal {T} (\mathbf {B})\right), F _ {\theta^ {\prime}} ^ {\prime} \left(\mathcal {T} ^ {\prime} (\mathbf {B})\right)\right). \tag {1}$$
where $\ell (\cdot ,\cdot)$ is a loss function, which aims to learn invariance of data transformations.
In particular, the JEA usually consists of a shared encoder $E_{\theta_e}(\cdot)$ and projector $G_{\theta_g}(\cdot)$ , commonly referred to as a Siamese Network (Chen & He, 2021). As shown in Figure 2, their outputs $\mathbf{H} = E_{\theta_e}(\mathbf{X}) \in \mathbb{R}^{d_e \times m}$ and $\mathbf{Z} = G_{\theta_g}(\mathbf{H}) \in \mathbb{R}^{d_g \times m}$ are referred to as encoding and embedding, respectively (where $m$ is the mini-batch size, $d_e$ and $d_g$ are their corresponding feature dimensions). Under this notation,
 Figure 3. Comparison of clustering metrics in encoding $\mathbf{H}$ and embedding $\mathbf{Z}$ across various self-supervised pretrained models. All methods utilize a ResNet-18 encoder pretrained on CIFAR-10 for 1000 epochs. Circular markers represent metrics computed using encodings, while cross markers correspond to metrics derived from embeddings. All metrics are computed on the entire training set, and similar trends can be observed in the validation set.
we have $F_{\theta}(\cdot) = G_{\theta_g}(E_{\theta_e}(\cdot))$ with learnable parameters $\theta = \{\theta_e, \theta_g\}$ . It is worth noting that extensive work (Chen et al., 2020a; Gupta et al., 2022) has demonstrated that using the encoding as the representation for downstream tasks achieves much better performance than using embedding, so that the projector is only used during the pre-training process and discarded in inference.
Self-supervised paradigms. The main challenge with JEA is representation collapse, where both branches produce identical and constant outputs regardless of the inputs. Numerous paradigms have been proposed to avoid collapse, including contrastive learning methods (Chen et al., 2020a; He et al., 2020; Chen et al., 2020b; 2021; Liu et al., 2022) that attract different views from the same image (positive pairs) while pushing apart different images (negative pairs), and non-contrastive approaches (Grill et al., 2020; Caron et al., 2020; 2021; Weng et al., 2024) which directly align positive targets without incorporating negative pairs. Although Ben-Shaul et al. (2023) had demonstrated that the encodings learned through SSL are highly correlated with semantic classes and exhibit strong clustering capabilities, few methods have leveraged this clustering ability to facilitate positive-feedback learning. A closely related work (Ma et al., 2023) exploits the encoding's augmentation robustness to re-weight the positive alignment in the SSL objective functions; however, it still overlooks the rich clustering information inherent in the encodings.








 Figure 4. Comparison of linear evaluation accuracy and clustering metrics of encoding $\mathbf{H}$ , embedding $\mathbf{Z}$ , and the hidden layer outputs within the projector $\mathbf{P}$ during the training process. The experiments are conducted using SimCLR, VICReg, and SwAV, employing a ResNet-18 encoder pretrained on CIFAR-100 for 500 epochs. The projector is a standard three-layer MLP with BN and ReLU activations, containing two hidden linear layers, so their outputs are denoted as $\mathbf{P}_0$ and $\mathbf{P}_1$ .



# 2.2. The Information Distinction in JEA
The projector has become an indispensable component of JEA-based SSL. However, the theoretical dynamics of its optimization and the reasons behind its success remain an open question within the community. Some works have attempted to explain these principles. For example, Jing et al. (2022) empirically discovered that applying SSL loss either to encoding or embedding led to a significant decrease in the rank of the corresponding features. They argued that this rank reduction indicates a loss of diverse information, which, in turn, reduces generalization capability. This explanation aligns with the hypothesis in SimCLR (Chen et al., 2020a), where the additional projector acts as a buffer to prevent information degradation of the encoding caused by the invariance constraint. Additionally, Gupta et al. (2022)'s null space analysis for the projector posited that the projector might implicitly learn to select a subspace of the encoding, which is then mapped into the embedding. In this way, only a subspace of the encoding is encouraged to be style-invariant, while the other subspace can retain more useful information.
Therefore, the SSL constraint can cause the embedding to lose information, which may include not only clustering-irrelevant features such as background information, but also class-relevant information, making it difficult to determine which—encoding or embedding—exhibits better clustering performance in this context. In such cases, this paper first analyzes the differences between the two in terms of clustering properties empirically.
# 3. Exploring Clustering Properties of SSL
Ben-Shaul et al. (2023) find that within the encoder of JEA, the clustering ability of features improves progressively as intermediate layers get deeper. However, it remains unclear whether the projector exhibits a similar trend. To quantitatively evaluate the clustering performance of these components, we employ widely recognized metrics such as the Silhouette Coefficient (SC) (Rousseeuw, 1987) and Adjusted Rand Index (ARI) (Hubert & Arabie, 1985). In particular, a larger mean value of SC $(\mathrm{SC}_{\mathrm{mean}})$ indicates stronger local clustering ability in the representation, and a smaller standard deviation $(\mathrm{SC}_{\mathrm{std}})$ reflects better stability in local clustering<sup>1</sup>. Meanwhile, higher ARI values correspond to enhanced global clustering properties. The detailed introduction of these metrics can be found in the Appendix A.
Using these metrics, we first evaluate the clustering abilities of encoding $\mathbf{H}$ and embedding $\mathbf{Z}$ across various self-supervised pretrained models in CIFAR-10 (Krizhevsky et al., 2009) dataset, which contains only 10 classes and is commonly used for cluster analysis (Ben-Shaul et al., 2023). It is evident in Figure 3 that, across most SSL models, encodings achieve visibly higher ARI and $\mathrm{SC}_{\mathrm{mean}}$ , as well as lower $\mathrm{SC}_{\mathrm{std}}$ values, compared to embeddings. These observations reflect common grounds of SSL models: Encodings not only
 Figure 5. The framework of Representation Self-Assignment (ReSA). Here, no grad. denotes that the operation does not involve gradient propagation, norm signifies that each sample is $L_{2}$ -normalized to compute cosine similarities, and sinkhorn refers to the Sinkhorn-Knopp algorithm used for clustering assignment.
possess richer semantic information but also demonstrate high-quality clustering properties. These include excellent local clustering ability $(\mathrm{SC}_{\mathrm{mean}})$ and stability $(\mathrm{SC}_{\mathrm{std}})$ , global clustering capability and similarity measure effectiveness (ARI). An exception to this pattern is observed with SwAV and BYOL, whose embeddings also perform well across these metrics. We speculate that this may be due to the design of their loss functions, which enables the embeddings to learn effective clustering properties. For instance, SwAV learns by predicting cluster assignments directly on the embeddings.
To gain deeper insights into the evolution of clustering properties of each component during training, we conduct experiments on the CIFAR-100 (Krizhevsky et al., 2009) dataset, which features a more complex set of categories, using three methods: SimCLR, VICReg, and SwAV. The results are shown in Figure 4. Overall, the encodings demonstrate a consistent improvement in all clustering metrics throughout training. In contrast, the ones of embeddings degrade significantly during the later stages of training. Moreover, the clustering metrics of the hidden layer outputs within the projector show notable differences and weaknesses compared to those of the encodings, despite $\mathbf{P}_0$ being separated by only a single linear layer and achieving nearly the same linear evaluation accuracy as the encodings.
In summary, the experiments above demonstrate that encodings exhibit superior and more stable clustering properties compared to embeddings and the hidden layer outputs within the projector across various SSL models. This finding highlights the potential of leveraging encoding as the optimal representation for clustering, providing a foundation for designing positive-feedback SSL systems that capitalize on these robust clustering properties.
# 4. Leverage Clustering Properties for Positive-Feedback Learning
Based on above analyses, we design a novel positive-feedback SSL method, which derives Representation Self
Assignment (ReSA) to guide the loss function among embeddings $\mathbf{Z}$ and $\mathbf{Z}'$ . See Figure 5 for the clear framework.
# 4.1. Online Self-Clustering
Following notations in Section 2.1, we apply the encoding $\mathbf{H}$ as the representation to perform clustering. Unlike previous approaches, e.g. SwAV (Caron et al., 2020) and DINOv2 (Oquab et al., 2023) employing learnable prototypes to map features into the clustering space, we treat samples in $\mathbf{H} = [\mathbf{h}_1,\dots ,\mathbf{h}_m]$ simultaneously as points to be clustered and as anchors. In details, we first calculate the cosine self-similarity matrix by $\mathbf{S_H} = \mathbf{H}^\top \mathbf{H}$ , where samples in $\mathbf{H}$ are $L_{2}$ -normalized as $\mathbf{h}_i / \| \mathbf{h}_i\| _2,\forall i$ . Then the online clustering assignment $\mathbf{A_H}$ is computed upon $\mathbf{S_H}$ using the iterative Sinkhorn-Knopp (Cuturi, 2013) as shown in Algorithm 1.
# Algorithm 1 Sinkhorn-Knopp Algorithm
Require: Cosine self-similarity matrix $\mathbf{S_H} \in \mathbb{R}^{m \times m}$ , regularization parameter $\epsilon > 0$ , all-ones column vector $\mathbf{1}_m$ , iteration count $T$ , Hadamard product $\circ$
Ensure: Doubly stochastic matrix $\mathbf{A_H}$
Initialize $\mathbf{Q}\gets \frac{\exp(\mathbf{S_H} / \epsilon)^\top}{\sum_{i,j}\exp(\mathbf{S_H} / \epsilon)}$
Initialize marginals: $\mathbf{c} \gets \frac{1}{m}\mathbf{1}_m$
for $t = 1$ to $T$ do
Compute row sums: $\mathbf{u} \gets \mathbf{Q1}_m$
Normalize rows: $\mathbf{Q} \gets \mathbf{Q} \circ \left( \frac{\mathbf{c}}{\mathbf{u}} \right) \mathbf{1}_{m}^{\top}$
Compute column sums: $\mathbf{v} \gets \overline{\mathbf{Q}}^{\top} \mathbf{1}_m$
Normalize columns: $\mathbf{Q} \gets \mathbf{Q} \circ \mathbf{1}_m\left(\frac{\mathbf{c}}{\mathbf{v}}\right)^\top$
# end for
Normalize columns again: $\mathbf{Q} \leftarrow \mathbf{Q} \circ \mathbf{1}_m\left(\frac{1}{\mathbf{Q}^\top \mathbf{1}_m}\right)^\top$
Return $\mathbf{A_H}\gets \mathbf{Q}^\top$
We follow SwAV which uses only 3 iterations and sets the regularization parameter $\epsilon = 0.05$ . This algorithm does not involve gradient propagation, enabling it to be efficiently implemented on GPUs (Caron et al., 2020). After obtaining the doubly stochastic matrix $\mathbf{A_H}$ as the assignment, it can naturally be utilized to guide relationship between the embeddings $\mathbf{Z}$ and $\mathbf{Z}'$ . Specially, we use the cross-entropy loss to promote the learning process:
$$\begin{array}{l} \ell_ {\mathrm {R e S A}} = - \frac {1}{2 m} \left(\sum_ {i, j} \mathbf {A} _ {\mathbf {H}} \circ \log \mathcal {D} \left(\mathbf {Z} ^ {\top} \mathbf {Z} ^ {\prime}\right) + \right. \tag {2} \\ \left. \sum_ {i, j} \mathbf {A} _ {\mathbf {H}} ^ {\top} \circ \log \mathcal {D} \left(\mathbf {Z} ^ {\prime} ^ {\top} \mathbf {Z}\right)\right) \\ \end{array}$$
where $\mathcal{D}(\mathbf{Z}^{\top}\mathbf{Z}^{\prime}) = \frac{\exp(\mathbf{Z}^{\top}\mathbf{Z}^{\prime} / \tau)}{\exp(\mathbf{Z}^{\top}\mathbf{Z}^{\prime} / \tau)\mathbf{1}_{m}}$ and $\mathcal{D}(\mathbf{Z}^{\prime \top}\mathbf{Z})$ are probability distributions derived through the softmax function. $\tau$ is a scalar temperature hyperparameter, $\circ$ stands for Hadamard product, and $\mathbf{1}_m$ is the all-ones column vector.
Comparison to SwAV. As a pioneering SSL method based on online clustering, SwAV (Caron et al., 2020) employs a ' swapped' prediction mechanism (which is also adopted by DINOV2 (Oquab et al., 2023)), where the cluster assignment of one view is predicted from the embedding of another view. This is achieved by minimizing the following objective:
$$\begin{array}{l} \ell_ {\mathrm {S w A V}} = - \frac {1}{2 m} \left(\sum_ {i, j} \mathbf {Q} ^ {\prime} \circ \log \mathcal {D} (\mathbf {Z} ^ {\top} \mathbf {C}) + \right. \tag {3} \\ \left. \sum_ {i, j} \mathbf {Q} \circ \log \mathcal {D} \left(\mathbf {Z} ^ {\prime^ {\top}} \mathbf {C}\right)\right) \\ \end{array}$$
where $\mathbf{C} \in \mathbb{R}^{d_g \times K}$ is the prototype matrix learned by backpropagation, and $\mathbf{Q} = \mathrm{sinkhorn}(\mathbf{Z}^\top \mathbf{C})$ is the cluster assignment using Sinkhorn-Knopp algorithm. The key differences and advantages of our ReSA compared to SwAV (and DINOv2) can be summarized as follows: (1) ReSA computes clustering assignments on encoding with high-quality clustering properties, whereas SwAV performs it on the less stable embedding. (2) SwAV requires learnable prototypes, which often necessitate complex design strategies, such as freezing prototypes during the early stages of training and use a large number of prototypes $K$ to ensure stability, whereas ReSA directly extracts clustering information from the representations. (3) SwAV executes the Sinkhorn-Knopp algorithm multiple times, corresponding to the number of global augmented views. In contrast, ReSA only requires a single execution of this algorithm regardless of the number of augmented views. This highlights the efficiency of ReSA, particularly under multi-crop scenarios.
Comparison to InfoNCE. As a well-known contrastive loss function, InfoNCE (Oord et al., 2018) aims to maximize the similarity between positive pairs while minimizing the similarity between the negative pairs, thereby approximating the optimization of mutual information as follows:
$$\ell_ {\text {I n f o N C E}} = - \frac {1}{2 m} \left(\sum_ {i, i} \log \mathcal {D} \left(\mathbf {Z} ^ {\top} \mathbf {Z} ^ {\prime}\right) + \sum_ {i, i} \log \mathcal {D} \left(\mathbf {Z} ^ {\prime \top} \mathbf {Z}\right)\right) \tag {4}$$
It is evident that when $\mathbf{A_H}$ equals the identity matrix, ReSA and InfoNCE are entirely equivalent. In other words, ReSA guides the relationship among embeddings through assignments obtained via self-clustering, whereas InfoNCE employs the identity matrix as a hard matching target, strictly enforcing the maximization of distances between all negative pairs, which may inadvertently push samples belonging to the same category further apart during training, thereby disrupting the underlying semantic cluster structure (Wang & Liu, 2021; Huang et al., 2024).
# 4.2. A Gradient Perspective on ReSA
Many works have conducted in-depth theoretical studies on InfoNCE, such as the alignment and uniformity properties
observed by Wang & Isola (2020), the hardness-aware property discovered by Wang & Liu (2021) through gradient analysis, and the probabilistic model of InfoNCE derived by Bizeul et al. (2024) from the perspective of mutual information. Since the motivation for our proposed ReSA does not have a direct connection with the evidence lower bound of mutual information, in this section, we provide an intuitive gradient analysis to further understand the optimization mechanism of ReSA.
Given the $L_{2}$ -normalized embedding vectors $\mathbf{Z} = [\mathbf{z}_1, \ldots, \mathbf{z}_m]$ and $\mathbf{Z}' = [\mathbf{z}_1', \ldots, \mathbf{z}_m']$ , the InfoNCE formula on $\mathbf{z}_i$ can be written as (omitting the symmetric terms):
$$\ell_ {\text {I n f o N C E}} (\mathbf {z} _ {i}) = - \log \left(\frac {\exp \left(s _ {i , i} / \tau\right)}{\sum_ {k = 1} ^ {m} \exp \left(s _ {i , k} / \tau\right)}\right) \tag {5}$$
where $s_{i,j} = \mathbf{z}_i^\top \mathbf{z}_j'$ , $\forall i, j$ . Defining the probability $P_{i,j} = \frac{\exp(s_{i,j} / \tau)}{\sum_{k=1}^{m}\exp(s_{i,k} / \tau)}$ , the gradients of InfoNCE with respect to the positive similarity $s_{i,i}$ and the negative similarity $s_{i,j}$ ( $i \neq j$ ) are formulated as (Wang & Liu, 2021):
$$\frac {\partial \ell_ {\text {I n f o N C E}} (\mathbf {z} _ {i})}{\partial s _ {i , i}} = - \frac {1}{\tau} \sum_ {k \neq i} P _ {i, k}, \quad \frac {\partial \ell_ {\text {I n f o N C E}} (\mathbf {z} _ {i})}{\partial s _ {i , j}} = \frac {1}{\tau} P _ {i, j} \tag {6}$$
Similarly, our ReSA formula on $\mathbf{z}_i$ can be written as:
$$\ell_ {\operatorname {R e S A}} \left(\mathbf {z} _ {i}\right) = - \sum_ {j = 1} ^ {m} \mathbf {A} _ {\mathbf {H}} ^ {(i, j)} \log \left(\frac {\exp \left(s _ {i , j} / \tau\right)}{\sum_ {k = 1} ^ {m} \exp \left(s _ {i , k} / \tau\right)}\right) \tag {7}$$
By contrast, the gradient of ReSA with respect to the similarity $s_{i,j}$ for any pair of samples $(\forall i,j)$ takes exactly the same analytical form:
$$\frac {\partial \ell_ {\mathrm {R e S A}} (\mathbf {z} _ {i})}{\partial s _ {i , j}} = \frac {1}{\tau} \left(P _ {i, j} - \mathbf {A} _ {\mathbf {H}} ^ {(i, j)}\right) \tag {8}$$
Based on the gradient analysis above, we know that InfoNCE explicitly distinguishes between the gradient forms of positive and negative similarities. This restrictive mechanism naturally leads to harmful gradient updates for negative sample pairs within the same class. In contrast, ReSA eliminates the distinction between positive and negative samples and adapts to optimize the similarity of all sample pairs by leveraging self-clustering of the encodings, thereby addressing a key challenge in contrastive learning.
# 4.3. Impact of Image Augmentation on ReSA
Having introduced the learning process of ReSA, it is essential to consider another critical aspect of SSL: image augmentation, which has long been acknowledged as a key factor in enhancing the performance of self-supervised methods (Chen et al., 2020b; Grill et al., 2020). Standard prac
 Figure 6. Investigate the impact of image augmentation on ReSA. The experiments are conducted employing a ResNet-18 encoder pretrained on ImageNet-100 for 200 epochs. The starting positions of bars represent results of the standard augmentation. The symbols $-$ on the $x$ -axis indicate the removal of a specific transformation from the standard augmentation. 'Weak' denotes the weak augmentation that includes only `ResizedCrop` and `HorizontalFlip`.
tices involve employing a variety of complex transformations with random probabilities, such as ResizedCrop, ColorJitter, Grayscale, GaussianBlur, and HorizontalFlip, to increase the task's complexity and improve the robustness of the learned representations. However, for clustering-based SSL methods, overly aggressive augmentations can distort the original image information, making it harder for the model to discern meaningful patterns (Zheng et al., 2021), which may result in incorrect clustering assignments. To address this, we systematically evaluate the effect of each transformation technique on ReSA's clustering performance during training and its linear evaluation accuracy.
Since ReSA only requires extracting clustering information from the encodings of one single view, we only need to adjust the image augmentation for that specific view, while the standard augmentation setting can be applied to the other view(s). Subsequently, we conduct experiments using the high-resolution ImageNet-100 (Tian et al., 2020) dataset, and the results are presented in Figure 6. It is evident that removing any single transformation improves the clustering performance of the representations, with ResizedCrop (replaced with fixed CenterCrop) having the most significant impact. However, its removal leads to a substantial decline in representation quality, indicating the critical role of ResizedCrop in learning invariance. The removal of ColorJitter, Grayscale, or GaussianBlur each results
in improvements across various metrics, whereas removing HorizontalFlip causes a slight drop in val accuracies. Based on these findings, we design a weak augmentation for ReSA, which includes only ResizedCrop and HorizontalFlip, and discover that this design not only significantly enhances the clustering performance of the representations but also improves their overall quality. We note that these findings align with the results observed in ReSSL (Zheng et al., 2021), where weak augmentation enables the model to better capture the relationships among samples.
In summary, we have completed the introduction of the ReSA framework as shown in Figure 5, which leverages clustering information extracted from the encoding to guide the design of the loss function, thereby achieving positive-feedback self-supervised learning.
# 5. Experiments on Standard SSL Benchmark
In this section, we conduct extensive experiments on standard SSL benchmarks to evaluate the effectiveness of ReSA. We perform pretraining from scratch on a variety of datasets, including CIFAR-10/100, ImageNet-100, and ImageNet (Deng et al., 2009), utilizing diverse encoders such as ConvNets and the ViT. Furthermore, we compare the performance of ReSA with state-of-the-art SSL methods across a range of downstream tasks, e.g. linear probe evaluation and transfer learning. The full PyTorch-style algorithm as well as details of implementation is provided in Appendix B.
# 5.1. Evaluation for Classification
Evaluation on small and medium size datasets. Following the benchmark in solo-learn (da Costa et al., 2022), we first perform pretraining and classification evaluations on CIFAR-10/CIFAR-100, and ImageNet-100, strictly adhering to the same experimental settings as other methods without introducing any additional tricks. The results in Table 1 reveal that ReSA consistently outperforms state-of-the-art methods, even those with carefully optimized parameters, across all datasets. Particularly noteworthy is ReSA's performance in $k$ -nearest neighbors classification, surpassing other methods with absolute accuracy improvements of approximately $3\%$ to $8\%$ on CIFAR-10 and $5\%$ to $13\%$ on CIFAR-100. These findings highlight that ReSA captures representations with superior clustering structures.
Evaluation on ImageNet. Following the ImageNet evaluation protocol commonly used by SSL methods, we pretrain ResNet-50 encoders with ReSA for varying numbers of epochs. As shown in Table 2, ReSA consistently outperforms other methods on the large-scale ImageNet dataset. Remarkably, after only 100-epoch training, ReSA surpasses the performance of SimCLR, SwAV, and SimSiam trained for 800 epochs. With 200 epochs, ReSA exceeds state-of-the-art methods such as MoCoV3, Barlow Twins, VICReg,
Table 1. Classification top-1 accuracies of a linear and a $k$ -nearest neighbors ( $k = 5$ ) classifier for different loss functions and datasets. The table is mostly inherited from solo-learn (da Costa et al., 2022). All methods are based on ResNet-18 with two augmented views generated from per sample and are trained for 1000-epoch on CIFAR-10/100 with a batch size of 256 and 400-epoch on ImageNet-100 with a batch size of 128. The bold values indicate the best performance, and the underlined values represent the second highest accuracy.
<table><tr><td rowspan="2">Method</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td><td colspan="2">ImageNet-100</td></tr><tr><td>linear</td><td>k-nn</td><td>linear</td><td>k-nn</td><td>linear</td><td>k-nn</td></tr><tr><td>SimCLR (Chen et al., 2020a)</td><td>90.74</td><td>85.13</td><td>65.78</td><td>53.19</td><td>77.64</td><td>65.78</td></tr><tr><td>BYOL (Grill et al., 2020)</td><td>92.58</td><td>87.40</td><td>70.46</td><td>56.46</td><td>80.32</td><td>68.94</td></tr><tr><td>SwAV (Caron et al., 2020)</td><td>89.17</td><td>84.18</td><td>64.88</td><td>53.32</td><td>74.28</td><td>63.84</td></tr><tr><td>SimSiam (Chen & He, 2021)</td><td>90.51</td><td>86.82</td><td>66.04</td><td>55.79</td><td>78.72</td><td>67.92</td></tr><tr><td>MoCoV3 (Chen et al., 2021)</td><td>93.10</td><td>89.47</td><td>68.83</td><td>58.23</td><td>80.36</td><td>72.76</td></tr><tr><td>W-MSE (Ermolov et al., 2021)</td><td>91.55</td><td>89.69</td><td>66.10</td><td>56.69</td><td>76.23</td><td>67.72</td></tr><tr><td>DINO (Caron et al., 2021)</td><td>89.52</td><td>86.13</td><td>66.76</td><td>56.24</td><td>74.92</td><td>64.30</td></tr><tr><td>Barlow Twins (Zbontar et al., 2021)</td><td>92.10</td><td>88.09</td><td>70.90</td><td>59.40</td><td>80.16</td><td>72.14</td></tr><tr><td>VICReg (Bardes et al., 2022)</td><td>92.07</td><td>87.38</td><td>68.54</td><td>56.32</td><td>79.40</td><td>71.94</td></tr><tr><td>CW-RGP (Weng et al., 2022)</td><td>92.03</td><td>89.67</td><td>67.78</td><td>58.24</td><td>76.96</td><td>68.46</td></tr><tr><td>INTL (Weng et al., 2024)</td><td>92.60</td><td>90.03</td><td>70.88</td><td>61.90</td><td>81.68</td><td>73.46</td></tr><tr><td>ReSA (ours)</td><td>93.53</td><td>93.02</td><td>72.21</td><td>66.83</td><td>82.24</td><td>74.56</td></tr></table>
Table 2. ImageNet classification top-1 accuracy of a linear classifier based on ResNet-50 encoder. All methods are pretrained with two $224^2$ augmented views generated from per sample. Given that one of the objectives of SSL methods is to achieve high performance with small batch sizes (Chen et al., 2020b; Chen & He, 2021), it's worth noting that our ReSA can also perform effectively when trained with a small batch size of 256.
<table><tr><td rowspan="2">Method</td><td rowspan="2">batch size</td><td colspan="3">pretrained epochs</td></tr><tr><td>100</td><td>200</td><td>800</td></tr><tr><td rowspan="2">SimCLR</td><td>256</td><td>57.5</td><td>62.0</td><td>66.5</td></tr><tr><td>4096</td><td>66.5</td><td>68.3</td><td>70.4</td></tr><tr><td rowspan="2">SwAV</td><td>256</td><td>65.5</td><td>67.7</td><td>-</td></tr><tr><td>4096</td><td>66.5</td><td>69.1</td><td>71.8</td></tr><tr><td rowspan="2">MoCoV3</td><td>1024</td><td>67.4</td><td>71.0</td><td>72.4</td></tr><tr><td>4096</td><td>68.9</td><td>-</td><td>73.8</td></tr><tr><td>BYOL</td><td>4096</td><td>66.5</td><td>70.6</td><td>74.3</td></tr><tr><td>Barlow Twins</td><td>2048</td><td>67.7</td><td>70.2</td><td>73.2</td></tr><tr><td>VICReg</td><td>2048</td><td>68.6</td><td>70.8</td><td>73.1</td></tr><tr><td rowspan="2">SimSiam</td><td>256</td><td>68.1</td><td>70.0</td><td>71.3</td></tr><tr><td>1024</td><td>68.0</td><td>69.9</td><td>71.1</td></tr><tr><td rowspan="2">MEC</td><td>256</td><td>70.1</td><td>-</td><td>-</td></tr><tr><td>1024</td><td>70.6</td><td>71.9</td><td>74.0</td></tr><tr><td rowspan="2">INTL</td><td>256</td><td>69.5</td><td>71.1</td><td>73.1</td></tr><tr><td>1024</td><td>69.7</td><td>71.2</td><td>73.3</td></tr><tr><td rowspan="2">ReSA (ours)</td><td>256</td><td>71.9</td><td>73.4</td><td>-</td></tr><tr><td>1024</td><td>71.3</td><td>73.8</td><td>75.2</td></tr></table>
and INTL, all trained for 800 epochs. When extended to 800 epochs, ReSA achieves a linear classification accuracy of $75.2\%$ , a level that methods like SwAV and DINO only reach by employing the multi-crop (Caron et al., 2020) trick. These results underscore ReSA's exceptional potential for training on large-scale datasets. Additionally in Table 3, we conduct preliminary evaluations of ReSA's training capability on the Vision Transformer, using a standard ViT-S/16, which has a comparable number of parameters to ResNet-50. We do not incorporate extensive training tricks, yet ReSA still outperform DINO in both linear and $k$ -nn classification.
Table 3. ImageNet classification top-1 accuracy of a linear and a $k$ -nearest neighbors ( $k = 20$ ) classifier based on a standard ViT-S/16 encoder. All models are pretrained for 300-epoch with two $224^2$ views.
<table><tr><td>Classifier</td><td>BYOL</td><td>SwAV</td><td>MoCoV3</td><td>DINO</td><td>ReSA</td></tr><tr><td>linear</td><td>71.4</td><td>68.5</td><td>72.5</td><td>72.5</td><td>72.7</td></tr><tr><td>k-nn</td><td>66.6</td><td>60.5</td><td>67.7</td><td>67.9</td><td>68.3</td></tr></table>
Table 4. Comparison of Computational overhead among various SSL methods. For fairness, we set the batch size to 1024 with two $224^2$ augmented views pretraining on ImageNet, and perform all measurements including peak memory (GB per GPU) and training time (hours per epoch) on the same environment and machine equipped with 8 A100-PCIE-40GB GPUs using 32 dataloguing workers under mixed-precision.
<table><tr><td>Method</td><td>encoder</td><td>memory</td><td>time</td></tr><tr><td rowspan="2">SwAV</td><td>ResNet-50</td><td>13.7</td><td>0.19</td></tr><tr><td>ViT-S/16</td><td>14.8</td><td>0.17</td></tr><tr><td rowspan="2">MoCoV3</td><td>ResNet-50</td><td>14.6</td><td>0.19</td></tr><tr><td>ViT-S/16</td><td>15.5</td><td>0.22</td></tr><tr><td rowspan="2">DINO</td><td>ResNet-50</td><td>15.5</td><td>0.20</td></tr><tr><td>ViT-S/16</td><td>16.4</td><td>0.21</td></tr><tr><td rowspan="2">ReSA (ours)</td><td>ResNet-50</td><td>14.6</td><td>0.16</td></tr><tr><td>ViT-S/16</td><td>15.6</td><td>0.12</td></tr></table>
# 5.2. Analysis on Computational Overhead
In Table 4, we provide a fair comparison of the training costs among ReSA and several SSL methods. The results show that ReSA has memory consumption comparable to MoCoV3 but achieves faster training speeds, especially on ViTs, where it is nearly twice as fast. This improvement is attributed to ReSA's simpler image augmentation settings and the removal of batch normalization (BN) from the projector and predictor MLPs. Additionally, ReSA outperforms DINO in both memory usage and training time. This advantage stems from DINO's reliance on an extremely high
Table 5. Transfer Learning to COCO detection and instance segmentation. All competitive methods are based on ResNet-50 with 200-epoch pretraining on ImageNet. We follow MoCo (He et al., 2020) to apply Mask R-CNN ( $1 \times$ schedule) fine-tuned in COCO 2017 train, evaluated in COCO 2017 val.
<table><tr><td rowspan="2">Method</td><td colspan="3">COCO detection</td><td colspan="3">COCO instance seg.</td></tr><tr><td>\(AP_{50}\)</td><td>AP</td><td>\(AP_{75}\)</td><td>\(AP_{50}\)</td><td>AP</td><td>\(AP_{75}\)</td></tr><tr><td>Scratch</td><td>44.0</td><td>26.4</td><td>27.8</td><td>46.9</td><td>29.3</td><td>30.8</td></tr><tr><td>Supervised</td><td>58.2</td><td>38.2</td><td>41.2</td><td>54.7</td><td>33.3</td><td>35.2</td></tr><tr><td>SimCLR</td><td>57.7</td><td>37.9</td><td>40.9</td><td>54.6</td><td>33.3</td><td>35.3</td></tr><tr><td>MoCoV2</td><td>58.8</td><td>39.2</td><td>42.5</td><td>55.5</td><td>34.3</td><td>36.6</td></tr><tr><td>BYOL</td><td>57.8</td><td>37.9</td><td>40.9</td><td>54.3</td><td>33.2</td><td>35.0</td></tr><tr><td>SwAV</td><td>57.6</td><td>37.6</td><td>40.3</td><td>54.2</td><td>33.1</td><td>35.1</td></tr><tr><td>SimSiam</td><td>59.3</td><td>39.2</td><td>42.1</td><td>56.0</td><td>34.4</td><td>36.7</td></tr><tr><td>Barlow Twins</td><td>59.0</td><td>39.2</td><td>42.5</td><td>56.0</td><td>34.3</td><td>36.5</td></tr><tr><td>MEC</td><td>59.8</td><td>39.8</td><td>43.2</td><td>56.3</td><td>34.7</td><td>36.8</td></tr><tr><td>INTL</td><td>60.9</td><td>40.7</td><td>43.7</td><td>57.3</td><td>35.4</td><td>37.6</td></tr><tr><td>ReSA (ours)</td><td>61.1</td><td>41.0</td><td>44.3</td><td>57.7</td><td>35.7</td><td>38.4</td></tr></table>
dimensional prototype (e.g., output dimension $= 65536$ ), which significantly impacts training efficiency. Finally, while SwAV exhibits the smallest memory footprint among the methods due to its absence of momentum networks, its training speed remains slower than ReSA. This is because SwAV also requires a higher-dimensional prototype and performs the Sinkhorn-Knopp algorithm twice per iteration.
# 5.3. Transfer to Downstream Tasks
To evaluate the quality of representations learned by ReSA, we transfer our pretrained model to downstream tasks, including COCO (Lin et al., 2014) object detection and instance segmentation. For these tasks, we adopt the baseline codebase from MoCo (He et al., 2020). Most results reported in Table 5 are inherited from SimSiam paper (Chen & He, 2021). Notably, ReSA also achieves better performance compared to other methods on both tasks, highlighting its strong potential for downstream applications.
# 6. How ReSA Shapes Better Clustering Properties?
In this section, we utilize visualizations and additional experiments to illustrate the differences among the representations learned by ReSA and other SSL methods, as well as to investigate whether and how ReSA facilitates better clustering properties.
Firstly, we track the evolution of clustering metrics for each component during ReSA training, as shown in Figure 9. It can be clearly observed that while ReSA exhibits relatively slow performance improvement in the early stages of training, it significantly outperforms other methods in the later stages. Interestingly, all components of ReSA demonstrate strong clustering properties, suggesting that leveraging high-quality clustering information from the encodings to guide the learning of embeddings enables the projector layers to


 Figure 7. T-SNE visualization of SSL representations on CIFAR-10. All methods are pretrained for 1000 epochs on CIFAR-10 using ResNet-18, with encodings utilized as representations to visualize all training data. For the multiple centroids observed in the bird and horse categories, we enclose points of each subclass with convex polygons and display the corresponding images.
also acquire robust clustering performance.
# 6.1. ReSA Excels at Fine-grained Learning
Furthermore, in Figure 7, we visualize the representation distributions learned by ReSA and other SSL methods on CIFAR-10 using T-SNE (van der Maaten & Hinton, 2008). Notably, the representations learned by ReSA exhibit clear separations between different classes, whereas those learned by other methods show varying degrees of overlap, making it difficult to discern distinct boundaries.
Another intriguing observation is the presence of multiple centroids within the bird and horse categories in the representations. Upon further investigation of the samples corresponding to these centroids, we find that, unlike the neural collapse (Papyan et al., 2020) in supervised learning (where samples of the same class collapse to a single point), SSL models are capable of capturing more fine-grained features, such as color distinctions (e.g., cassowary vs. ostrich), structural differences (e.g., whole horse vs. horse head), and the presence of multiple objects (e.g., a rider on a horse). Moreover, compared to other methods, ReSA demonstrates a superior ability to distinguish these fine-grained features.
Table 6. Transfer learning to fine-grained datasets based on ResNet-50 pretrained on ImageNet. We employ a $k$ -nearest neighbors classifier ( $k = 5, 10, 20$ ), without requiring additional training or parameter tuning. The model weights for all other methods are sourced directly from their respective official codebases. $\dagger$ indicates that these methods employ the multi-crop trick, i.e. generating two $224^2$ views and six $96^2$ views for each image, which can enhance performance but comes at the cost of additional computational overhead.
<table><tr><td rowspan="2">Method</td><td rowspan="2">pretrained epochs</td><td colspan="3">ImageNet-1K</td><td colspan="3">CUB-200-2011</td><td colspan="3">Pets-37</td><td colspan="3">Food-101</td><td colspan="3">Flowers-102</td></tr><tr><td>5</td><td>10</td><td>20</td><td>5</td><td>10</td><td>20</td><td>5</td><td>10</td><td>20</td><td>5</td><td>10</td><td>20</td><td>5</td><td>10</td><td>20</td></tr><tr><td>MoCoV3</td><td>1000</td><td>67.9</td><td>68.9</td><td>68.9</td><td>46.8</td><td>48.8</td><td>50.4</td><td>85.4</td><td>86.5</td><td>86.5</td><td>56.3</td><td>58.6</td><td>59.7</td><td>83.4</td><td>81.6</td><td>80.9</td></tr><tr><td>VICReg</td><td>1000</td><td>64.3</td><td>65.2</td><td>65.6</td><td>33.4</td><td>35.4</td><td>36.3</td><td>81.5</td><td>82.0</td><td>82.3</td><td>56.9</td><td>59.6</td><td>61.0</td><td>83.4</td><td>83.2</td><td>82.6</td></tr><tr><td>INTL</td><td>800</td><td>63.6</td><td>64.8</td><td>65.1</td><td>26.7</td><td>28.0</td><td>29.4</td><td>78.4</td><td>79.5</td><td>79.7</td><td>55.6</td><td>58.1</td><td>59.2</td><td>78.8</td><td>77.6</td><td>77.2</td></tr><tr><td>ReSA (ours)</td><td>800</td><td>69.2</td><td>69.9</td><td>69.9</td><td>56.5</td><td>58.5</td><td>59.9</td><td>85.8</td><td>87.2</td><td>87.5</td><td>58.3</td><td>60.4</td><td>61.3</td><td>84.4</td><td>83.6</td><td>83.6</td></tr><tr><td>\( SwAV^† \)</td><td>800</td><td>64.3</td><td>65.5</td><td>65.7</td><td>26.2</td><td>27.3</td><td>28.4</td><td>77.2</td><td>77.3</td><td>77.1</td><td>54.7</td><td>57.4</td><td>58.7</td><td>79.3</td><td>79.9</td><td>78.4</td></tr><tr><td>\( DINO^† \)</td><td>800</td><td>66.4</td><td>67.4</td><td>67.6</td><td>33.8</td><td>35.5</td><td>36.8</td><td>81.1</td><td>81.6</td><td>80.9</td><td>58.2</td><td>60.8</td><td>61.8</td><td>84.8</td><td>84.1</td><td>83.7</td></tr></table>
<table><tr><td>flowers</td><td>household_furniture</td><td>vehicles_1</td><td>large_carnivores</td><td>large_man-made_outdoor Things</td></tr><tr><td>sunflower</td><td>table</td><td>train</td><td>wolf</td><td>castle</td></tr><tr><td>rose</td><td>chair</td><td>bicycle</td><td>leopard</td><td>skyscraper</td></tr><tr><td>tulip</td><td>wardrobe</td><td>motorcycle</td><td>lion</td><td>road</td></tr><tr><td>poppy</td><td>couch</td><td>bus</td><td>tiger</td><td>bridge</td></tr><tr><td>orchid</td><td>bed</td><td>pickup_truck</td><td>bear</td><td>house</td></tr></table>
 Figure 8. T-SNE visualization of SSL representations on CIFAR-100. We enclose points of each subclass with convex polygons.
To further substantiate this, we transfer models pretrained on ImageNet to fine-grained datasets for evaluation. As shown in Table 6, ReSA consistently outperforms other SSL methods on fine-grained datasets, with particularly considerable improvements observed on the CUB-200-2011.
# 6.2. ReSA also Stands Out in Coarse-grained Representations
Finally, we explore ReSA's performance at the coarse-grained level. Specifically, we select CIFAR-100 for visualization, as its 100 classes can be grouped into 20 coarse-grained superclasses. For clarity, we randomly selected 5 superclasses for T-SNE visualization, as shown in Figure 8. It is evident that all other methods exhibit dense overlap on the CIFAR-100 dataset, resulting in numerous indistinguishable outliers. In contrast, our ReSA effectively identifies these hard samples, clustering them correctly within their respective groups. We believe this capability of ReSA is a key factor behind its superior accuracy with the $k$ -nn classifier, substantially exceeding other SSL methods. Furthermore, as shown in Table 7, we evaluate the performance of various SSL models using coarse-grained labels and observe
Table 7. CIFAR-100 classification top-1 accuracy of a linear and a $k$ -nearest neighbors ( $k = 5$ ) classifier based on 100 fine-grained classes and 20 coarse-grained superclasses.
<table><tr><td rowspan="2">Method</td><td colspan="2">fine-grained</td><td colspan="2">coarse-grained</td></tr><tr><td>linear</td><td>k-nn</td><td>linear</td><td>k-nn</td></tr><tr><td>SimCLR</td><td>65.8</td><td>53.2</td><td>72.5</td><td>67.2</td></tr><tr><td>SwAV</td><td>64.9</td><td>53.3</td><td>70.0</td><td>66.3</td></tr><tr><td>MoCoV3</td><td>68.8</td><td>58.2</td><td>76.4</td><td>68.6</td></tr><tr><td>DINO</td><td>66.8</td><td>56.2</td><td>72.9</td><td>70.2</td></tr><tr><td>VICReg</td><td>68.5</td><td>56.3</td><td>74.3</td><td>69.9</td></tr><tr><td>ReSA (ours)</td><td>72.2</td><td>66.8</td><td>79.8</td><td>78.8</td></tr></table>
that ReSA consistently achieves much higher accuracies than its counterparts. These experimental results confirm that ReSA also demonstrates exceptional performance in coarse-grained learning.
We also present ablation studies, along with a discussion of potential future research presented in Appendix C.
# 7. Conclusion
In this work, we demonstrate the feasibility of leveraging the rich clustering properties inherent in SSL models, particularly within encodings, to enable a positive-feedback mechanism. Building upon this, we propose ReSA, which exhibits exceptional performance across a wide range of benchmarks and excels at both fine-grained and coarse-grained learning. We believe this dual capability would take a step toward addressing the long-standing challenge of reconciling the seemingly conflicting demands of fine-grained and coarse-grained visual representations within a unified framework, thereby advancing the development of large-scale visual foundation models.
# Acknowledgment
This work was supported by the National Science and Technology Major Project (2022ZD0116306), National Natural
Science Foundation of China (Grant No. 62476016 and 62441617), the Fundamental Research Funds for the Central Universities.
# Impact Statement
This paper presents work aimed at advancing the field of self-supervised learning. By improving representation learning, our methods can contribute to a wide range of applications across various domains, including computer vision, natural language processing, and beyond. While our work has potential societal implications, such as enabling more efficient use of data and reducing reliance on labeled datasets, we do not identify any specific ethical concerns or negative consequences that require particular attention at this stage.
# References
Asano, Y. M., Rupprecht, C., and Vedaldi, A. A critical analysis of self-supervision, or what we can learn from a single image. arXiv preprint arXiv:1904.13132, 2019. Assran, M., Balestriero, R., Duval, Q., Bordes, F., Misra, I., Bojanowski, P., Vincent, P., Rabbat, M., and Ballas, N. The hidden uniform cluster prior in self-supervised learning. arXiv preprint arXiv:2210.07277, 2022a. Assran, M., Caron, M., Misra, I., Bojanowski, P., Bordes, F., Vincent, P., Joulin, A., Rabbat, M., and Ballas, N. Masked siamese networks for label-efficient learning. In European Conference on Computer Vision, pp. 456-473. Springer, 2022b. Assran, M., Duval, Q., Misra, I., Bojanowski, P., Vincent, P., Rabbat, M., LeCun, Y., and Ballas, N. Self-supervised learning from images with a joint-embedding predictive architecture. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 15619-15629, 2023. Bachman, P., Hjelm, R. D., and Buchwalter, W. Learning representations by maximizing mutual information across views. In NeurIPS, 2019. Bao, H., Dong, L., Piao, S., and Wei, F. Beit: Bert pre-training of image transformers. arXiv preprint arXiv:2106.08254, 2021. Bardes, A., Ponce, J., and LeCun, Y. Vicreg: Variance-invariance-covariance regularization for self-supervised learning. In ICLR, 2022. Ben-Shaul, I., Shwartz-Ziv, R., Galanti, T., Dekel, S., and LeCun, Y. Reverse engineering self-supervised learning. Advances in Neural Information Processing Systems, 36: 58324-58345, 2023.
Bendidi, I., Bardes, A., Cohen, E., Lamiable, A., Bollot, G., and Genovesio, A. No free lunch in self supervised representation learning. arXiv preprint arXiv:2304.11718, 2023. Bizeul, A., Schölkopf, B., and Allen, C. A probabilistic model behind self-supervised learning. arXiv preprint arXiv:2402.01399, 2024. Bossard, L., Guillaumeun, M., and Van Gool, L. Food-101-mining discriminative components with random forests. In Computer vision-ECCV 2014: 13th European conference, zurich, Switzerland, September 6-12, 2014, proceedings, part VI 13, pp. 446-461. Springer, 2014. Caron, M., Bojanowski, P., Joulin, A., and Douze, M. Deep clustering for unsupervised learning of visual features. In ECCV, 2018. Caron, M., Misra, I., Mairal, J., Goyal, P., Bojanowski, P., and Joulin, A. Unsupervised learning of visual features by contrasting cluster assignments. In NeurIPS, 2020. Caron, M., Touvron, H., Misra, I., Jegou, H., Mairal, J., Bojanowski, P., and Joulin, A. Emerging properties in self-supervised vision transformers. In ICCV, 2021. Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual representations. In ICML, 2020a. Chen, X. and He, K. Exploring simple siamese representation learning. In CVPR, 2021. Chen, X., Fan, H., Girshick, R., and He, K. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b. Chen, X., Xie, S., and He, K. An empirical study of training self-supervised vision transformers. In CVPR, 2021. Cuturi, M. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013. da Costa, V. G. T., Fini, E., Nabi, M., Sebe, N., and Ricci, E. solo-learn: A library of self-supervised methods for visual representation learning. Journal of Machine Learning Research, 23(56):1-6, 2022. URL http://jmlr.org/papers/v23/21-1155.html. Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009. Devlin, J. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
Ermolov, A., Siarohin, A., Sangineto, E., and Sebe, N. Whitening for self-supervised representation learning. In ICML, 2021. Geiping, J., Goldblum, M., Somepalli, G., Shwartz-Ziv, R., Goldstein, T., and Wilson, A. G. How much data are augmentations worth? an investigation into scaling laws, invariance, and implicit regularization. arXiv preprint arXiv:2210.06441, 2022. Grill, J.-B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., Piot, B., kavukcuoglu, k., Munos, R., and Valko, M. Bootstrap your own latent - a new approach to self-supervised learning. In *NeuralIPS*, 2020. Gupta, K., Ajanthan, T., Hengel, A. v. d., and Gould, S. Understanding and improving the role of projection head in self-supervised learning. arXiv preprint arXiv:2212.11491, 2022. He, K., Fan, H., Wu, Y., Xie, S., and Girshick, R. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020. Huang, L., Ni, Y., Weng, X., Anwer, R. M., Khan, S., Yang, M.-H., and Khan, F. S. Understanding whitening loss in self-supervised learning. IEEE Transactions on Pattern Analysis & Machine Intelligence, (01):1-12, 2024. Hubert, L. and Arabie, P. Comparing partitions. Journal of classification, 2:193-218, 1985. Jing, L., Vincent, P., LeCun, Y., and Tian, Y. Understanding dimensional collapse in contrastive self-supervised learning. In ICLR, 2022. Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., and Zitnick, L. Microsoft coco: Common objects in context. In ECCV, 2014. Liu, X., Wang, Z., Li, Y.-L., and Wang, S. Self-supervised learning via maximum entropy coding. In Oh, A. H., Agarwal, A., Belgrave, D., and Cho, K. (eds.), Advances in Neural Information Processing Systems, 2022. Loshchilov, I. and Hutter, F. SGDR: stochastic gradient descent with restarts. In *ICLR*, 2017. Ma, J., Hu, T., and Wang, W. Deciphering the projection head: Representation evaluation self-supervised learning. arXiv preprint arXiv:2301.12189, 2023. Morningstar, W., Bijamov, A., Duvarney, C., Friedman, L., Kalibhat, N., Liu, L., Mansfield, P., Rojas-Gomez, R.,
Singhal, K., Green, B., et al. Augmentations vs algorithms: What works in self-supervised learning. arXiv preprint arXiv:2403.05726, 2024. Moutakanni, T., Oquab, M., Szafraniec, M., Vakalopoulou, M., and Bojanowski, P. You don't need data augmentation in self-supervised learning. arXiv preprint arXiv:2406.09294, 2024. Nilsback, M.-E. and Zisserman, A. Automated flower classification over a large number of classes. In 2008 Sixth Indian conference on computer vision, graphics & image processing, pp. 722-729. IEEE, 2008. Oord, A. v. d., Li, Y., and Vinyals, O. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. Oquab, M., Darcet, T., Moutakanni, T., Vo, H., Szafraniec, M., Khalidov, V., Fernandez, P., Haziza, D., Massa, F., El-Nouby, A., et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023. Papyan, V., Han, X., and Donoho, D. L. Prevalence of neural collapse during the terminal phase of deep learning training. Proceedings of the National Academy of Sciences, 117(40):24652-24663, 2020. Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498-3505. IEEE, 2012. Purushwalkam, S. and Gupta, A. Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases. Advances in Neural Information Processing Systems, 33:3407-3418, 2020. Rousseeuw, P. J. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of computational and applied mathematics, 20:53-65, 1987. Tian, Y., Krishnan, D., and Isola, P. Contrastive multiview coding. In European conference on computer vision, 2020. van der Maaten, L. and Hinton, G. E. Visualizing data using t-sne. Journal of Machine Learning Research, 9:2579-2605, 2008. URL https://apisemanticscholar.org/CorpusID:5855042. Wagner, D., Ferreira, F., Stoll, D., Schirrmeister, R. T., Müller, S., and Hutter, F. On the importance of hyperparameters and data augmentation for self-supervised learning. arXiv preprint arXiv:2207.07875, 2022. Wah, C., Branson, S., Welinder, P., Perona, P., and Belongie, S. The caltech-ucsd birds-200-2011 dataset. 2011.
Wang, F. and Liu, H. Understanding the behaviour of contrastive loss. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 2495-2504, 2021. Wang, T. and Isola, P. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Proceedings of the 37th International Conference on Machine Learning, 2020. Weng, X., Huang, L., Zhao, L., Anwer, R. M., Khan, S., and Khan, F. An investigation into whitening loss for self-supervised learning. In NeurIPS, 2022. Weng, X., Ni, Y., Song, T., Luo, J., Anwer, R. M., Khan, S., Khan, F. S., and Huang, L. Modulate your spectrum in self-supervised learning. In ICLR, 2024. Wu, Z., Xiong, Y., Yu, S. X., and Lin, D. Unsupervised feature learning via non-parametric instance discrimination. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3733-3742, 2018. Zbontar, J., Jing, L., Misra, I., Lecun, Y., and Deny, S. Barlow twins: Self-supervised learning via redundancy reduction. In ICML, 2021. Zheng, M., You, S., Wang, F., Qian, C., Zhang, C., Wang, X., and Xu, C. Ressler: Relational self-supervised learning with weak augmentation. Advances in Neural Information Processing Systems, 34:2543-2555, 2021.
# A. Details of Clustering Metrics
To quantitatively compare the clustering ability of the encoding, embedding, and the hidden layer outputs within the projector, we first define the following metrics in supervised settings (assign samples with the same true label to the same cluster). Let $\mathcal{X} = \{x_1,x_2,\ldots ,x_N\}$ be a set of $N$ data points, and $\mathcal{Y} = \{y_{1},y_{2},\dots ,y_{N}\}$ be the corresponding set of true labels.
Definition A.1. (Silhouette Coefficient, SC) The Silhouette Coefficient (Rousseeuw, 1987) is a measure of how similar a sample is to its own cluster compared to its nearest cluster. For a given data point $x_{i}$ , $sc(x_{i})$ is defined as:
$$\operatorname {s c} \left(x _ {i}\right) = \frac {b \left(x _ {i}\right) - a \left(x _ {i}\right)}{\operatorname* {m a x} \left(a \left(x _ {i}\right) , b \left(x _ {i}\right)\right)} \tag {9}$$
where $a(x_{i})$ is the average distance from point $x_{i}$ to all other points $x_{j}$ that share the same true label $y_{i} = y_{j}$ , and $b(x_{i})$ is the minimum average distance from point $x_{i}$ to all points $x_{j}$ that have a different true label $y_{i} \neq y_{j}$ .
Based on this definition, we know that SC focuses on measuring the local clustering ability of features, with higher values indicating better local clustering ability. Although the SC ranges from $[-1, 1]$ , the diversity of features learned through SSL can cause a large value of $\max(a(x_i), b(x_i))$ , leading to a smaller effective range for SC. Therefore, in this paper, we note that $\mathrm{SC} > 0$ indicates that the sample has been assigned to the correct cluster. For population statistics, we can compute the mean $\mathrm{SC}_{\mathrm{mean}}$ and standard deviation $\mathrm{SC}_{\mathrm{std}}$ over all data points in $\mathcal{X}$ .
Definition A.2. (Adjusted Rand Index, ARI) The Adjusted Rand Index (Hubert & Arabie, 1985) is a measure of the agreement between two partitions of data, adjusted for chance grouping. Given the true labels $\mathcal{V}$ and a set of predicted labels $\mathcal{Y}' = \{y_1', y_2', \ldots, y_N'\}$ , the ARI is defined as:
$$\mathrm {A R I} = \frac {\mathrm {R I} - \mathbb {E} [ \mathrm {R I} ]}{\max (\mathrm {R I}) - \mathbb {E} [ \mathrm {R I} ]} \tag {10}$$
where RI is the Rand Index, and $\mathbb{E}[\mathrm{RI}]$ is its expected value under random labeling.
In practice, the ARI can be computed using a contingency table between $\mathcal{V}$ and $\mathcal{V}'$ . Let $n_{ij}$ denote the number of data points assigned to the $i$ -th cluster in $\mathcal{V}$ and the $j$ -th cluster in $\mathcal{V}'$ . Defining $a_i = \sum_j n_{ij}$ and $b_j = \sum_i n_{ij}$ , then the ARI is calculated as:
$$\mathrm {A R I} = \frac {\sum_ {i , j} \binom {n _ {i j}} {2} - \left(\sum_ {i} \binom {a _ {i}} {2} \sum_ {j} \binom {b _ {j}} {2} \Big / \binom {N} {2}\right)}{\frac {1}{2} \left(\sum_ {i} \binom {a _ {i}} {2} + \sum_ {j} \binom {b _ {j}} {2}\right) - \left(\sum_ {i} \binom {a _ {i}} {2} \sum_ {j} \binom {b _ {j}} {2} \Big / \binom {N} {2}\right)}$$
where $\binom{n}{2} = \frac{n(n-1)}{2}$ is the binomial coefficient. The ARI ranges from $[-0.5, 1]$ , where an ARI close to 1 indicates a perfect agreement between the true and predicted labels, and an ARI close to 0 suggests that the prediction is no better than random assignment.
Typically, we apply $k$ -means ( $k$ is set to the true number of classes) clustering on $\mathcal{X}$ to obtain the pseudo labels $\mathcal{Y}'$ . Subsequently, ARI is used to measure the agreement between true and pseudo labels, thereby reflecting global clustering ability of the features and the extent to which similarity measures effectively capture the data structure.
# B. Details of Implementation
In this section, we provide the details and hyperparameters for ReSA pretraining and downstream evaluation.
# B.1. Datasets
- CIFAR-10 and CIFAR-100 (Krizhevsky et al., 2009), two small-scale datasets composed of $32 \times 32$ images with 10 and 100 classes, respectively. - ImageNet-100 (Tian et al., 2020), a random 100-class subset of ImageNet (Deng et al., 2009).
- ImageNet (Deng et al., 2009), the well-known largescale dataset with about 1.3M training images and 50K test images, spanning over 1000 classes. - COCO2017 (Lin et al., 2014), a large-scale object detection, segmentation, and captioning dataset with 330K images containing 1.5 million object instances. - We also evaluate on fine-grained datasets including CUB-200-2011 (Wah et al., 2011), Oxford-IIIT-Pets (Parkhi et al., 2012), Food-101 (Bossard et al., 2014), and Oxford-Flowers (Nilsback & Zisserman, 2008).
# B.2. Implementation Details of ReSA Pretraining
For clarity, we first provide the algorithm of ReSA in PyTorch-style pseudo-code:
E, Em: encoder, momentum encoder
G, Gm: projector mlp, momentum projector mlp
P: predictor mlp (optional)
Tw, T: weak, standard augmentation
temp: temperature = 0.4
for x in loader: # load a minibatch x with m samples
x1, x2 = Tw(x), T(x) # two augmentation views
h1, h2 = E(x1), E(x2) # encodings
z1, z2 = G(h1), G(h2) # embeddings (mxd)
if P: z1, z2 = P(z1), P(z2) # predicted embeddings
with torch.no_grad():
update_momentum.params(0.996 -> 1) # exponential moving average
h1m, h2m = Em(x1), Em(x2) # momentum encodings
z1m, z2m = Gm(h1m), Gm(h2m) # momentum embeddings (mxd)
assign $=$ sinkhorn(cos_sim(h1, h1m)) # compute representation assignment
loss $=$ cross_entropy(cos_sim(z1,z2m)/temp, assign)+\
cross_entropy(cos_sim(z2, z1m) / temp, assign)
return loss / 2
def cos_sim(x, y):
return norm(x) @ norm(y).T # L2-normalize
def cross_entropy(x, y):
loss = mean(y * log softmax(x, dim=1) + y.T * log softmax(x.T, dim=1))
return - loss / 2
def sinkhorn(scores, eps=0.05, nitters=3): # Here 'scores' should be a square matrix
Q = exp(scores / eps).T
$Q / = Q.\mathrm{sum}()$
m,_ = Q.shape
c = ones(m) / m
for_in range(niters):
$u = Q.\sum m(\text{dim} = 1)$
Q $\ast =$ (c / u).unsqueeze(1)
Q $\star =$ (c / Q-sum(dim=0)).unsqueeze(0)
return(Q/Q-sum(dim=0,keepdim=True)).T
Universal settings. In all experiments conducted in Section 5, we adopt a momentum network, consistent with the practices of most existing self-supervised learning (SSL) methods (Grill et al., 2020; Chen et al., 2021; Caron et al., 2021; Liu et al., 2022; Weng et al., 2024). While the momentum network is not necessary to prevent collapse in ReSA, it has been shown to effectively promote long-term learning in SSL models (He et al., 2020; Chen & He, 2021). The momentum coefficient, temperature, and Sinkhorn-Knopp parameters in ReSA are configured in accordance with the pseudo-code provided earlier, without requiring further tuning. Furthermore, a standard three-layer MLP is employed as the projector, featuring a hidden layer dimension of 2048 and an output embedding dimension of 512. For training on large-scale datasets, such as ImageNet-1K, we follow the practices of MoCoV3 (Chen et al., 2021) and MEC (Liu et al., 2022), appending a two-layer MLP predictor to the projector in ReSA. The hidden layer and embedding dimensions of the predictor are kept identical to those of the projector. Additionally, we adopt a conventional configuration: when using ConvNets as the encoder, batch normalization (BN) and ReLU activation are incorporated into the hidden layers of both the projector and predictor. However, for ViT-based encoders, we draw inspiration from DINO (Caron et al., 2021), omitting BN and replacing ReLU with the gaussian error linear units (GELU) activation. This modification ensures that ReSA operates as a $BN$ -free system during ViT training, eliminating the need for BN synchronization and offering an improvement in training efficiency.
Building on the aforementioned settings, the only modifications required pertain to optimizer-related parameters, including the learning rate, weight decay, and the number of warmup epochs. These adjustments are made in accordance with the specific encoder architecture and dataset used. Nonetheless, certain settings remain fixed. For instance, we adopt the linear scaling rule, setting the learning rate as $lr = \text{base} \, lr \times \text{batch size}/256$ . After the warmup phase, the learning rate follows a cosine decay schedule (Loshchilov & Hutter, 2017).
Details in training ConvNets. We follow the exact same optimization settings and parameters as INTL (Weng et al., 2024) when pretraining ConvNets. The SGD optimizer is used and detailed parameters are provided in Table 8. The only exception is when training ResNet-50 on ImageNet for 800 epochs, where we reduce the base lr to 0.4 to ensure training stability. Additionally, it is worth noting that we observe a slight performance drop in ReSA when the learning rate decreases to a very small value during the later stages of training. We hypothesize that an excessively small learning rate may amplify the regularization effect of weight decay in SGD, causing the weights to diverge from the optimal solution. To address this, we set the minimum learning rate in the cosine decay schedule to $0.1 * lr$ .
Table 8. Optimizer-related parameters in ReSA pretraining.
<table><tr><td>Method</td><td>dataset</td><td>encoder</td><td>predictor</td><td>optimizer</td><td>batch size</td><td>base lr</td><td>weight decay</td><td>warmup</td></tr><tr><td rowspan="6">ReSA</td><td>CIFAR-10</td><td>ResNet-18</td><td>X</td><td>SGD</td><td>256</td><td>0.3</td><td>10-4</td><td>2 epochs</td></tr><tr><td>CIFAR-100</td><td>ResNet-18</td><td>X</td><td>SGD</td><td>256</td><td>0.3</td><td>10-4</td><td>2 epochs</td></tr><tr><td>ImageNet-100</td><td>ResNet-18</td><td>X</td><td>SGD</td><td>128</td><td>0.5</td><td>2.5 × 10-5</td><td>2 epochs</td></tr><tr><td rowspan="3">ImageNet</td><td rowspan="2">ResNet-50</td><td rowspan="2">✓</td><td rowspan="2">SGD</td><td>256</td><td>0.5</td><td>10-5</td><td>2 epochs</td></tr><tr><td>1024</td><td>0.5</td><td>10-5</td><td>10 epochs</td></tr><tr><td>ViT-S/16</td><td>✓</td><td>AdamW</td><td>1024</td><td>5 × 10-4</td><td>0.1</td><td>40 epochs</td></tr></table>
Details in training ViTs. Vision Transformer (ViT) pre-training involves numerous intricate settings, such as initialization methods and optimization parameters, which have a significant impact on training outcomes. Notably, representative SSL methods on ViTs, such as DINO and MoCoV3, adopt totally distinct designs in both architecture and training strategies. DINO (Caron et al., 2021) leverages a range of training tricks, including weight decay scheduling, gradient clipping, and stochastic depth, among others. To stabilize training, it avoids mixed-precision training, which substantially reduces computational efficiency and increases memory requirements. MoCoV3 (Chen et al., 2021), on the other hand, proposes freezing the patch embedding layer to enhance training stability while enabling mixed-precision training. However, it still incorporates batch normalization (BN) in the projector and predictor MLPs, which reduces training efficiency and complicates its application in multi-view scenarios (Morningstar et al., 2024). Taking these considerations into account, we adopt the ViT design and initialization approach of MoCoV3 for ReSA, but remove the BN layers from the MLPs. This ensures that ReSA functions as a $BN$ -free system during ViT training, eliminating the need for BN synchronization and improving overall training efficiency. In this paper, we set the optimizer-related parameters as shown in Table 8. We
believe that further exploration of more suitable initialization methods and related parameters for ReSA could enhance its performance, as evidenced by its outstanding results on ConvNets.
# B.3. Implementation Details of ReSA Evaluating
Details in evaluating CIFAR-10/100. When evaluating on CIFAR-10/100, we adopt the same linear evaluation protocol as in W-MSE (Ermolov et al., 2021) and INTL (Weng et al., 2024): training a linear classifier for 500 epochs on each labeled dataset using the Adam optimizer, without data augmentation. The learning rate is exponentially decayed from $10^{-2}$ to $10^{-6}$ and the weight decay is $5 \times 10^{-6}$ . Under these settings, a single-GPU evaluation takes under one minute—substantially faster than the protocol in solo-learn (da Costa et al., 2022), which can take tens of minutes. We also apply this evaluation protocol to models provided by solo-learn; however, their performance degrades noticeably, so we report the official results in Table 1. In addition, following W-MSE and INTL, we evaluate a simple 5-nn classifier ( $k = 5$ ) on these datasets for completeness. We track both linear and $k$ -nn classifier accuracies for ReSA throughout training and observe that at certain checkpoints, ReSA achieves even higher performance than the final values reported in Table 1 (e.g., linear accuracies of $93.89\%$ on CIFAR-10 and $72.5\%$ on CIFAR-100). Nevertheless, we report only the final checkpoint's results for consistency.
Table 9. Optimal learning rate $\left( {lr}\right)$ for training linear classifiers.
<table><tr><td rowspan="2">Method</td><td colspan="3">pretrained settings</td><td rowspan="2">linear eval. lr</td></tr><tr><td>dataset</td><td>encoder</td><td>batch size</td></tr><tr><td rowspan="4">ReSA</td><td>ImageNet-100</td><td>ResNet-18</td><td>128</td><td>5</td></tr><tr><td rowspan="3">ImageNet</td><td rowspan="2">ResNet-50</td><td>256</td><td>10</td></tr><tr><td>1024</td><td>40</td></tr><tr><td>ViT-S/16</td><td>1024</td><td>0.03</td></tr></table>
Details in evaluating ImageNet-100/1K. For linear evaluation, we train the linear classifier for 100 epochs with SGD optimizer and using MultiStepLR scheduler with $\gamma = 0.1$ dropping at the last 40 and 20 epochs. In all our linear classifier training, we fix the batch size at 256 and set the weight decay to 0. However, when using different pretraining datasets, encoders, or batch sizes, the optimal learning rate for evaluation varies accordingly. The specific optimal values for each setting are provided in Table 9. In addition, when training the linear classifier with ViT-S/16, we follow BERT (Devlin, 2018) and DINO (Caron et al., 2021) by concatenating the [CLS] tokens from the last four layers.
Table 10. Low-shot evaluation. All models are pretrained on ImageNet with ResNet-50, and then fine-tuned with a linear classifier on $1\%$ or $10\%$ subset of ImageNet for 20 epochs. $\dagger$ indicates employing the multi-crop trick during pretraining.
<table><tr><td rowspan="2">Method</td><td colspan="2">top-1</td><td colspan="2">top-5</td></tr><tr><td>1%</td><td>10%</td><td>1%</td><td>10%</td></tr><tr><td>SimCLR</td><td>48.3</td><td>65.6</td><td>75.5</td><td>87.8</td></tr><tr><td>BYOL</td><td>53.2</td><td>68.8</td><td>78.4</td><td>89.0</td></tr><tr><td>\(\mathbf{S}\mathbf{w}\mathbf{A}\mathbf{V}^{\dagger}\)</td><td>53.9</td><td>70.2</td><td>78.5</td><td>89.9</td></tr><tr><td>Barlow Twins</td><td>55.0</td><td>69.7</td><td>79.2</td><td>89.3</td></tr><tr><td>VICReg</td><td>54.8</td><td>69.5</td><td>79.4</td><td>89.5</td></tr><tr><td>INTL</td><td>55.0</td><td>69.4</td><td>80.8</td><td>89.8</td></tr><tr><td>ReSA (ours)</td><td>56.4</td><td>70.4</td><td>81.0</td><td>90.1</td></tr></table>
We further evaluate the low-shot learning capability of ReSA in semi-supervised classification. Specifically, we fine-tune the pre-trained ReSA encoder and train a linear classifier for 20 epochs, using $1\%$ and $10\%$ subsets of ImageNet, following the same splits as SimCLR (Chen et al., 2020b). The optimization is conducted using the SGD optimizer with a learning rate of 0.0002 for the encoder and 40 for the classifier, under a batch size of 256, along with a cosine decay schedule. The results, presented in Table 10, demonstrate that ReSA also performs effectively in low-shot learning scenarios.












 Figure 9. Comparison of evaluation accuracies and clustering metrics among various SSL methods during the training process. The experiments are conducted using SimCLR, SwAV, VICReg, and ReSA. The settings and notations are consistent with ones in Figure 4.



Details in evaluating fine-grained datasets. In the evaluation experiments on fine-grained datasets presented in Table 6, we apply a weighted $k$ -nearest neighbors classifier following (Wu et al., 2018). We freeze the pretrained model to compute and store the features of the training data and use these features to select the nearest neighbors for the data in the test set. Based on the top $k$ -nearest neighbors $(\mathcal{N}_k)$ , predictions are made using a weighted voting mechanism. Specifically, the class $c$ receives a total weight of $\sum_{i \in \mathcal{N}_k} \alpha_i \mathbf{1}_{c_i = c}$ , where $\alpha_i$ represents the contribution weight. We compute $\alpha_i = \exp \left( \frac{T_i \cdot x}{\tau} \right)$ with $\tau$ set to 0.07 as described in (Wu et al., 2018) and used by DINO, without tuning this value.
# C. Additional analyses on ReSA
# C.1. Ablation Studies
As presented in Table 11, we conduct ablation studies to investigate the impact of network architecture design and temperature hyperparameter selection on ReSA performance. Our analysis reveals that employing a momentum network yields an accuracy improvement of approximately $2\%$ , albeit at the cost of increased computational overhead. In contrast, the integration of an additional predictor demonstrates a comparable accuracy gain of around $1\%$ while maintaining near-identical computational efficiency, exhibiting negligible impact on runtime performance.
Meanwhile, in contrast to contrastive learning methods and other approaches such as SwAV and DINO, which typically require a small temperature value (e.g. $\tau = 0.1$ ), ReSA achieves favorable performance with a higher temperature value ( $\tau = 0.4$ ). This indicates that the optimization process of ReSA can effectively incorporate a broader range of samples with better tolerance, rather than focusing exclusively on hard samples (Wang & Liu, 2021), as is the case with other methods.
Additionally, we conduct experiments to test the extraction of clustering information from embedding to obtain the self assignment $\mathbf{A_H}$ . The results shown in Figure 10 indicate that, under this condition, the loss struggles to converge, and the model's accuracy significantly declines compared to ReSA. This finding is consistent with the analyses in Section 3, where we note that the clustering properties of embedding are less stable and inferior to those of encoding, making it challenging for the model to effectively learn high-quality clustering information.
Table 11. Ablation studies on the network architecture and temperature hyperparameter of ReSA on ImageNet using ResNet-50 as the encoder. When evaluating the impact of different network architectures on ReSA, we set the batch size to 256 and perform pretraining using a single GPU.
<table><tr><td>Method</td><td>momentum</td><td>predictor</td><td>linear acc.</td><td>memory (GB)</td><td>time (h/epoch)</td></tr><tr><td rowspan="4">ReSA</td><td>✓</td><td>✓</td><td>71.9</td><td>25.2</td><td>0.78</td></tr><tr><td>✓</td><td>x</td><td>70.8</td><td>25.2</td><td>0.78</td></tr><tr><td>x</td><td>✓</td><td>69.7</td><td>24.3</td><td>0.58</td></tr><tr><td>x</td><td>x</td><td>68.7</td><td>24.3</td><td>0.58</td></tr></table>
<table><tr><td rowspan="2">Method</td><td rowspan="2">batch size</td><td colspan="4">temperature τ</td></tr><tr><td>0.2</td><td>0.3</td><td>0.4</td><td>0.5</td></tr><tr><td rowspan="2">ReSA</td><td>256</td><td>71.2</td><td>71.4</td><td>71.9</td><td>71.7</td></tr><tr><td>1024</td><td>70.9</td><td>71.1</td><td>71.3</td><td>71.2</td></tr></table>
 Figure 10. Ablation on extraction of clustering information from encoding vs. embedding to obtain the self-assignment $\mathbf{A_H}$ . Both are pretrained for 1000 epochs on CIFAR-100 using ResNet-18 under totally the same experimental settings provided in Appendix B.


 Figure 11. Visualization of the self-assignment matrix $\mathbf{A_H}$ during the early stages of training.



# C.2. How ReSA Avoids Feature Collapse and Early Clustering Error?
Although ReSA has demonstrated good performance in various experiments, it remains unclear how the model avoids feature collapse and clustering error in the early stages of training when it has not yet learned any clustering information.
To answer these questions, we first consider the loss formula of ReSA: $\ell_{\mathrm{ReSA}}(\mathbf{z}_i) = -\sum_{j=1}^{m} \mathbf{A}_{\mathbf{H}}^{(i,j)} \log \left(\frac{\exp(s_{i,j} / \tau)}{\sum_{k=1}^{m} \exp(s_{i,k} / \tau)}\right)$ .
Here, $\mathbf{A}_{\mathbf{H}}^{(i,j)}$ denotes the $(i,j)$ -th element of $\mathbf{A}_{\mathbf{H}}$ , where $\mathbf{A}_{\mathbf{H}} = \mathrm{Sinkhorn}(\mathbf{H}^{\top}\mathbf{H})$ . Given that the Sinkhorn-Knopp algorithm exhibits strict monotonicity, we have the property that if $\mathbf{h}_i^\top \mathbf{h}_j > \mathbf{h}_i^\top \mathbf{h}_k$ , then $\mathbf{A}_{\mathbf{H}}^{(i,j)} > \mathbf{A}_{\mathbf{H}}^{(i,k)}$ . Since the vectors in $\mathbf{H}$ are $L_{2}$ -normalized, the diagonal elements of $\mathbf{H}^{\top}\mathbf{H}$ are all maximized to 1. This implies that for any $i$ and $j$ , we have $\mathbf{A}_{\mathbf{H}}^{(i,i)} \geq \mathbf{A}_{\mathbf{H}}^{(i,j)}$ . Furthermore, due to the sharp distribution employed in Sinkhorn, the diagonal elements are significantly larger than the off-diagonal elements. This ensures that the optimization focus of ReSA remains on the alignment of augmented views from the same image, substantially reducing the impact of early assignment errors (off-diagonal elements) on the training process. Throughout training, the continual alignment enables the model to learn meaningful representations, which in turn facilitates correct cluster assignments in the later stages, further promoting learning. In contrast, other clustering-based methods such as SwAV and DINO require an initialized prototype for cluster assignment, making it more challenging to avoid early clustering errors. We speculate that this is one of the key reasons why ReSA outperforms these methods in terms of overall effectiveness.
We then visualize the self-assignment matrix $\mathbf{A_H}$ during the early stages of training. As shown in Figure 11, at model initialization, the assignment already exhibits a dominance of diagonal elements, reflecting an optimization trend that pulls augmented views from the same image closer together. As training progresses, we observe that the dominance of diagonal elements gradually strengthens, effectively preventing feature collapse in the model.
# C.3. Pretraining on Long-tailed Dataset
To further evaluate the training performance of ReSA on imbalanced datasets, we conduct experiments using four self-supervised learning methods—ReSA, MoCoV3, INTL, and VICReg—pretrained and evaluated on the long-tailed CIFAR100-LT dataset. We follow the setup on https://huggingface.co/datasets/tomas-gajarsky/cifar100-lt, setting an imbalance factor of 1/20, resulting in the CIFAR100-LT dataset containing 15,907 images. We train these four SSL models for 1000 epochs with ResNet-18 as the encoder and evaluate it on the full CIFAR100 test set. As observed in Figure 12, the loss values of these four methods converge well, but the final evaluation accuracy is significantly lower compared to training on the full CIFAR100 dataset in Table 1. Interestingly, we notice that ReSA's loss decreases more slowly in the early stages, and its accuracy improves more gradually than other methods. We hypothesize that this may be due to noisy initial clusters in the early stages of training, causing clustering errors. However, we find that as training progresses, ReSA's accuracy continues to rise in the mid-phase, surpassing all other methods. This suggests that ReSA is able to gradually resolve these issues and learn the correct clustering patterns as training advances, rather than amplifying errors. Overall, this experiment demonstrates that ReSA can also learn effective representations on long-tailed datasets.




 Figure 12. Pretraining on the long-tailed dataset. Here We report the training losses of four self-supervised learning methods on the CIFAR100-LT dataset, along with their evaluation performance on the full CIFAR-100 test set as measured by a linear probe and a k-NN classifier.


# C.4. The impact of weak augmentation on other methods
Since the design of weak augmentation (identical to that in ReSSL (Zheng et al., 2021)) provides a certain degree of performance improvement for ReSA, we also examine its impact on other self-supervised learning methods. Specifically, we select SwAV, VICReg, and MoCoV3, strictly following the experimental configurations in solo-learn (da Costa et al., 2022), with the only modification being the replacement of the image augmentation settings. As shown in Table 12, weak augmentation do not enhance the performance of these methods. This is likely because the standard augmentation settings have been extensively tuned through numerous experiments, ensuring optimal training conditions for these approaches.
Table 12. Investigate the impact of weak augmentation on other methods.
<table><tr><td rowspan="2">Method</td><td rowspan="2">weak aug.</td><td colspan="2">CIFAR-10</td><td colspan="2">CIFAR-100</td></tr><tr><td>linear</td><td>k-nn</td><td>linear</td><td>k-nn</td></tr><tr><td rowspan="2">SwAV</td><td>X</td><td>89.17</td><td>84.18</td><td>64.88</td><td>53.32</td></tr><tr><td>✓</td><td>88.79</td><td>84.01</td><td>64.21</td><td>53.07</td></tr><tr><td rowspan="2">VICReg</td><td>X</td><td>92.07</td><td>87.38</td><td>68.54</td><td>56.32</td></tr><tr><td>✓</td><td>91.35</td><td>86.75</td><td>67.27</td><td>55.79</td></tr><tr><td rowspan="2">MoCoV3</td><td>X</td><td>93.10</td><td>89.06</td><td>68.83</td><td>58.09</td></tr><tr><td>✓</td><td>93.05</td><td>89.09</td><td>68.72</td><td>58.02</td></tr></table>
# C.5. Discussion and Future Work
The relationship between image augmentation and SSL via joint embedding architectures has grown increasingly intricate. Over the past few years, many studies (Chen et al., 2020b; Grill et al., 2020; Wagner et al., 2022; Morningstar et al., 2024) have emphasized the critical role of image augmentation in JEA, demonstrating that making subtle modifications to image augmentations, such as merely adjusting the parameters of ResizedCrop and ColorJitter, can significantly impact the performance of SSL models. However, recent works (Assran et al., 2023; Moutakanni et al., 2024) have begun to challenge this paradigm by exploring new self-supervised learning frameworks that eliminate the reliance on hand-crafted data augmentations. These efforts argue that specific augmentations may introduce strong biases that could be detrimental to certain downstream tasks (Assran et al., 2022a) and that the most effective augmentations are often task-specific, depending on the domain, rather than adhering to universally hand-crafted settings (Bendidi et al., 2023; Asano et al., 2019; Geiping et al., 2022; Purushwalkam & Gupta, 2020).
Interestingly, Moutakanni et al. (2024) successfully demonstrate that hand-crafted or domain-specific data augmentations are not essential for training state-of-the-art joint embedding architectures when scaling self-supervised learning. Their findings reveal that, with sufficiently large datasets, simple crop of images alone can achieve remarkable results. Notably, this observation aligns perfectly with the characteristics of ReSA. As we show in Section 4.3, removing any single transformation enhances the clustering properties of the representations learned during training, enabling ReSA to better capture the inherent clustering information within the data. When the dataset size is sufficiently large, eliminating all hand-crafted data augmentations perfectly unleashes the innate potential of ReSA. We look forward to future research validating this hypothesis and applying ReSA to large-scale pretraining scenarios.123version https://git-lfs.github.com/spec/v1oid sha256:e163e2a25ede6431610385f79f8f3b1ba03f824ab29d110b14b32d5b8faf3ea5size 1382163123version https://git-lfs.github.com/spec/v1oid sha256:18acaba2d37e055aa3e7f09b6709fd8bde44fffdb4fcf38f32e2e4ce8db382a9size 781446123version https://git-lfs.github.com/spec/v1oid sha256:62251e66da77d75b4c18d526667da9ea192c9e5714e7ee13d86881ddc9dfaff5size 102900123version https://git-lfs.github.com/spec/v1oid sha256:cbb6d663fd421a00efb2f5df880e9e8bfa6eb3952593590f2720c922c2b46596size 129862123version https://git-lfs.github.com/spec/v1oid sha256:8d7c59979a6078b7b1c65971ad9cf6e792df94e08f87d01c800e091d533ceefdsize 8714749123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486# Roy Uziel 12 Irit Chelly 12 Oren Freifeld 123 Ari Pakman 432
# Abstract
Diffusion models, widely recognized for their success in generative tasks, have not yet been applied to clustering. We introduce Clustering via Diffusion (CLUDI), a self-supervised framework that combines the generative power of diffusion models with pre-trained Vision Transformer features to achieve robust and accurate clustering. CLUDI is trained via a teacher-student paradigm: the teacher uses stochastic diffusion-based sampling to produce diverse cluster assignments, which the student refines into stable predictions. This stochasticity acts as a novel data augmentation strategy, enabling CLUDI to uncover intricate structures in high-dimensional data. Extensive evaluations on challenging datasets demonstrate that CLUDI achieves state-of-the-art performance in unsupervised classification, setting new benchmarks in clustering robustness and adaptability to complex data distributions.
# 1. Introduction
Clustering is a fundamental task in unsupervised learning, essential for uncovering meaningful groupings within data. These groupings play a vital role in diverse downstream applications, such as image segmentation (Mittal et al., 2022; Friebel et al., 2022), anomaly detection (Song et al., 2021a), and bioinformatics (Karim et al., 2021). Despite significant advancements, traditional methods face significant challenges, particularly in datasets with intricate structures and varying intra-class similarity, where such approaches often struggle to capture underlying patterns (Ben-David, 2018). To address these limitations, deep learning-based clustering
$^{1}$ Department of Computer Science, Ben-Gurion University of the Negev, Beer Sheva, Israel $^{2}$ Data Science Research Center, Ben-Gurion University of the Negev, Beer Sheva, Israel $^{3}$ The School of Brain Sciences and Cognition, Ben-Gurion University of the Negev, Beer Sheva, Israel $^{4}$ Department of Industrial Engineering and Management, Ben-Gurion University of the Negev, Beer Sheva, Israel. Correspondence to: Roy Uziel <uzielr@post.bgu.ac.il>.
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
 Figure 1: Overview of the CLUDI Framework at Inference. Images pass through a pre-trained Vision Transformer to obtain their feature representations. Multiple random vectors are sampled from a Gaussian distribution. A diffusion model, conditioned on the features, refines the random vectors into class assignment embeddings. Each refined embedding corresponds to a candidate cluster probability vector. By averaging multiple such assignments, the framework produces robust and accurate clustering predictions.
approaches have gained substantial attention for their ability to tackle complex and diverse data landscapes (Zhou et al., 2024; Ren et al., 2024; Wei et al., 2024).
However, deep learning-based clustering methods still face persistent challenges that limit their practical utility. A primary issue is model collapse (Amrani et al., 2022), where learned representations degenerate into trivial solutions. Another obstacle arises from underutilizing pretrained features, resulting in suboptimal performance. Notably, Adaloglou et al. (2023) demonstrate that using pretrained Vision Transformers (Caron et al., 2021) can surpass methods that attempt to learn both representations and cluster assignments simultaneously, thereby highlighting
the effectiveness of high-quality feature initialization. Self-supervised representations have consistently outperformed supervised ones in transfer tasks (Ericsson et al., 2021), highlighting the benefits of leveraging powerful pre-trained models. Meanwhile, many clustering frameworks rely on complex augmentation pipelines, such as neighbor mining (Van Gansbeke et al., 2020; Adaloglou et al., 2023), or employ multiple clustering heads trained in parallel, selecting the best-performing one at evaluation time (Adaloglou et al., 2023; Amrani et al., 2022). Although these strategies can improve accuracy, they introduce additional complexity and computational overhead during training.
To address these limitations, we introduce Clustering via Diffusion (CLUDI), a self-supervised framework that leverages the generative strengths of diffusion models to produce robust cluster probabilities. As Figure 1 illustrates, CLUDI takes as input a pre-trained Vision Transformer feature vector $\mathbf{x} \in \mathbb{R}^n$ and refines an initial random assignment embedding vector through an iterative diffusion process. Conditioned on $\mathbf{x}$ , this process evolves over multiple steps and culminates in a final assignment embedding $\mathbf{z}_0 \in \mathbb{R}^d$ , which encodes the likelihood of each data point belonging to each of the $K$ clusters.
During inference, CLUDI generates multiple stochastic samples of $\mathbf{z}_0$ and aggregates the corresponding predictions. By averaging across diverse representations, this strategy mitigates uncertainty, uncovers subtle structures in high-dimensional feature spaces, and yields more stable and accurate cluster assignments, even in complex and diverse data scenarios.
Our model is trained using a self-supervised Siamese architecture comprising teacher and student branches. The teacher, implemented as a diffusion model, generates assignment embeddings $\mathbf{z}_0\in \mathbb{R}^d$ and cluster probabilities $p(k|\mathbf{x})$ for $k\in \{1,2,\dots ,K\}$ , through stochastic sampling. These outputs, which capture diverse and complementary views of the data, serve as targets for the student.
The student adapts its predictions to match the teacher's outputs, enabling it to uncover meaningful and distinct clusters in the data. The training process optimizes two complementary objectives: an asymmetric non-contrastive loss (Grill et al., 2020; Chen & He, 2021; Caron et al., 2021) for the assignment embedding $\mathbf{z}_0$ and a non-collapsing cross-entropy loss for the cluster probabilities $p(k|\mathbf{x})$ . To facilitate effective clustering and prevent trivial solutions, the cross-entropy loss incorporates a uniform prior over the data minibatch (Amrani et al., 2022), encouraging well-separated and diverse cluster assignments.
# Why use diffusion for clustering?
Despite their success in generative tasks, diffusion models have not been explored for clustering until now. We ar
gue, however, that their ability to model and sample from complex, high-dimensional distributions makes them particularly suited for clustering high-dimensional data, such as images. By iteratively refining noisy representations, diffusion models can uncover underlying structure and variability in the data, providing a natural mechanism for capturing meaningful cluster assignments. Their stochastic nature further enables robust and diverse clustering predictions.
# Our key contributions are as follows:
- We introduce Clustering via Diffusion (CLUDI), a novel framework that is the first to leverage diffusion models for the clustering task. - We propose a self-supervised training paradigm based on a teacher-student architecture, where a diffusion model generates stochastic and informative cluster assignments to guide the student in learning meaningful cluster probabilities. - We demonstrate the effectiveness of CLUDI through extensive evaluations on benchmark datasets, achieving state-of-the-art accuracy and robustness in unsupervised classification tasks.
# 2. Related Work
Deep learning-based models that learn to cluster are usually referred to as performing deep clustering or unsupervised classification. Cluster categories are learned during the training phase and remain fixed during inference. These methods have received much interest in the machine learning community. Comprehensive reviews on this vast field can be found in (Zhou et al., 2024; Ren et al., 2024; Wei et al., 2024).
End-to-end training. Most previous works learn simultaneously feature representations and cluster categories. An early work in this area is Deep Embedded Clustering (DEC) (Xie et al., 2016), which jointly optimizes feature learning through an autoencoder and assigns clusters using a Kullback-Leibler (KL) divergence-based loss. Although DEC can be effective in learning clusters, its performance is sensitive to initialization and prone to model collapse.
DeepCluster (Caron et al., 2018) takes a different approach by alternating between pseudo-label generation and feature representation refinement. The method iteratively updates cluster centroids and uses the centroids to assign pseudolabels, which are then used to optimize the feature space. However, the computational overhead associated with generating and updating pseudo-labels can be significant, especially for large-scale datasets.
Invariant Information Clustering (IIC) (Ji et al., 2019) offers a complementary method by maximizing mutual in
formation between different augmentations of the same data. Among probabilistic approaches, Variational Deep Embedding (VaDE) (Jiang et al., 2016) integrates variational autoencoders with Gaussian mixture models to learn probabilistic cluster assignments. Recent works leverage popular self-supervised approaches. Self-Classifier (Amrani et al., 2022) uses a Siamese network to simultaneously learn representation and cluster labels. To avoid degenerate solutions, it uses a variant of the cross-entropy loss which we adopt in our model.
Training on pre-trained features. The idea of decoupling feature learning from cluster learning has been advocated by SCAN (Van Gansbeke et al., 2020) and TwoStageUC (Han et al., 2020). These models, however, lack efficiency, as they learn features from scratch for every dataset.
The use of pre-trained features, particularly Vision Transformers (ViTs) (Dosovitskiy, 2020), was proposed by TSP (Zhou & Zhang, 2022) and TEMI (Ren et al., 2024). These approaches allow the model to focus on refining cluster assignments without relearning low-level features, significantly reducing the computational cost for large-scale datasets. Our CLUDI approach relies on a similar feature extraction backbone, based on the DINO model (Caron et al., 2021), but proposes a more refined clustering model and training setup that leads to superior results.
DeepDPM (Ronen et al., 2022), which can be used in either end-to-end fashion or with pretrained features, is a deep clustering method that infers $K$ and is inspired by a Dirichlet process mixture sampler (Chang & Fisher III, 2013; Dinari et al., 2019). However, unlike CLUDI, it makes a stringent assumption about the distribution of the features within each cluster.
Amortized clustering. In another approach, called amortized clustering, the model does not learn fixed cluster categories. Instead, it learns to organize full datasets into clusters discovered at test time. This approach allows for real-time adaptation of clusters as new data is introduced. It is thus a form of meta-learning (Hospedales et al., 2021), and research on this task is just beginning to unfold (Pakman et al., 2020; Jurewicz et al., 2023; Wang et al., 2024; Chelly et al., 2025).
# 3. Background
Diffusion Models. Denoising diffusion probabilistic models (DDPMs) are a recent pivotal shift in the landscape of generative modeling (Sohl-Dickstein et al., 2015; Ho et al., 2020), with considerable success across a range of applications, including image synthesis, audio generation, and molecular design (Song et al., 2021b; Dhariwal & Nichol, 2021; Nichol & Dhariwal, 2021; Rombach et al., 2022). In
DDPMs, an initial data sample denoted by $\mathbf{z}_0\in \mathbb{R}^d$ , is transformed into pure Gaussian noise, $\mathbf{z}_T\sim \mathcal{N}(\mathbf{0},\mathbf{I}_d),\mathbf{z}_T\in \mathbb{R}^d$ through a sequence of incremental additions of Gaussian noise. This forward process is Markovian and defined by:
$$q \left(\mathbf {z} _ {t} \mid \mathbf {z} _ {t - 1}\right) = \mathcal {N} \left(\mathbf {z} _ {t}; \sqrt {1 - \beta_ {t}} \mathbf {z} _ {t - 1}, \beta_ {t} \mathbf {I} _ {d}\right), \tag {1}$$
where we introduced discrete time steps $t = 1 \dots T$ , we assume $T = 1000$ , and $\beta_{t}$ is a predefined noise schedule. Note that the forward processes in Equation 1 allows closed-form sampling at any timestep $t$ . Using the notation $\alpha_{t} := 1 - \beta_{t}$ and $\bar{\alpha}_{t} := \prod_{s=1}^{t} \alpha_{s}$ , we have:
$$q \left(\mathbf {z} _ {t} \mid \mathbf {z} _ {0}\right) = \mathcal {N} \left(\mathbf {z} _ {t}; \sqrt {\bar {\alpha} _ {t}} \mathbf {z} _ {0}, (1 - \bar {\alpha} _ {t}) \mathbf {I} _ {d}\right). \tag {2}$$
DDPMs are a set of deep network models and sampling techniques which reverse this process: starting from a sample $\mathbf{z}_T \sim \mathcal{N}(\mathbf{0}, \mathbf{I}_d)$ , one generates samples at earlier times until a sample $\mathbf{z}_0$ from the data distribution is obtained.
In the next section we present the particular model and sampling technique we use in CLUDI. For more details on diffusion models see recent overviews (Luo, 2022; Turner et al., 2024; Chan, 2024; Nakkiran et al., 2024). We use discrete time steps $t$ , but continuous time formulations also exist (Song et al., 2021c). Note that our use of diffusions in continuous space to generate discrete data resembles their use to generate discrete language tokens (Dieleman et al., 2022; Gao et al., 2024; Gong et al., 2022; Li et al., 2022).
Self-Supervision. Self-supervised learning (SSL) has emerged as a powerful paradigm for learning from unlabeled data. The type of SSL that we employ uses a Siamese architecture (Chicco, 2021), where two views of the input produce different representations. The model is trained to ensure that these representations are informative and mutually predictable. A major challenge is avoiding model collapse, where the representations become mutually predictive by minimizing the information about the inputs.
Several mechanisms have been proposed in the SSL context to avoid collapse, such as contrastive losses (Chen et al., 2020; Jaiswal et al., 2020) or clustering constraints (Caron et al., 2018; 2021). In this work we adopt the teacher-student framework (Grill et al., 2020; Chen & He, 2021; Caron et al., 2021), in which the teacher model generates labels for the data which the student learns to predict. As we will detail in Section 5, we avoid collapse via stop-gradients, a predictor layer, and strong prior assumptions. We refer the reader to recent SSL surveys (Balestriero et al., 2023; Ozbulak et al., 2023; Shwartz Ziv & LeCun, 2024; Gui et al., 2024) for thorough overviews.
# 4. Clustering via Diffusion
Clustering via Diffusion (CLUDI) is a latent variable model for classification of the form
$$p _ {\theta} (k | \mathbf {x}) = \int d \mathbf {z} _ {0} p (k | \mathbf {z} _ {0}) p _ {\theta} (\mathbf {z} _ {0} | \mathbf {x}) \simeq \frac {1}{B} \sum_ {i = 1} ^ {B} p (k | \mathbf {z} _ {0} ^ {i}), \tag {3}$$
where the last term is a Monte Carlo approximation obtained from $B$ samples of $p_{\theta}(\mathbf{z}_0|\mathbf{x})$ , a data-conditioned diffusion model that generates assignment embeddings. The classification head is a simple logit projection followed by a tempered softmax,
$$\begin{array}{l} p (k | \mathbf {z} _ {0}) = \frac {\exp \left(\frac {[ \mathbf {L} \mathbf {z} _ {0} ] _ {k}}{\tau}\right)}{\sum_ {j = 1} ^ {K} \exp \left(\frac {[ \mathbf {L} \mathbf {z} _ {0} ] _ {j}}{\tau}\right)} (4) \\ \equiv \mathbf {u} _ {k}. (5) \\ \end{array}$$
where $\mathbf{L} \in \mathbb{R}^{K \times d}$ . Figure 1 illustrates the averaging over $B = 4$ samples of $\mathbf{z}_0$ , while Figure 2 shows classification accuracy as a function of $B$ for both clean and noise-augmented data.
Starting from an initial Gaussian sample
$$\mathbf {z} _ {T} \sim \mathcal {N} (\mathbf {0}, F ^ {2} \mathbf {I} _ {d}), \tag {6}$$
the diffusion model outputs $\mathbf{z}_0\in \mathbb{R}^d$ . For reverse sampling we adopt a stochastic version of the Denoising Diffusion Implicit Model (DDIM) (Song et al., 2021b), which allows sampling backwards at arbitrarily earlier times $s < t$ by running the backward dynamics
$$p _ {\theta} (\mathbf {z} _ {s} | \mathbf {z} _ {t}) = \mathcal {N} (\mathbf {z} _ {s}; \boldsymbol {\mu} _ {\theta} (\mathbf {z} _ {t}, \mathbf {x}, s, t), F ^ {2} \sigma_ {| t} ^ {2} \mathbf {I} _ {d}), \tag {7}$$
for $s < t$ , where
$$\begin{array}{l} \boldsymbol {\mu} _ {\theta} (\mathbf {z} _ {t}, \mathbf {x}, s, t) = \sqrt {\alpha_ {s}} \left(\frac {\mathbf {z} _ {t} - \sqrt {1 - \alpha_ {t}} \epsilon_ {\theta} ^ {(t)} (\mathbf {z} _ {t} , \mathbf {x})}{\sqrt {\alpha_ {t}}}\right) \\ + \sqrt {1 - \alpha_ {s} - \sigma_ {s} ^ {2}} \cdot \epsilon_ {\theta} ^ {(t)} (\mathbf {z} _ {t}, \mathbf {x}) \tag {8} \\ \end{array}$$
$$\sigma_ {s \mid t} = \sqrt {\frac {1 - \alpha_ {s}}{1 - \alpha_ {t}} \left(1 - \frac {\alpha_ {t}}{\alpha_ {s}}\right)}, \tag {9}$$
and we defined
$$\epsilon_ {\theta} ^ {(t)} \left(\mathbf {z} _ {t}, \mathbf {x}\right) = \frac {\mathbf {z} _ {t} - \sqrt {\bar {\alpha} _ {t}} \tilde {\mathbf {z}} _ {\theta} \left(\mathbf {z} _ {t} , \mathbf {x} , t\right)}{\sqrt {1 - \alpha_ {t}}}. \tag {10}$$
Here $\tilde{\mathbf{z}}_{\theta}(\mathbf{z}_t,\mathbf{x},t):\mathbb{R}^d\to \mathbb{R}^d$ is a network that predicts $\mathbf{z}_0$ and is trained by minimizing
$$\mathbb {E} _ {\mathbf {z} _ {0}, \mathbf {z} _ {t}, t, \mathbf {x}} \left[ w (t) \| \tilde {\mathbf {z}} _ {\theta} (\mathbf {z} _ {t}, \mathbf {x}, t) - \mathbf {z} _ {0} \| ^ {2} \right]. \tag {11}$$
Here $w(t)$ are fixed weights. This loss is a weighted variational lower bound on the data log-likelihood. In modeling
 Figure 2: Classification accuracy for clean and augmented inputs. The model classification accuracy on augmented data (feature dropout plus Gaussian noise) becomes similar to that of clean data as the number of data samples grows. Results from ImageNet 100 validation data. Standard deviation based on 10 repetitions.
$\tilde{\mathbf{z}}_{\theta}$ we have followed (Salimans & Ho, 2022), but there exist other possibilities, such as modeling $\epsilon_{\theta}^{(t)}$ , which represents the added noise in Equation 2.
We treat the noise scale $F^2$ in Eqs.(6)-(7) as an hyperparameter (Gao et al., 2024). Note that the above backward sampling requires choosing the values for the time steps in Equation 7, a freedom we exploit below in our training scheme.
Noise schedule. As in Li et al. (2022) we adopt the sqrt noise schedule with $\alpha_0 = \bar{\alpha}_0 = 1$ and
$$\bar {\alpha} _ {t} = 1 - \sqrt {t / T + 0 . 0 0 0 1}, t \geq 1. \tag {12}$$
As shown in Figure 3, this schedule accounts for the reduced sensitivity of the discrete labels to noise added near $t = 0$ , leading to most of the noise in Equation 2 being introduced at lower $t$ values. As $t$ grows, the noise addition slows down, easing the learning process of the denoising network.
 Figure 3: sqrt noise scheduling. The noise grows faster near $t = 0$ , reflecting reduced sensitivity to noise at early timesteps, and grows gradually slower at later times.
# 5. Learning via Self-Distillation
CLUDI follows a self-supervised learning framework based on self-distillation, similar to BYOL (Grill et al., 2020), Sim-SIAM (Chen & He, 2021) and DINO (Caron et al., 2021).
 Figure 4: Overview of CLUDI's training phase. Given a set of image features $\mathbf{x}$ , the teacher model generates denoised assignment embeddings $\tilde{\mathbf{z}}_0$ which are used to create two targets for the student: (i) clustering probabilities $\mathbf{u}$ and (ii) assignment embeddings $\mathbf{z}_0$ , obtained from $\mathbf{u}$ via a predictor layer. The student network aims to predict both targets based on a version of $\mathbf{x}$ corrupted by feature dropout plus Gaussian noise. Components whose parameters are updated via gradient-based optimization are marked with the $\nabla$ symbol.
In this setup, two versions of the network process different representations of the same data $\mathbf{x}$ , and one network predicts the output of the other. We adopt the SimSIAM approach, where the teacher and student networks share weights, unlike BYOL and DINO, where the teacher is updated via an exponential moving average of the student.
A key distinction of CLUDI is that, for each data point $\mathbf{x}$ , the student has two different learning targets: the denoised assignment embedding $\mathbf{z}_0$ and the classification probabilities $u_{k}$ (Equation 5). Each target requires different strategies to avoid trivial solutions. For the embeddings $\mathbf{z}_0$ , gradients are applied only to the student while keeping the teacher fixed, and a projection and normalization layer is added to structure the teacher's output into a useful learning target (Grill et al., 2020; Chen & He, 2021; Caron et al., 2021): These modifications prevent representational collapse and provide informative embeddings, though their precise effect remains an active area of research (Tian et al., 2021; Wang et al., 2021; Liu et al., 2022; Tao et al., 2022; Richemond et al., 2023; Halvagal et al., 2023).
To avoid collapse when learning the softmax cluster probabilities $\mathbf{u}_k$ , we enforce a uniform prior over mini-batches that regularizes the cross-entropy loss (Amrani et al., 2022).
Figure 4 summarizes the sequence of teacher and student operations from the input data into the loss function. In the following section, we provide more details on our choices
for the teacher, the student, and the loss function.
# 5.1. Teacher model
The teacher generates cluster probabilities $\mathbf{u}$ and assignment embeddings, $\mathbf{z}_0$ which serve as training targets for the student. It receives $N$ input feature vectors $\mathbf{x}^i\in \mathbb{R}^n$ , $i\in [1,N]$ , and runs the denoising algorithm $B$ times for each of them, yielding $B\times N$ denoised embeddings $\tilde{\mathbf{z}}_0^{b,i}\in \mathbb{R}^d$ . The time schedule of the teacher denoising is chosen to contain 25 equally-spaced timesteps from $t = T = 1000$ to $t = 0$ , offering a balance between efficient denoising and capturing essential cluster characteristics. Acting on $\tilde{\mathbf{z}}_0^{b,i}$ with $\mathbf{L}$ and a softmax (see Equation 4-Equation 5), yields $B\times N$ probability targets $\mathbf{u}^{b,i}\in \mathbb{R}^{K}$ for the student.
Empirically, however, the learning is less effective when the student's targets directly the denoised embeddings $\tilde{\mathbf{z}}_0^{b,i}$ . Instead, we map the probabilities $\mathbf{u}^{b,i}$ back to the embedding space by means of an embedding matrix $\mathbf{E} \in \mathbb{R}^{d \times K}$ , and then normalize and scale the target embeddings as
$$\mathbf {z} _ {0} ^ {b, i} = \sqrt {d} \frac {\mathbf {E u} ^ {b , i}}{\| \mathbf {E u} ^ {b , i} \| _ {2}}. \tag {13}$$
The role of $\mathbf{E}$ is akin to the predictor network in BYOL or SimSIAM, which assists in generating effective representations during training. Once the model is fully trained, however, $\mathbf{E}$ is no longer required. Given the above embed
dings, the teacher class probabilities are
$$\mathbf {u} ^ {b, i} = \frac {\exp \left(\frac {\left[ \mathbf {L} \mathbf {z} _ {0} ^ {b , i} \right] _ {k}}{\tau}\right)}{\sum_ {j = 1} ^ {K} \exp \left(\frac {\left[ \mathbf {L} \mathbf {z} _ {0} ^ {b , i} \right] _ {j}}{\tau}\right)}. \tag {14}$$
# 5.2. Student model
The student network aims to predict both targets in Equation 13 and Equation 14. Since the input $\mathbf{x}$ consists of pretrained features, we use an abstract augmentation strategy. For each data feature vector $\mathbf{x}^i\in \mathbb{R}^D$ , $i\in [1,N]$ , we create $B$ augmented versions $\mathbf{x}^{b,i}$ , $b\in [1,B]$ , each obtained by first zeroing the components of $\mathbf{x}^i$ with probability 0.2, and then adding zero-mean Gaussian noise, with variance $\sigma^2$ sampled uniformly in $[0.1,0.3]$ . We present the student with noisy versions of the teacher's outputs in Equation 13,
$$\mathbf {z} _ {t _ {b}} ^ {b, i} \sim \mathcal {N} \left(\sqrt {\bar {\alpha} _ {t b}} \mathbf {z} _ {0} ^ {b, i}, (1 - \bar {\alpha} _ {t b}) F ^ {2} \mathbf {I} _ {\mathbf {d}}\right), \tag {15}$$
where $t_b$ is sampled uniformly from $[0, T]$ . We denote the student predictions for the denoised assignment embedding and class probabilities as
$$\hat {\mathbf {z}} _ {0} ^ {b, i} = \tilde {\mathbf {z}} _ {\theta} \left(\mathbf {z} _ {t _ {b}} ^ {b, i}, \mathbf {x} ^ {b, i}, t _ {b}\right), \tag {16}$$
$$\hat {\mathbf {u}} ^ {b, i} = \frac {\exp \left(\frac {[ \mathbf {L} \hat {\mathbf {z}} _ {0} ^ {b , i} ] _ {k}}{\tau}\right)}{\sum_ {j = 1} ^ {K} \exp \left(\frac {[ \mathbf {L} \hat {\mathbf {z}} _ {0} ^ {b , i} ] _ {j}}{\tau}\right)}. \tag {17}$$
# 5.3. Augmented views
Having presented the teacher and student models, we note that their different views of the data and assignment embeddings originate from (i) the stochastic nature of the teacher denoising, which starts with pure noise in Equation 6 and performs 25 sampling steps, (ii) the augmentation of the student feature vector (feature dropout + Gaussian noise) and (iii) the noise added in Equation 15 to the embedding that the student is required to denoise. We remark that unlike common augmentation strategies acting on raw images (cropping, color alterations, etc), our augmentations act directly on the data features or their assignment embeddings. In particular, the views generated by (i) and (iii) exploit the intrinsic randomness of the diffusion model.
# 5.4. Loss functions
Embeddings. We employ an MSE loss between the teacher denoised embeddings $\mathbf{z}_0^{b,i}$ from Equation 13 and the student-predicted embeddings $\hat{\mathbf{z}}_0^{b,i}$ from Equation 16:
$$\ell_ {d i f} \left(\mathbf {z} _ {0} ^ {b, i}, \hat {\mathbf {z}} _ {0} ^ {b, i}\right) = \left\| \mathbf {z} _ {0} ^ {b, i} - \hat {\mathbf {z}} _ {0} ^ {b, i} \right\| ^ {2}. \tag {18}$$
Class probabilities. We use here a more explicit notation for the teacher and student class probabilities, respectively,
as defined Equation 14 and Equation 17,
$$p (k | \mathbf {z} _ {0} ^ {b, i}) = \mathbf {u} _ {k} ^ {b, i}, \quad p (k | \hat {\mathbf {z}} _ {0} ^ {b, i}) = \hat {\mathbf {u}} _ {k} ^ {b, i}. \tag {19}$$
Naively using a cross entropy loss,
$$\ell \left(\hat {\mathbf {z}} _ {0} ^ {b, i}, \mathbf {z} _ {0} ^ {b, i}\right) = - \sum_ {k} p \left(k \mid \mathbf {z} _ {0} ^ {b, i}\right) \log p \left(k \mid \hat {\mathbf {z}} _ {0} ^ {b, i}\right), \tag {20}$$
quickly degenerates to a solution that puts all the probability on a single category. We regularize this loss using an idea from Amrani et al. (2022), which amounts to treating the indices $(b,i)$ as random variables with a uniform prior $p(\hat{\mathbf{z}}_0^{b,i}) = 1 / (NB)$ and a distribution conditioned on $k$ given by a column softmax
$$p \left(\mathbf {z} _ {0} ^ {b, i} \mid k\right) = \frac {\exp \left(\frac {\left[ \mathbf {L} \mathbf {z} _ {0} ^ {b , i} \right] _ {k}}{\tau_ {c o l}}\right)}{\sum_ {b ^ {\prime} , i ^ {\prime} = 1} ^ {B , N} \exp \left(\frac {\left[ \mathbf {L} \mathbf {z} _ {0} ^ {b ^ {\prime} , i ^ {\prime}} \right] _ {k}}{\tau_ {c o l}}\right)}, \tag {21}$$
with its own temperature $\tau_{col}$ . Assuming also a uniform class prior $p(k) = 1 / K$ , Bayes rule and the law of total probability imply
$$p (k | \mathbf {z} _ {0} ^ {b, i}) = \frac {p \left(\mathbf {z} _ {0} ^ {b , i} \mid k\right) p (k)}{p \left(\mathbf {z} _ {0} ^ {b , i}\right)} = \frac {p \left(\mathbf {z} _ {0} ^ {b , i} \mid k\right)}{\sum_ {k = 1} ^ {K} p \left(\mathbf {z} _ {0} ^ {b , i} \mid k\right)}, \tag {22}$$
$$p \left(k \mid \hat {\mathbf {z}} _ {0} ^ {b, i}\right) = \frac {p (k) p \left(k \mid \hat {\mathbf {z}} _ {0} ^ {b , i}\right)}{p (k)} = \frac {(N B / K) p \left(k \mid \hat {\mathbf {z}} _ {0} ^ {b , i}\right)}{\sum_ {b ^ {\prime} , i ^ {\prime} = 1} ^ {B , N} p \left(k \mid \hat {\mathbf {z}} _ {0} ^ {b ^ {\prime} , i ^ {\prime}}\right)}. \tag {23}$$
Inserting these expressions in Equation 20 leads to a loss which was shown in (Amrani et al., 2022) not to admit collapsed distributions as optimal solutions. In practice, we use a symmetric version of Equation 20,
$$\ell_ {c l s} (b, i) = \frac {1}{2} \left(\ell \left(\hat {\mathbf {z}} _ {0} ^ {b, i}, \mathbf {z} _ {0} ^ {b, i}\right) + \ell \left(\mathbf {z} _ {0} ^ {b, i}, \hat {\mathbf {z}} _ {0} ^ {b, i}\right)\right). \tag {24}$$
Weighting the minibatch elements. Addressing the varying difficulty of the predictions of $\mathbf{z}_0^{b,i},\mathbf{u}^{b,i}$ based on the sampled timestep $t_b$ , we incorporate the Min-SNR- $\gamma$ (Hang et al., 2023) loss weighting strategy, which treats each timestep's denoising task as distinct and assigns weights based on their difficulty:
$$\mathrm {S N R} _ {t _ {b}} = \frac {\bar {\alpha} _ {t _ {b}}}{1 - \bar {\alpha} _ {t _ {b}}}, \tag {25}$$
$$w _ {b} = \frac {\operatorname* {m a x} \left(\mathrm {S N R} _ {t _ {b}} , \gamma\right)}{\mathrm {S N R} _ {t _ {b}} + 1}, \tag {26}$$
where $\gamma$ is a predefined threshold set to 5, enhancing the stability and ensuring that no single noise level dominates during training. The overall loss function, which incorporates these weights, is structured as follows:
$$\mathcal {L} = \frac {1}{B N} \sum_ {b, i = 1} ^ {B, N} w _ {b} \left(\ell_ {d i f} \left(\mathbf {z} _ {0} ^ {b, i}, \hat {\mathbf {z}} _ {0} ^ {b, i}\right) + \lambda \ell_ {c l s} (b, i)\right). \tag {27}$$
This formulation enables a nuanced control over the learning process, adapting to the challenges posed by different levels of noise.
 Figure 5: Left: t-SNE visualization of the assignment embedding space of ImageNet 50 demonstrating the model's ability to organize data points into well-separated clusters. Right: Examples of correctly classified images
# 6. Experiments
Datasets. We evaluate CLUDI on a comprehensive suite of benchmark datasets to rigorously assess its scalability, adaptability, and clustering performance. The datasets include subsets of ImageNet (Deng et al., 2009), Oxford-IIIT Pets (Parkhi et al., 2012) (with $K = 32$ ), Oxford 102 Flower (Nilsback & Zisserman, 2008), Caltech 101 (Fei-Fei et al., 2004), CIFAR-10 (Krizhevsky et al., 2009), and STL-10 (Coates et al., 2011). Each dataset introduces unique challenges: the ImageNet subsets cover broad and diverse categories, providing a robust test of scalability (see Table 2); Oxford-IIIT Pets and Oxford 102 Flower focus on fine-grained distinctions that assess CLUDI's precision; Caltech 101 evaluates generalization across diverse object types; and CIFAR-10 and STL-10 offer additional complex data that further validate CLUDI's ability to handle intricate clustering tasks (Table 1).
Evaluation Metrics. We use three popular metrics (Fahad et al., 2014): (i) Normalized Mutual Information (NMI) quantifies shared information between predicted and ground-truth clusters; (ii) Clustering Accuracy (ACC) measures the alignment of predictions with true labels; (iii) Adjusted Rand Index (ARI) adjusts for chance, providing a robust measure of similarity between predicted and true clusters.
Experimental Setup. For all experiments, we use features
from DINO (Caron et al., 2021) based on Vision Transformers (ViT-S/16 and ViT-B/16) pre-trained on ImageNet. We present comparisons with four leading self-supervised clustering models: SCAN (Van Gansbeke et al., 2020), Propos (Huang et al., 2022), TSP (Zhou & Zhang, 2022) and TEMI (Adaloglou et al., 2023). We implement a variant of Self-Classifier (Amrani et al., 2022), denoted as SelfClassifier*, in which the feature extractor is frozen and only the classification heads are optimized. This setup ensures that CLUDI and Self-Classifier* share identical feature representations, enabling a more direct and fair comparison.
All CLUDI results were obtained by running the embedding denoising for 100 equally spaced time steps. Figure 6 presents the ablation of the classification-loss weight $\lambda$ , while Figure 7 illustrates the results of scanning different values of the embedding dimension $d$ in Equation 27. For additional implementation details and ablations, see our Appendix.
Results. CLUDI achieves state-of-the-art performance across all tested datasets, consistently outperforming previous approaches on clustering tasks of varying complexity. As detailed in Table 1 and Table 2, CLUDI significantly surpasses established baselines in NMI, ACC, and ARI, especially on ImageNet subsets, showcasing its robustness in both general and fine-grained clustering scenarios.
Table 1: Clustering performances on smaller datasets. The results for SCAN, Propos, TSP, and TEMI on CIFAR-10 and STL-10 are from the original papers, except for TEMI (ViT-S/16), which we trained using the official code. For the Oxford and Caltech datasets, we trained all models. The best result is shown in bold, the second best is underlined.
<table><tr><td>Methods</td><td>NMI (%)</td><td>ACC (%)</td><td>ARI (%)</td></tr><tr><td colspan="4">CIFAR 10</td></tr><tr><td>SCAN (Resnet50)</td><td>79.7</td><td>88.3</td><td>77.2</td></tr><tr><td>Propos (Resnet18)</td><td>88.6</td><td>94.3</td><td>88.4</td></tr><tr><td>TSP (ViT-S/16)</td><td>84.7</td><td>92.1</td><td>83.8</td></tr><tr><td>TSP (ViT-B/16)</td><td>88.0</td><td>94.0</td><td>87.5</td></tr><tr><td>TEMI (ViT-S/16)</td><td>85.4</td><td>92.7</td><td>84.8</td></tr><tr><td>TEMI (ViT-B/16)</td><td>88.6</td><td>94.5</td><td>88.5</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>83.8</td><td>91.2</td><td>82.1</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>84.2</td><td>89.0</td><td>80.3</td></tr><tr><td>Ours (ViT-S/16)</td><td>88.0</td><td>94.2</td><td>87.7</td></tr><tr><td>Ours (ViT-B/16)</td><td>89.6</td><td>95.3</td><td>89.8</td></tr><tr><td colspan="4">STL 10</td></tr><tr><td>SCAN (Resnet50)</td><td>69.8</td><td>80.9</td><td>64.6</td></tr><tr><td>Propos (Resnet18)</td><td>75.8</td><td>86.7</td><td>73.7</td></tr><tr><td>TSP (ViT-S/16)</td><td>94.1</td><td>97.0</td><td>93.8</td></tr><tr><td>TSP (ViT-B/16)</td><td>95.8</td><td>97.9</td><td>95.6</td></tr><tr><td>TEMI (ViT-S/16)</td><td>85.0</td><td>88.8</td><td>80.1</td></tr><tr><td>TEMI (ViT-B/16)</td><td>96.5</td><td>98.5</td><td>96.8</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>90.5</td><td>83.1</td><td>82.4</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>91.5</td><td>87.7</td><td>85.7</td></tr><tr><td>Ours (ViT-S/16)</td><td>95.7</td><td>98.2</td><td>96.1</td></tr><tr><td>Ours (ViT-B/16)</td><td>96.8</td><td>98.7</td><td>97.1</td></tr><tr><td colspan="4">Oxford-IIT Pets</td></tr><tr><td>TEMI (ViT-S/16)</td><td>69.7</td><td>49.3</td><td>41.0</td></tr><tr><td>TEMI (ViT-B/16)</td><td>71.1</td><td>47.0</td><td>41.7</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>82.7</td><td>67.5</td><td>59.2</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>83.5</td><td>68.2</td><td>63.0</td></tr><tr><td>Ours (ViT-S/16)</td><td>87.3</td><td>74.1</td><td>71.6</td></tr><tr><td>Ours (ViT-B/16)</td><td>86.7</td><td>73.8</td><td>71.1</td></tr><tr><td colspan="4">Oxford 102 Flower</td></tr><tr><td>TEMI (ViT-S/16)</td><td>50.1</td><td>26.0</td><td>14.2</td></tr><tr><td>TEMI (ViT-B/16)</td><td>50.2</td><td>25.9</td><td>16.9</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>69.1</td><td>51.5</td><td>35.4</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>72.5</td><td>57.8</td><td>42.9</td></tr><tr><td>Ours (ViT-S/16)</td><td>76.1</td><td>62.2</td><td>52.6</td></tr><tr><td>Ours (ViT-B/16)</td><td>81.5</td><td>69.7</td><td>61.8</td></tr><tr><td colspan="4">Caltech 101</td></tr><tr><td>TEMI (ViT-S/16)</td><td>78.9</td><td>50.2</td><td>35.6</td></tr><tr><td>TEMI (ViT-B/16)</td><td>80.4</td><td>51.4</td><td>36.9</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>82.5</td><td>56.1</td><td>59.4</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>83.5</td><td>58.2</td><td>61.2</td></tr><tr><td>Ours (ViT-S/16)</td><td>86.5</td><td>66.7</td><td>65.7</td></tr><tr><td>Ours (ViT-B/16)</td><td>87.9</td><td>68.1</td><td>66.3</td></tr></table>
Qualitative Analysis. A t-SNE plot (Figure 5) of CLUDI's embeddings on ImageNet-50 demonstrates its ability to form well-separated clusters, reinforcing its quantitative metrics and illustrating its effectiveness in organizing complex data structures into distinct clusters. This visualization highlights CLUDI's capacity to capture subtle inter-class variations.
Table 2: Clustering performances on ImageNet subsets. The results for SCAN, Propos and TEMI are from the original papers. The best result is shown in bold, the second best is underlined.
<table><tr><td>Methods</td><td>NMI (%)</td><td>ACC (%)</td><td>ARI (%)</td></tr><tr><td colspan="4">ImageNet 50</td></tr><tr><td>SCAN (Resnet50)</td><td>82.2</td><td>76.8</td><td>66.1</td></tr><tr><td>Propos (Resnet50)</td><td>82.8</td><td>-</td><td>69.1</td></tr><tr><td>TEMI (ViT-S/16)</td><td>84.2</td><td>77.8</td><td>68.4</td></tr><tr><td>TEMI (ViT-B/16)</td><td>86.1</td><td>80.1</td><td>71.0</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>87.1</td><td>76.3</td><td>71.1</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>87.8</td><td>77.1</td><td>73.2</td></tr><tr><td>Ours (ViT-S/16)</td><td>90.1</td><td>81.3</td><td>75.8</td></tr><tr><td>Ours (ViT-B/16)</td><td>91.2</td><td>82.1</td><td>76.2</td></tr><tr><td colspan="4">ImageNet 100</td></tr><tr><td>SCAN (Resnet50)</td><td>80.8</td><td>68.9</td><td>57.6</td></tr><tr><td>Propos (Resnet50)</td><td>83.5</td><td>-</td><td>63.5</td></tr><tr><td>TEMI (ViT-S/16)</td><td>83.3</td><td>72.5</td><td>62.3</td></tr><tr><td>TEMI (ViT-B/16)</td><td>85.6</td><td>75.0</td><td>65.4</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>83.9</td><td>68.9</td><td>61.8</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>86.2</td><td>71.4</td><td>64.3</td></tr><tr><td>Ours (ViT-S/16)</td><td>86.5</td><td>74.3</td><td>67.5</td></tr><tr><td>Ours (ViT-B/16)</td><td>87.1</td><td>76.6</td><td>67.8</td></tr><tr><td colspan="4">ImageNet 200</td></tr><tr><td>SCAN (Resnet50)</td><td>77.2</td><td>58.1</td><td>47.0</td></tr><tr><td>Propos (Resnet50)</td><td>80.6</td><td>-</td><td>53.8</td></tr><tr><td>TEMI (ViT-S/16)</td><td>82.7</td><td>71.9</td><td>59.8</td></tr><tr><td>TEMI (ViT-B/16)</td><td>85.2</td><td>73.1</td><td>62.1</td></tr><tr><td>Self-Classifier* (ViT-S/16)</td><td>80.5</td><td>54.5</td><td>46.7</td></tr><tr><td>Self-Classifier* (ViT-B/16)</td><td>78.3</td><td>53.1</td><td>44.1</td></tr><tr><td>Ours (ViT-S/16)</td><td>85.9</td><td>73.2</td><td>60.9</td></tr><tr><td>Ours (ViT-B/16)</td><td>86.1</td><td>73.7</td><td>63.2</td></tr></table>
Limitations. The effectiveness of the CLUDI model is influenced by the choice of the diffusion parameter $F^2$ and the embedding dimensionality $d$ , both of which play critical
 Figure 6: Ablation Study on the $\mathcal{L}_{cls}$ weight $\lambda$ . Each point in the curves shows the maximum validation accuracy on ImageNet-100 achieved during training.
 Figure 7: Embedding dimension selection $d$ . Each point in the curves shows the maximum validation accuracy on ImageNet-100 achieved during training.
roles in determining clustering quality. While these parameters were tuned to optimize performance on the tested datasets, further refinement may be necessary for new data distributions or specific clustering tasks. Additionally, although CLUDI demonstrates strong capability in generating well-separated clusters, its performance can be impacted when scaling to a large number of clusters, as maintaining high-quality, distinct embeddings becomes increasingly complex with higher cluster counts.
# 7. Conclusion
In this work we introduced a novel use of diffusion models to generate clustering embeddings of pretrained data features. Our experimental results underscore CLUDI's advantages over both traditional and contemporary clustering techniques, validating its robustness, flexibility, and superior self-supervised clustering performance across diverse datasets and visual challenges. Future studies could build upon this work by investigating adaptive or data-driven hyperparameter selection techniques, as well as advanced clustering frameworks, such as hierarchical or multi-scale methods, potentially more scalable to large $K$ settings.
# Acknowledgments
This work was supported in part by the Lynn and William Frankel Center at BGU CS, by Israel Science Foundation Personal Grant #360/21, and by the Israeli Council for Higher Education (CHE) via the Data Science Research Center at BGU. A.P. was supported by the Israel Science Foundation (grant No. 1138/23). I.C. was also funded in part by the Kreitman School of Advanced Graduate Studies, by BGU's Hi-Tech Scholarship, and by the Israel's Ministry of Technology and Science Aloni Scholarship.
# Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
# References
Adaloglou, N., Michels, F., Kalisch, H., and Kollmann, M. Exploring the limits of deep image clustering using pretrained models. In 34th British Machine Vision Conference, 2023. Amrani, E., Karlinsky, L., and Bronstein, A. Self-supervised classification network. In European Conference on Computer Vision, pp. 116-132. Springer, 2022. Balestriero, R., Ibrahim, M., Sobal, V., Morcos, A., Shekhar, S., Goldstein, T., Bordes, F., Bardes, A., Mialon, G., Tian, Y., Schwarzschild, A., Wilson, A. G., Geiping, J., Garrido, Q., Fernandez, P., Bar, A., Piriaviash, H., LeCun, Y., and Goldblum, M. A cookbook of self-supervised learning, 2023. Ben-David, S. Clustering-what both theoreticians and practitioners are doing wrong. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. Caron, M., Bojanowski, P., Joulin, A., and Douze, M. Deep clustering for unsupervised learning of visual features. In Proceedings of the European conference on computer vision (ECCV), pp. 132-149, 2018. Caron, M., Touvron, H., Misra, I., Jégou, H., Mairal, J., Bojanowski, P., and Joulin, A. Emerging properties in self-supervised vision transformers. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9650-9660, 2021. Chan, S. H. Tutorial on diffusion models for imaging and vision. arXiv preprint arXiv:2403.18103, 2024. Chang, J. and Fisher III, J. W. Parallel sampling of dp mixture models using sub-cluster splits. Advances in Neural Information Processing Systems, 26, 2013.
Chelly, I., Uziel, R., Freifeld, O., and Pakman, A. Consistent amortized clustering via generative flow networks. In The 28th International Conference on Artificial Intelligence and Statistics, 2025. Chen, T., Kornblith, S., Norouzi, M., and Hinton, G. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pp. 1597-1607. PMLR, 2020. Chen, X. and He, K. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 15750-15758, 2021. Chicco, D. Siamese neural networks: An overview. Artificial neural networks, pp. 73-94, 2021. Coates, A., Ng, A., and Lee, H. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215-223. JMLR Workshop and Conference Proceedings, 2011. Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248-255. IEEE, 2009. Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. Advances in neural information processing systems, 34:8780-8794, 2021. Dieleman, S., Sartran, L., Roshannai, A., Savinov, N., Ganin, Y., Richemond, P. H., Doucet, A., Strudel, R., Dyer, C., Durkan, C., et al. Continuous diffusion for categorical data. arXiv preprint arXiv:2211.15089, 2022. Dinari, O., Yu, A., Freifeld, O., and Fisher, J. Distributed mcmc inference in dirichlet process mixture models using julia. In 2019 19th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID), pp. 518-525. IEEE, 2019. Dosovitskiy, A. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. Ericsson, L., Gouk, H., and Hospedales, T. M. How well do self-supervised models transfer? In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5414-5423, 2021. Fahad, A., Alshatri, N., Tari, Z., Alamri, A., Khalil, I., Zomaya, A. Y., Foufou, S., and Bouras, A. A survey of clustering algorithms for big data: Taxonomy and empirical analysis. IEEE transactions on emerging topics in computing, 2(3):267-279, 2014.
Fei-Fei, L., Fergus, R., and Perona, P. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In 2004 conference on computer vision and pattern recognition workshop, pp. 178-178. IEEE, 2004. Friebel, A., Johann, T., Drasdo, D., and Hoehme, S. Guided interactive image segmentation using machine learning and color-based image set clustering. *Bioinformatics*, 38 (19):4622-4628, 2022. Gao, Z., Guo, J., Tan, X., Zhu, Y., Zhang, F., Bian, J., and Xu, L. Empowering diffusion models on the embedding space for text generation. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pp. 4664-4683, 2024. Gong, S., Li, M., Feng, J., Wu, Z., and Kong, L. Diffuseq: Sequence to sequence text generation with diffusion models. arXiv preprint arXiv:2210.08933, 2022. Grill, J.-B., Strub, F., Altché, F., Tallec, C., Richemond, P., Buchatskaya, E., Doersch, C., Avila Pires, B., Guo, Z., Gheshlaghi Azar, M., et al. Bootstrap your own latent-a new approach to self-supervised learning. Advances in neural information processing systems, 33:21271-21284, 2020. Gui, J., Chen, T., Zhang, J., Cao, Q., Sun, Z., Luo, H., and Tao, D. A survey on self-supervised learning: Algorithms, applications, and future trends. *IEEE Transactions on Pattern Analysis and Machine Intelligence*, 2024. Halvagal, M. S., Laborieux, A., and Zenke, F. Implicit variance regularization in non-contrastive ssl. In Proceedings of the 37th International Conference on Neural Information Processing Systems, pp. 63409–63436, 2023. Han, S., Park, S., Park, S., Kim, S., and Cha, M. Mitigating embedding and class assignment mismatch in unsupervised image classification. In European Conference on Computer Vision, pp. 768-784. Springer, 2020. Hang, T., Gu, S., Li, C., Bao, J., Chen, D., Hu, H., Geng, X., and Guo, B. Efficient diffusion training via min-snr weighting strategy. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 7441-7451, October 2023. Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020. Hospedales, T., Antoniou, A., Micaelli, P., and Storkey, A. Meta-learning in neural networks: A survey. IEEE transactions on pattern analysis and machine intelligence, 44(9):5149-5169, 2021.
Huang, Z., Chen, J., Zhang, J., and Shan, H. Learning representation for clustering via prototype scattering and positive sampling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022. Jaiswal, A., Babu, A. R., Zadeh, M. Z., Banerjee, D., and Makedon, F. A survey on contrastive self-supervised learning. Technologies, 9(1):2, 2020. Ji, X., Henriques, J. F., and Vedaldi, A. Invariant information clustering for unsupervised image classification and segmentation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 9865-9874, 2019. Jiang, Z., Zheng, Y., Tan, H., Tang, B., and Zhou, H. Variational deep embedding: An unsupervised and generative approach to clustering. arXiv preprint arXiv:1611.05148, 2016. Jurewicz, M. M., Taylor, G. W., and Derczynski, L. The catalog problem: clustering and ordering variable-sized sets. In International Conference on Machine Learning, pp. 15528-15545. PMLR, 2023. Karim, M. R., Beyer, O., Zappa, A., Costa, I. G., Rebholz-Schuhmann, D., Cochez, M., and Decker, S. Deep learning-based clustering approaches for bioinformatics. Briefings in bioinformatics, 22(1):393-415, 2021. Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. Li, X., Thickstun, J., Gulrajani, I., Liang, P. S., and Hashimoto, T. B. Diffusion-lm improves controllable text generation. Advances in Neural Information Processing Systems, 35:4328-4343, 2022. Liu, K.-J., Suganuma, M., and Okatani, T. Bridging the gap from asymmetry tricks to decorrelation principles in noncontrastive self-supervised learning. Advances in Neural Information Processing Systems, 35:19824-19835, 2022. Luo, C. Understanding diffusion models: A unified perspective. arXiv preprint arXiv:2208.11970, 2022. Mittal, H., Pandey, A. C., Saraswat, M., Kumar, S., Pal, R., and Modwel, G. A comprehensive survey of image segmentation: clustering methods, performance parameters, and benchmark datasets. Multimedia Tools and Applications, pp. 1-26, 2022. Nakkiran, P., Bradley, A., Zhou, H., and Advani, M. Step-by-step diffusion: An elementary tutorial. arXiv preprint arXiv:2406.08929, 2024. Nichol, A. Q. and Dhariwal, P. Improved denoising diffusion probabilistic models. In International conference on machine learning, pp. 8162-8171. PMLR, 2021.
Nilsback, M.-E. and Zisserman, A. Automated flower classification over a large number of classes. In 2008 Sixth Indian conference on computer vision, graphics & image processing, pp. 722-729. IEEE, 2008. Özbulak, U., Lee, H. J., Boga, B., Anzaku, E. T., Park, H., Van Messem, A., De Neve, W., and Vankerschaver, J. Know your self-supervised learning: a survey on image-based generative and discriminative training. TRANSAC-TIONS ON MACHINE LEARNING RESEARCH, 2023. Pakman, A., Wang, Y., Mitelut, C., Lee, J., and Paninski, L. Neural clustering processes. In International Conference on Machine Learning, pp. 7455-7465. PMLR, 2020. Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498-3505. IEEE, 2012. Ren, Y., Pu, J., Yang, Z., Xu, J., Li, G., Pu, X., Philip, S. Y., and He, L. Deep clustering: A comprehensive survey. IEEE Transactions on Neural Networks and Learning Systems, 2024. Richemond, P. H., Tam, A., Tang, Y., Strub, F., Piot, B., and Hill, F. The edge of orthogonality: A simple view of what makes byol tick. In International Conference on Machine Learning, pp. 29063-29081. PMLR, 2023. Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684-10695, 2022. Ronen, M., Finder, S. E., and Freifeld, O. DeepDPM: Deep clustering with an unknown number of clusters. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9861-9870, 2022. Salimans, T. and Ho, J. Progressive distillation for fast sampling of diffusion models. In International Conference on Learning Representations, 2022. Shwartz Ziv, R. and LeCun, Y. To compress or not to compress—self-supervised learning and information theory: A review. Entropy, 26(3):252, 2024. Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pp. 2256-2265. PMLR, 2015. Song, H., Li, P., and Liu, H. Deep clustering based fair outlier detection. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 1481-1489, 2021a.
Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021b. Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021c. Tao, C., Wang, H., Zhu, X., Dong, J., Song, S., Huang, G., and Dai, J. Exploring the equivalence of siamese self-supervised learning via a unified gradient framework. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14431-14440, 2022. Tian, Y., Chen, X., and Ganguli, S. Understanding self-supervised learning dynamics without contrastive pairs. In International Conference on Machine Learning, pp. 10268-10278. PMLR, 2021. Turner, R. E., Diaconu, C.-D., Markou, S., Shysheya, A., Foong, A. Y., and Mlodozeniec, B. Denoising diffusion probabilistic models in six simple steps. arXiv preprint arXiv:2402.04384, 2024. Van Gansbeke, W., Vandenhende, S., Georgoulis, S., Proesmans, M., and Van Gool, L. SCAN: Learning to classify images without labels. In European conference on computer vision, pp. 268-285. Springer, 2020. Wang, X., Chen, X., Du, S. S., and Tian, Y. Towards demystifying representation learning with non-contrastive self-supervision. arXiv preprint arXiv:2110.04947, 2021. Wang, Y., Lee, Y., Basu, P., Lee, J., Teh, Y. W., Paninski, L., and Pakman, A. Amortized probabilistic detection of communities in graphs. Structured Probabilistic Inference & Generative Modeling workshop at ICML, 2024. Wei, X., Zhang, Z., Huang, H., and Zhou, Y. An overview on deep clustering. Neurocomputing, pp. 127761, 2024. Xie, J., Girshick, R., and Farhadi, A. Unsupervised deep embedding for clustering analysis. In International conference on machine learning, pp. 478-487. PMLR, 2016. Zhou, S., Xu, H., Zheng, Z., Chen, J., Li, Z., Bu, J., Wu, J., Wang, X., Zhu, W., and Ester, M. A comprehensive survey on deep clustering: Taxonomy, challenges, and future directions. ACM Computing Surveys, 2024. Zhou, X. and Zhang, N. L. Deep clustering with features from self-supervised pretraining. arXiv preprint arXiv:2207.13364, 2022.
In this Appendix we present the results of several hyperparameter ablations. All the curves shown correspond to performance metrics evaluated on the validation set of ImageNet 100. We also show some clustering examples on ImageNet 50.
# A. Hyperparameters
The model requires three hyperparameters: the embedding dimension $d$ , the noise rescaling factor $F^2$ in Equation 6 and the coefficient $\lambda$ on the loss in Equation 27. A systematic scan on the validation set of ImageNet 100 yielded the optimal values $d = 64$ , $F^2 = 25$ and $\lambda = 50$ , which we adopted for all the datasets with $K \geq 100$ . For datasets with fewer clusters (ImageNet 50, Oxford-IIIT Pets, STL 10, CIFAR 10) we used a smaller embedding $d = 32$ .
# B. Ablation Study on $\mathcal{L}_{cls}$ weight $\lambda$
In Figure S1 we show the impact of varying the weight $\lambda$ associated with the classification loss $\mathcal{L}_{cls}$ on the overall clustering performance.

 Figure S1: Clustering performance metrics (NMI, ACC, ARI) across $\lambda$ values for embedding dimension $d = 64$ . Each image corresponds to a specific metric: (a) NMI, (b) ACC, and (c) ARI.
# C. Ablation Study on Rescaling Factor $F^2$ and Embedding Dimension $d$
In Figure S2 and Figure S3 we explore the effect on clustering performance of varying the rescaling factor $F^2$ and the embedding dimension $d$ .
The noise rescaling factor $F^2$ plays a crucial role in our diffusion model by modulating the noise variance during the forward process. This parameter directly influences the model's ability to balance stability and exploration, which are essential for effective clustering. Insufficient noise (low $F^2$ ) results in trivial solutions where embeddings fail to explore the latent space adequately. Conversely, excessive noise (high $F^2$ ) destabilizes the learning process, disrupting inter-cluster separability.
Our results, consistent with those in (Gao et al., 2024) for text generation, confirm the need to find an optimal value (for us $F^2 = 25.0$ ) that strikes a balance between enabling the model to avoid degeneracy and preserving cluster coherence. In practical terms, our findings highlight that $F^2$ serves as a key hyperparameter for fine-tuning clustering models, with significant impacts on metrics such as NMI, ACC, and ARI.
# D. Clustering Visualization on ImageNet-50
In Figure S4 we provide a detailed visualization of the clustering results on the ImageNet-50 dataset. For ten different categories, we show images with highest and lowest confidence of belonging to each category. This illustrates the strength of our model and allows to visually explore the extent to which misclassifications are understandable.
 NMI for $F^2 = 4.0$
 ACC for $F^2 = 4.0$
 ARI for $F^2 = 4.0$
 NMI for $F^2 = 9.0$
 ACC for $F^2 = 9.0$
 ARI for $F^2 = 9.0$
 NMI for $F^2 = 16.0$
 ACC for $F^2 = 16.0$
 ARI for $F^2 = 16.0$ Figure S2: Clustering performance metrics for rescaling factors $F^2 = 4.0, 9.0, 16.0$ (top, middle, bottom, respectively) as a function of the embedding dimension $d$ . Each column shows curves for a different clustering metric (NMI, ACC, and ARI).
 NMI for $F^2 = 25.0$
 ACC for $F^2 = 25.0$
 ARI for $F^2 = 25.0$
 NMI for $F^2 = 36.0$
 ACC for $F^2 = 36.0$
 ARI for $F^2 = 36.0$
 NMI for $F^2 = 49.0$
 ACC for $F^2 = 49.0$
 ARI for $F^2 = 49.0$ Figure S3: Clustering performance metrics for rescaling factors $F^2 = 25.0, 36.0, 49.0$ (top, middle, bottom, respectively) as a function of the embedding dimension $d$ . Each column shows curves for a different clustering metric (NMI, ACC, and ARI).
 Figure S4: Visualization of supervised clustering results on the ImageNet 50 dataset. Each row corresponds to a single class, with the class name displayed on the left. For each class, the first four images represent the correctly classified samples with the highest confidence (outlined in green), while the last two images represent the incorrectly classified samples with the lowest confidence (outlined in red).123version https://git-lfs.github.com/spec/v1oid sha256:89038515ae4866860ed56ebefa5d81a8447ef7e633e9bcc63301efba911e2b38size 1338810123version https://git-lfs.github.com/spec/v1oid sha256:60d1b17b18bf53b5821ce92bb4999b22a57c9ce5932ed3e42eb54eb666c383fbsize 581748123version https://git-lfs.github.com/spec/v1oid sha256:f1a93315e8d7c30ba734da9b7d52bb8ef0feb5ddf5f314b6bc3c7de23089c78dsize 140084123version https://git-lfs.github.com/spec/v1oid sha256:66ff4ed5d8d87a834959a1363b278d26a715f91a74d363273c139089b269fc13size 164976123version https://git-lfs.github.com/spec/v1oid sha256:f26a94faaed057e43baa2ddf8a44dc27499a1a7e53e35f561cd88867ce644d3esize 4276407123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552# CoCoA-Mix: Confusion-and-Confidence-Aware Mixture Model for Context Optimization
Dasol Hong<sup>1</sup> Wooju Lee<sup>1</sup> Hyun Myung<sup>1</sup>
# Abstract
Prompt tuning, which adapts vision-language models by freezing model parameters and optimizing only the prompt, has proven effective for task-specific adaptations. The core challenge in prompt tuning is improving specialization for a specific task and generalization for unseen domains. However, frozen encoders often produce misaligned features, leading to confusion between classes and limiting specialization. To overcome this issue, we propose a confusion-aware loss (CoA-loss) that improves specialization by refining the decision boundaries between confusing classes. Additionally, we mathematically demonstrate that a mixture model can enhance generalization without compromising specialization. This is achieved using confidence-aware weights (CoA-weights), which adjust the weights of each prediction in the mixture model based on its confidence within the class domains. Extensive experiments show that CoCoA-Mix, a mixture model with CoA-loss and CoA-weights, outperforms state-of-the-art methods by enhancing specialization and generalization. Our code is publicly available at https://github.com/url-kaist/CoCoA-Mix.
# 1. Introduction
Pre-trained vision-language models (VLMs) have achieved remarkable results in diverse downstream tasks, such as image classification (Fu et al., 2022), object detection (Zhong et al., 2022; Gu et al., 2021), and visual question answering (Cho et al., 2021; Lin et al., 2022). These models align visual and textual embeddings through extensive pre-training
<sup>1</sup>Urban Robotics Lab, School of Electrical Engineering, Korea Advanced Institute of Science and Technology, Republic of Korea. Correspondence to: Dasol Hong <ds.hong@kaist.ac.kr>, Wooju Lee <dnwn24@kaist.ac.kr>, Hyun Myung <hmyung@kaist.ac.kr>.
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
 (a)
 (b) Figure 1: (a) Effect of CoA-loss. The left and right sides show probabilities for the hatched sample on the decision boundary. In the middle figure, dashed and solid lines indicate the current and updated decision boundaries. CoA-loss assigns higher weights to this confusing sample, enhancing specialization in prompt tuning. (b) Effect of CoA-weights. The left and right sides show performance across domains. CoA-weights increase confidence in the specialized prediction for seen domains while reducing it for unseen domains, preserving both specialization and generalization.
on large-scale datasets, enabling remarkable zero-shot capabilities. However, their reliance on generic embeddings often limits their effectiveness in task-specific applications.
To mitigate this limitation, prompt engineering has emerged as a practical way to enhance performance on a specific task (Wang et al., 2021; 2022a). The method involves manually designing a task-specific text template for the model input. For example, in image classification, handcrafted prompts such as "a photo of a [CLASS], a type of flower" help associate visual embeddings with the correct class labels, such as "hibiscus" or "sword lily." (Zhou et al., 2022c) Although effective, the manual process is labor-intensive and requires domain expertise, limiting scalability across diverse tasks.
Prompt tuning has become a scalable alternative to manual prompt engineering by replacing hand-crafted prompts with
learnable prompts (Zhou et al., 2022c; Zhu et al., 2023; Zhou et al., 2024; Zhang et al., 2024a). This method allows VLMs to effectively align textual embeddings with the corresponding visual embeddings by optimizing the prompts for a specific task while freezing the model parameters.
However, the existing methods have two limitations. First, existing methods do not explicitly address confusing cases arising from the frozen visual encoder. The frozen visual encoder often fails to capture task-specific features, struggling to distinguish between different classes. However, most existing methods rely on standard cross-entropy loss, which is ineffective in handling confusing cases and consequently limits their specialization (Zhou et al., 2022c;b). Second, achieving generalization to unseen domains is crucial in prompt tuning, but current methods often sacrifice specialization to improve generalization. Most studies inherently assume specialization and generalization are competing objectives. As a result, the trade-off problem remains an open challenge.
To overcome these limitations, we propose a confusion- and-confidence-aware mixture model (CoCoA-Mix), which combines confusion-aware loss (CoA-loss) and confidence-aware weights (CoA-weights). We first introduce a mixture model that combines predictions from individual prompts, providing a theoretical framework to analyze prompt tuning in terms of specialization and generalization. Building on this theoretical insight, CoA-loss improves specialization by applying larger gradient to confusing cases, refining decision boundaries as shown in Figure 1(a). Then, CoA-weights achieve generalization without compromising specialization by scaling mixture model weights based on the confidence of individual prompts across class domains, as shown in Figure 1(b). As a result, our method enhances both specialization and generalization by ensuring that the error of the mixture model remains lower than the minimum error of individual prompts. Main contributions are as follows:
- We provide a mathematical framework demonstrating that specialization and generalization can be improved simultaneously. - We propose a CoCoA-Mix framework, consisting of CoA-loss and CoA-weights. CoA-loss boosts specialization by improving classification for confusing cases, while CoA-weights improve generalization by adjusting the weights of individual prompts in the mixture model based on their confidence over class domains. - The proposed method achieves average harmonic mean improvements of $15.28\%$ and $3.28\%$ over zero-shot CLIP in base-to-new generalization and cross-dataset transfer, respectively; it also improves the average accuracy in few-shot class-incremental learning by $5.6\%$ .
# 2. Related Work
# 2.1. Textual Prompt Tuning
Prompt tuning has emerged as a method to reduce the reliance on human expertise while improving the performance of VLMs on specific tasks. The method can be categorized into visual prompt tuning (Jia et al., 2022; Bahng et al., 2022), textual prompt tuning (Zhou et al., 2022c;b; Zhu et al., 2023; Yao et al., 2023; Zhang et al., 2024b), and visual-textual prompt tuning (Khattak et al., 2023a;b). In this paper, we focus on textual prompt tuning, which replaces hand-crafted prompts with learnable prompts and optimizes them using few-shot training data, while keeping the model parameters frozen.
# 2.2. Loss for Prompt Tuning
In textual prompt tuning, the frozen encoders map inputs to generic embeddings, which can lead to misaligned vision-text embeddings for specific tasks. A common strategy to mitigate this issue is to employ a standard cross-entropy loss that aligns textual prompts with their corresponding visual embeddings. CoOp (Zhou et al., 2022c) pioneered textual prompt tuning by optimizing prompts for specific tasks using cross-entropy loss. Subsequent works employed regularization via hand-crafted prompts, which enhanced specialization by preventing prompts from learning unintended patterns (Zhu et al., 2023; Yao et al., 2023; Zhang et al., 2024b). However, such regularization methods may prevent prompts from fully capturing task-specific patterns, limiting specialization in complex tasks. Other approaches (Khattak et al., 2023a; Zhang et al., 2024b) introduce additional network parameters to enhance the representational capacity of the model. MaPLe (Khattak et al., 2023a) leverages visual-language interactions via a coupling function, while DePT (Zhang et al., 2024b) employs a dual-head architecture to decouple task-specific and task-shared knowledge into separate feature spaces. Although these methods improve generalization, they increase the number of learnable parameters, leading to overfitting when training data is scarce and limiting scalability. In contrast, we aim to enhance both specialization and generalization without introducing additional network components.
# 2.3. Mixture of Prompts
Prompt ensembling has been studied to improve generalization in VLMs. Allingham et al. (2023) propose zero-shot prompt ensembling (ZPE), which automatically assigns weights to hand-crafted prompts from a large pool, leading to improved zero-shot accuracy. Lu et al. (2024) extend this to model-level ensembles suited to varying resource settings, but this requires multiple forward passes at inference time. Despite their generalization benefits, neither
approach explicitly addresses the challenge of achieving task-specific specialization. In contrast, our method jointly improves specialization and generalization, while remaining computationally efficient by avoiding multiple forward passes.
# 3. Proposed Method
# 3.1. Preliminary
In downstream tasks, CLIP employs visual and textual encoders to map images and textual prompts into a shared embedding space. The textual prompts $t$ can be generated as hand-crafted prompts by embedding class labels into predefined templates, such as "a photo of a [CLASS]." With $t$ , the probability of the image belonging to the class $l$ , $\hat{p}_t(l)$ , is defined as follows:
$$\hat {p} _ {\boldsymbol {t}} (l) = \frac {\exp \left(\boldsymbol {s} _ {\boldsymbol {t}} (l) / \tau\right)}{\sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t}} \left(l ^ {\prime}\right) / \tau\right)}, \tag {1}$$
where $\tau$ is the temperature scale, $\mathcal{V}$ represents the set of classes, and $s_t(l)$ denotes the cosine similarity between the visual and textual embeddings of the class $l$ generated by $t$ .
# 3.2. Decomposing Specialization and Generalization
The expected error $\epsilon_T(\hat{p})$ of a predictive distribution $\hat{p}$ in an arbitrary target domain $\mathcal{D}_T$ is defined using the Kullback-Leibler (KL) divergence as follows:
$$\epsilon_ {T} (\hat {p}) = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \log \hat {p} (y) \right], \tag {2}$$
where $y$ is the ground-truth label for the image $\mathbf{x}$ .
We introduce a mixture model to derive an upper bound for the error in the target domain, providing a framework for analyzing specialization and generalization.
Definition 3.1 (Mixture model). Let $K + 1$ different prompts be given by $\mathcal{T} = \{t_0, t_1, \dots, t_K\}$ , and let $\pi = \{\pi_0, \pi_1, \dots, \pi_K\}$ denote a set of non-negative weights satisfying $\sum_{i=0}^{K} \pi_i = 1$ . The mixture model $\hat{p}_T^\pi$ is defined as a weighted combination of the individual prompts:
$$\hat {p} _ {T} ^ {\pi} (l) = \frac {\exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l) / \tau\right)}{\sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right)}. \tag {3}$$
Theorem 3.2. The expected error of the mixture model $\hat{p}_T^\pi$ can be bounded as follows:
$$\epsilon_ {T} \left(\hat {p} _ {T} ^ {\pi}\right) \leq \sum_ {i = 0} ^ {K} \pi_ {i} \epsilon_ {T} \left(\hat {p} _ {t _ {i}}\right). \tag {4}$$
The proof is provided in Section A.
Lemma 3.3. Let the class set of the target domain $\mathcal{D}_T$ be partitioned into $K + 1$ disjoint subsets, with corresponding sub-domains $\mathcal{D}_{T_0},\mathcal{D}_{T_1},\dots ,\mathcal{D}_{T_K}$ such that $\mathcal{D}_T = \bigsqcup_{i = 0}^{K}\mathcal{D}_{T_i}$ . Then, the expected error of $\hat{p}_T^\pi$ is given by:
$$\epsilon_ {T} \left(\hat {p} _ {\mathcal {T}} ^ {\boldsymbol {\pi}}\right) = \sum_ {i = 0} ^ {K} \lambda_ {i} \epsilon_ {T _ {i}} \left(\hat {p} _ {\mathcal {T}} ^ {\boldsymbol {\pi}}\right), \tag {5}$$
where $\lambda_{i} = \operatorname{Pr}_{(\mathbf{x},y)\sim \mathcal{D}_{T}}[(\mathbf{x},y)\in \mathcal{D}_{T_{i}}]$ denotes the probability that a sample from the target domain $\mathcal{D}_T$ belongs to the sub-domain $\mathcal{D}_{T_i}$ , satisfying $\sum_{i=0}^{K}\lambda_{i} = 1$ . Based on Theorem 3.2, the error of the mixture model in the arbitrary target domain can be upper-bounded as follows:
$$\epsilon_ {T} \left(\hat {p} _ {\mathcal {T}} ^ {\pi}\right) \leq \sum_ {i = 0} ^ {K} \lambda_ {i} \left(\pi_ {i} ^ {i n} \underbrace {\epsilon_ {T _ {i}} \left(\hat {p} _ {\boldsymbol {t} _ {i}}\right)} _ {\text {s p e c i a l i z a t i o n}} + \underbrace {\sum_ {j = 0} ^ {K} \pi_ {j} ^ {\text {o u t}} \epsilon_ {T _ {i}} \left(\hat {p} _ {\boldsymbol {t} _ {j}}\right)} _ {\text {g e n e r a l i z a t i o n}}\right), \tag {6}$$
where $\pi_i^{in}$ denotes the mixing weight of the prompt $t_i$ for its own domain $\mathcal{D}_{T_i}$ , and $\pi_j^{out}$ denotes the mixing weight of the prompt $t_j (j \neq i)$ when applied to the domain $\mathcal{D}_i$ . Here, $\pi_i^{in} + \sum_{\substack{j=0 \\ j \neq i}}^{K} \pi_j^{out} = 1$ .
Let $\mathcal{V}$ denote the set of all classes in the arbitrary target domain $\mathcal{D}_T$ , which is partitioned as $\mathcal{V} = \bigsqcup_{i=0}^{K} \mathcal{V}_i$ . Specifically, we assume that labeled data is provided for $\mathcal{V}_1, \dots, \mathcal{V}_K$ , whereas no supervision is available for $\mathcal{V}_0$ . Due to the absence of labeled data in $\mathcal{D}_{T_0}$ , the associated prompt $t_0$ cannot be specialized through training. Instead, we utilize a generalized hand-crafted prompt such as "a photo of a [CLASS]."
Building on this, we detail the proposed method for specialization and generalization in prompt tuning. In Section 3.3, we propose confusion-aware loss (CoA-loss), which focuses on confusing cases in prompt tuning and effectively reduces the specialization error $\epsilon_{T_i}(\hat{p}_{t_i})$ for each sub-domain $\mathcal{D}_{T_i}$ . Subsequently, Section 3.4 enhances generalization by optimizing confidence-aware weights (CoA-weights) based on the confidence of each prompt on the given class domain, tightening the upper bound of $\epsilon_T(\hat{p}_T^\pi)$ . As a result, the proposed method enhances specialization and generalization simultaneously. Figure 2 shows the overall framework of the confusion-and-confidence-aware mixture model (CoCoA-Mix), which combines CoA-loss and CoA-weights.
# 3.3. Confusion-Aware Loss for Specialization
Let $\hat{p}$ be a predictive distribution and $\mathcal{D}_S$ be the source domain. According to Nguyen et al. (2022), the expected
 Figure 2: CoCoA-Mix framework integrates confusion-aware loss (CoA-loss) for specialization and confidence-aware weights (CoA-weights) for generalization, ensuring performance improvements without trade-offs. The learnable prompt $t_i$ is optimized with CoA-loss to specialize in distinguishing confusing classes within the training domain. CoA-weights adjusts prediction confidence by increasing $\pi_i^{\mathrm{in}}$ for in-class and decreasing $\pi_i^{\mathrm{out}}$ for out-class. At inference, the specialized predictions $\hat{p}_{\mathbf{t}_i}$ , adjusted via CoA-weights, are combined with the generalized predictions $\hat{p}_{\mathbf{t}_0}$ to ensure generalization while preserving specialization.
error $\epsilon_T(\hat{p})$ on the target domain $\mathcal{D}_T$ is bounded as follows:
$$\epsilon_ {T} (\hat {p}) \leq \epsilon_ {S} (\hat {p}) + \frac {C}{\sqrt {2}} \sqrt {\operatorname {K L} \left(p _ {T} (\mathbf {z}) \mid p _ {S} (\mathbf {z})\right) + \delta}, \tag {7}$$
where $\mathbf{z}$ is defined as a visual embedding; $C$ is a constant that bounds $\log \hat{p} (l)$ , ensuring each class probability is at least $\exp (-C)$ ; $p_T$ and $p_S$ are the marginal distribution of $\mathbf{z}$ for the target and source domains, respectively; and $\delta$ denotes the conditional misalignment $\mathbb{E}_{p_T(\mathbf{x})}[\mathrm{KL}(p_T(y|\mathbf{x})|p_S(y|\mathbf{x}))]$ , which is typically small.
We focus on textual prompt tuning, which cannot optimize the visual embedding $\mathbf{z}$ due to the frozen encoders. Thus, Equation (7) suggests that minimizing $\epsilon_{S}(\hat{p})$ can reduce $\epsilon_{T}(\hat{p})$ , enabling error minimization in the mixture model via source domain specialization.
Most existing methods use standard cross-entropy, defined as follows, for the specialization in prompt tuning:
$$\mathcal {L} _ {\mathrm {C E}} (\mathbf {x}, y; \hat {p} _ {t}) = - \log \hat {p} _ {t} (y). \tag {8}$$
Cross-entropy assigns gradients based on class probabilities, assigning larger gradients to misclassified samples. While effective for misclassified cases, it relies only on individual probabilities and does not consider inter-class relationships, limiting its ability to handle class confusion. Addressing confusing classes is crucial in prompt tuning with limited training data because they significantly impact the decision boundary. To overcome this limitation, we propose confusion-aware loss (CoA-loss), defined as follows:
$$\mathcal {L} _ {\mathrm {C o A}} (\mathbf {x}, y; \hat {p} _ {t}) = 1 - \hat {p} _ {t} (y). \tag {9}$$
The overall loss $\mathcal{L}_{\mathrm{prompt}}$ for optimizing the prompt $\pmb{t}$ is given by:
$$\mathcal {L} _ {\text {p r o m p t}} (\mathbf {x}, y; \hat {p} _ {\boldsymbol {t}}) = \mathcal {L} _ {\mathrm {C E}} + w \mathcal {L} _ {\mathrm {C o A}}, \tag {10}$$
 (a)
 (b) Figure 3: Gradient component of $\mathcal{L}_{\mathrm{prompt}}$ with respect to (a) $s_t(c \neq y)$ and (b) $s_t(y)$ , where $w = 0$ represents standard cross-entropy.
where $w$ is a hyperparameter that balances the contribution of CoA-loss.
To illustrate how CoA-loss refines the decision boundary between confusing classes, we analyze the gradients for the correct class $y$ and an incorrect class $c$ . The gradients of $\mathcal{L}_{\mathrm{prompt}}$ with respect to the similarities $s_t(y)$ and $s_t(c \neq y)$ are as follows:
$$\begin{array}{l} \frac {\partial \mathcal {L} _ {\text {p r o m p t}}}{\partial \boldsymbol {s} _ {t} (y)} = - \frac {1}{\tau} (1 - \hat {p} _ {t} (y)) (1 - w \hat {p} _ {t} (y)), \tag {11} \\ \frac {\partial \mathcal {L} _ {\text {p r o m p t}}}{\partial s _ {t} (c \neq y)} = \frac {1}{\tau} \hat {p} _ {t} (c) \left(1 + w \hat {p} _ {t} (y)\right). \\ \end{array}$$
Figure 3 shows the gradients for classes $y$ and $c$ . When $w = 0$ , the loss corresponds to standard cross-entropy. As implied by Equation (11), standard cross-entropy assigns gradients based on individual probabilities, ignoring inter-class relationships. In contrast, CoA-loss increases the gradient for $y$ when $\hat{p}_t(y)$ approaches 0.5 and for class $c$ when $\hat{p}_t(c)$ nears $\hat{p}_t(y)$ , especially as $w$ increases. These scenarios represent confusing cases where the correct class probabil
ity is uncertain or where the incorrect class probability is similar to the correct class, making them difficult to distinguish. CoA-loss thus induces larger gradient updates for these confusing cases.
# 3.4. Confidence-Aware Weights for Generalization without Trade-Offs
Equation (6) suggests that optimizing $\pi$ can minimize the upper bound of the expected error $\epsilon_T(\hat{p}_T^\pi)$ of the mixture model. Achieving this requires assigning a higher weight to the prediction with lower error in the target domain. In this section, we propose confidence-aware weights (CoA-weights), which adjust the weight of each prediction based on the class domain.
Assumption 3.4. The specialized prediction $\hat{p}_{t_i}$ for $\mathcal{D}_{T_i}$ satisfies the following relationships:
$$\epsilon_ {T _ {i}} \left(\hat {p} _ {\boldsymbol {t} _ {i}}\right) \leq \epsilon_ {T _ {i}} \left(\hat {p} _ {\boldsymbol {t} _ {j \neq i}}\right) \quad \text {a n d} \quad \epsilon_ {T _ {j \neq i}} \left(\hat {p} _ {\boldsymbol {t} _ {0}}\right) \leq \epsilon_ {T _ {j \neq i}} \left(\hat {p} _ {\boldsymbol {t} _ {i}}\right). \tag {12}$$
The first inequality reflects that a prediction $\hat{p}_{t_i}$ optimized for a specific domain $\mathcal{D}_{T_i}$ always performs better than predictions $\hat{p}_{t_{j\neq i}}$ made by prompts optimized for other domains. Conversely, the second inequality assumes that the generalized prediction $\hat{p}_{t_0}$ is more effective for unseen classes. This assumption aligns with the principle that a single prediction specialized for a task cannot excel at all tasks, a claim further supported by statistical evidence presented in Appendix B.
Equation (6) and Assumption 3.4 suggest that minimizing the upper bound of $\epsilon_T(\hat{p}_T^\pi)$ requires increasing $\pi^{\mathrm{in}}$ for in-classes and decreasing $\pi^{\mathrm{out}}$ for out-classes. To achieve this, we propose CoA-weights which adjust the weights $\pi_i^{\mathrm{in}}$ and $\pi_i^{\mathrm{out}}$ of $\hat{p}_{t_i}$ in the mixture model.
Optimizing $\pi_i^{\mathrm{in}}$ for In-Class Domains The weight $\pi_i^{\mathrm{in}}$ for in-class domains is optimized by minimizing the cross-entropy loss of the mixture model over the training domain $\mathcal{D}_{S_i}$ :
$$\pi_ {i} ^ {\text {i n}} = \underset {\pi_ {i} ^ {\text {i n}}} {\arg \min } \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {S _ {i}}} \left[ \mathcal {L} _ {\mathrm {C E}} (\mathbf {x}, y; \hat {p} _ {T} ^ {\pi}) \right]. \tag {13}$$
With this optimization, weight $\pi_i^{\mathrm{in}}$ is increased when the specialized prediction $\hat{p}_{\pmb{t}_i}$ outperforms the generalized prediction $\hat{p}_{\pmb{t}_{j\neq i}}$ for the in-class domain and decreased otherwise. Consequently, the weight $\pi_i^{\mathrm{in}}$ for in-classes is optimized. Further details on the cross-entropy effect in the mixture model are provided in Appendix C.
Optimizing $\pi_i^{\mathrm{out}}$ for Out-Class Domains Because only in-classes are available during training, out-class set $\mathcal{V}_i^{\mathrm{out}}$ must be generated to optimize $\pi_i^{\mathrm{out}}$ . The out-class set can be
generated by combining random strings or retrieving random words. According to Assumption 3.4, the temperature $\pi_i^{\mathrm{out}}$ for out-class domains is optimized using entropy loss $\mathcal{L}_{\mathrm{Ent}}$ , which compares the entropy of $\hat{p}_{t_i}$ and $\hat{p}_{t_0}$ as follows:
$$\pi_ {i} ^ {\text {o u t}} = \underset {\pi_ {i} ^ {\text {o u t}}} {\arg \min } \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {S _ {i}}} \left[ \mathcal {L} _ {\text {E n t}} (\mathbf {x}; \hat {p} _ {\boldsymbol {t} _ {i}}, \hat {p} _ {\boldsymbol {t} _ {0}}) \right], \tag {14}$$
$$\mathcal {L} _ {\text {E n t}} = \max (0, H (\hat {p} _ {t _ {0}}) - H (\hat {p} _ {t _ {i}}) + d), \tag {15}$$
where $d$ is a margin and $H(\hat{p})$ is the normalized entropy of $\hat{p}$ over the out-class set, i.e., $H(\hat{p}) = \sum_{c\sim \mathcal{Y}_i^{\mathrm{out}}} - \hat{p} (c)\log \hat{p} (c) / \log |\mathcal{Y}_i^{\mathrm{out}}|$ .
The entropy loss $\mathcal{L}_{\mathrm{Ent}}$ ensures that the entropy of $\hat{p}_{t_{i > 0}}$ exceeds that of $\hat{p}_{t_0}$ by a margin of $d$ . Entropy measures uncertainty in the prediction, with higher values indicating lower confidence. As a result, $\pi_i^{\mathrm{out}}$ is optimized to make specialized predictions less confident than generalized ones.
# 4. Experiments
# 4.1. Datasets and Implementation Details
We validate the effectiveness of our method in three tasks: (1) base-to-new generalization, (2) few-shot class-incremental learning (FSCIL), and (3) cross-dataset transfer.
Datasets We evaluate base-to-new generalization and cross-dataset transfer performance using 11 datasets: ImageNet (Deng et al., 2009), Caltech101 (Fei-Fei et al., 2004), OxfordPnts (Parkhi et al., 2012), StanfordCars (Krause et al., 2013), Flowers102 (Nilsback & Zisserman, 2008), Food101 (Bossard et al., 2014), FGVCAircraft (Maji et al., 2013), EuroSAT (Helber et al., 2019), UCF101 (Soomro, 2012), DTD (Cimpoi et al., 2014), and SUN397 (Xiao et al., 2010). For FSCIL, we use CIFAR100 (Krizhevsky et al., 2009). Following Tao et al. (2020), we split the classes into 60 Base and 40 New classes and adopted a 5-shot 5-way setting, resulting in a total of 9 training sessions.
Training Details The prompt length $M$ is initialized randomly and set to 16 unless specified. The out-class set $\mathcal{Y}_i^{\mathrm{out}}$ for optimizing $\pi_i^{\mathrm{out}}$ is generated by sampling the same number of random words as the in-class set $\mathcal{Y}_i$ using the API (Rebguns, 2021). Prompt tuning is performed using the Adam optimizer (Kingma, 2014) with a learning rate of 0.002. Optimization for the CoA-weights is conducted with SGD. Further details of implementation are provided in Appendix D.
# 4.2. Performance Comparison
Base-to-New Generalization We evaluate prompt tuning performance over classes in a 4-shot setting. Each dataset is evenly split into two disjoint subsets: base classes (Base) for tuning and unseen new classes (New). Accuracy is measured
Table 1: Performance comparison on 11 datasets in the base-to-new benchmark. H represents the harmonic mean.
<table><tr><td rowspan="2">METHOD</td><td colspan="3">AVERAGE</td><td colspan="3">IMAGENET</td><td colspan="3">CALTECH101</td></tr><tr><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td></tr><tr><td>CLIP</td><td>65.14</td><td>68.78</td><td>66.82</td><td>64.43</td><td>60.04</td><td>62.16</td><td>90.64</td><td>91.16</td><td>90.90</td></tr><tr><td>COOP</td><td>77.23</td><td>68.56</td><td>71.33</td><td>73.72 ± 0.29</td><td>64.94 ± 0.87</td><td>69.05</td><td>97.16 ± 0.16</td><td>93.92 ± 0.80</td><td>95.51</td></tr><tr><td>PROGRAD</td><td>78.74</td><td>72.19</td><td>75.06</td><td>74.81 ± 0.29</td><td>66.68 ± 0.26</td><td>70.51</td><td>97.50 ± 0.08</td><td>95.49 ± 0.27</td><td>96.48</td></tr><tr><td>KGCOOP</td><td>78.67</td><td>74.62</td><td>76.38</td><td>75.44 ± 0.08</td><td>69.43 ± 0.29</td><td>72.31</td><td>97.61 ± 0.33</td><td>94.80 ± 0.45</td><td>96.18</td></tr><tr><td>MAPLE</td><td>77.14</td><td>72.91</td><td>74.69</td><td>75.40 ± 0.29</td><td>70.43 ± 0.12</td><td>72.83</td><td>97.47 ± 0.31</td><td>93.77 ± 1.11</td><td>95.57</td></tr><tr><td>DEPT</td><td>79.20</td><td>66.36</td><td>71.78</td><td>73.50 ± 0.22</td><td>70.00 ± 0.16</td><td>71.71</td><td>97.83 ± 0.05</td><td>95.83 ± 0.25</td><td>96.82</td></tr><tr><td>COA-LOSS</td><td>79.12</td><td>73.66</td><td>76.15</td><td>75.68 ± 0.00</td><td>67.98 ± 0.31</td><td>71.62</td><td>97.94 ± 0.14</td><td>94.54 ± 0.24</td><td>96.21</td></tr><tr><td>CoCOA-MIX</td><td>79.31</td><td>75.10</td><td>77.03</td><td>75.47 ± 0.09</td><td>68.92 ± 0.10</td><td>72.04</td><td>98.02 ± 0.03</td><td>94.39 ± 0.10</td><td>96.17</td></tr><tr><td></td><td colspan="3">OXFORDPETS</td><td colspan="3">STANFORDCARS</td><td colspan="3">FLOWERS102</td></tr><tr><td>METHOD</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td></tr><tr><td>CLIP</td><td>90.01</td><td>94.24</td><td>92.07</td><td>55.37</td><td>66.65</td><td>60.49</td><td>69.23</td><td>73.90</td><td>71.49</td></tr><tr><td>COOP</td><td>94.10 ± 0.73</td><td>94.42 ± 4.17</td><td>94.16</td><td>69.54 ± 0.75</td><td>71.39 ± 1.28</td><td>70.44</td><td>90.60 ± 1.50</td><td>67.00 ± 1.04</td><td>77.01</td></tr><tr><td>PROGRAD</td><td>95.00 ± 0.31</td><td>97.36 ± 0.42</td><td>96.16</td><td>71.45 ± 0.39</td><td>73.16 ± 0.58</td><td>72.29</td><td>91.36 ± 0.63</td><td>74.92 ± 0.90</td><td>82.32</td></tr><tr><td>KGCOOP</td><td>94.65 ± 0.15</td><td>97.59 ± 0.08</td><td>96.10</td><td>68.64 ± 0.35</td><td>74.96 ± 0.53</td><td>71.66</td><td>90.09 ± 0.63</td><td>76.31 ± 0.42</td><td>82.63</td></tr><tr><td>MAPLE</td><td>94.80 ± 0.94</td><td>97.67 ± 0.21</td><td>96.21</td><td>67.97 ± 0.29</td><td>74.40 ± 0.45</td><td>71.04</td><td>88.03 ± 1.62</td><td>73.43 ± 0.49</td><td>80.06</td></tr><tr><td>DEPT</td><td>94.00 ± 0.29</td><td>88.63 ± 0.78</td><td>91.23</td><td>71.83 ± 0.52</td><td>59.27 ± 0.76</td><td>64.94</td><td>94.53 ± 0.53</td><td>66.30 ± 1.42</td><td>77.92</td></tr><tr><td>COA-LOSS</td><td>94.90 ± 0.49</td><td>97.93 ± 0.08</td><td>96.39</td><td>72.70 ± 0.11</td><td>73.07 ± 1.27</td><td>72.87</td><td>88.89 ± 1.75</td><td>75.58 ± 1.31</td><td>81.67</td></tr><tr><td>CoCOA-MIX</td><td>95.16 ± 0.38</td><td>97.60 ± 0.09</td><td>96.36</td><td>73.09 ± 0.25</td><td>74.97 ± 0.08</td><td>74.01</td><td>91.04 ± 1.79</td><td>77.37 ± 0.38</td><td>83.64</td></tr><tr><td></td><td colspan="3">FOOD101</td><td colspan="3">FGVCAIRCRAFT</td><td colspan="3">SUN397</td></tr><tr><td>METHOD</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td></tr><tr><td>CLIP</td><td>83.58</td><td>84.95</td><td>84.26</td><td>19.51</td><td>24.60</td><td>21.76</td><td>66.76</td><td>70.52</td><td>68.59</td></tr><tr><td>COOP</td><td>89.19 ± 0.19</td><td>88.45 ± 0.89</td><td>88.81</td><td>26.17 ± 7.89</td><td>19.50 ± 11.94</td><td>11.46</td><td>77.37 ± 0.66</td><td>72.06 ± 1.56</td><td>74.60</td></tr><tr><td>PROGRAD</td><td>89.33 ± 0.08</td><td>89.93 ± 0.58</td><td>89.63</td><td>34.21 ± 1.99</td><td>28.53 ± 2.08</td><td>30.97</td><td>79.16 ± 0.36</td><td>74.34 ± 0.75</td><td>76.20</td></tr><tr><td>KGCOOP</td><td>90.26 ± 0.11</td><td>91.25 ± 0.15</td><td>90.75</td><td>33.43 ± 0.56</td><td>32.27 ± 1.19</td><td>32.81</td><td>79.07 ± 0.24</td><td>76.78 ± 0.24</td><td>77.91</td></tr><tr><td>MAPLE</td><td>89.37 ± 0.54</td><td>90.77 ± 0.54</td><td>90.06</td><td>31.67 ± 0.66</td><td>33.13 ± 2.38</td><td>32.29</td><td>78.33 ± 0.21</td><td>77.67 ± 0.45</td><td>78.00</td></tr><tr><td>DEPT</td><td>89.80 ± 0.08</td><td>88.10 ± 0.16</td><td>88.94</td><td>35.93 ± 0.93</td><td>24.33 ± 0.09</td><td>29.01</td><td>79.10 ± 0.22</td><td>67.27 ± 0.46</td><td>72.70</td></tr><tr><td>COA-LOSS</td><td>90.11 ± 0.18</td><td>90.87 ± 0.42</td><td>90.49</td><td>33.91 ± 0.68</td><td>32.47 ± 0.37</td><td>33.17</td><td>78.70 ± 0.25</td><td>75.43 ± 0.72</td><td>77.03</td></tr><tr><td>CoCOA-MIX</td><td>90.09 ± 0.16</td><td>90.93 ± 0.09</td><td>90.50</td><td>33.51 ± 0.28</td><td>34.15 ± 0.14</td><td>33.83</td><td>78.51 ± 0.17</td><td>76.60 ± 0.24</td><td>77.54</td></tr><tr><td></td><td colspan="3">DTD</td><td colspan="3">EUROSAT</td><td colspan="3">UCF101</td></tr><tr><td>METHOD</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td><td>BASE</td><td>NEW</td><td>H</td></tr><tr><td>CLIP</td><td>53.24</td><td>54.71</td><td>53.97</td><td>54.79</td><td>66.21</td><td>59.96</td><td>69.03</td><td>69.61</td><td>69.32</td></tr><tr><td>COOP</td><td>71.22 ± 1.13</td><td>53.62 ± 3.45</td><td>61.03</td><td>79.93 ± 1.07</td><td>64.79 ± 6.36</td><td>71.19</td><td>80.58 ± 0.66</td><td>64.11 ± 2.84</td><td>71.32</td></tr><tr><td>PROGRAD</td><td>72.07 ± 0.29</td><td>50.56 ± 2.43</td><td>59.35</td><td>81.29 ± 3.36</td><td>69.81 ± 5.56</td><td>74.80</td><td>80.97 ± 0.29</td><td>73.32 ± 1.85</td><td>76.93</td></tr><tr><td>KGCOOP</td><td>72.92 ± 1.05</td><td>59.14 ± 1.53</td><td>65.28</td><td>83.20 ± 0.72</td><td>70.51 ± 9.30</td><td>75.61</td><td>80.09 ± 0.24</td><td>77.75 ± 0.40</td><td>78.90</td></tr><tr><td>MAPLE</td><td>70.40 ± 2.57</td><td>58.40 ± 3.00</td><td>63.71</td><td>76.50 ± 3.85</td><td>55.70 ± 3.19</td><td>64.27</td><td>78.57 ± 2.11</td><td>76.60 ± 1.56</td><td>77.53</td></tr><tr><td>DEPT</td><td>74.40 ± 0.83</td><td>53.13 ± 1.07</td><td>61.98</td><td>78.70 ± 1.56</td><td>50.53 ± 5.71</td><td>61.08</td><td>81.57 ± 0.84</td><td>66.53 ± 0.87</td><td>73.28</td></tr><tr><td>COA-LOSS</td><td>73.23 ± 2.02</td><td>58.09 ± 0.81</td><td>64.76</td><td>83.38 ± 0.49</td><td>70.07 ± 2.49</td><td>76.09</td><td>80.83 ± 0.80</td><td>74.22 ± 0.91</td><td>77.38</td></tr><tr><td>CoCOA-MIX</td><td>72.80 ± 1.89</td><td>64.29 ± 1.25</td><td>68.25</td><td>83.49 ± 0.66</td><td>69.11 ± 3.10</td><td>75.54</td><td>81.28 ± 0.95</td><td>77.75 ± 0.24</td><td>79.47</td></tr></table>
independently on Base and New, and their harmonic mean H (Xian et al., 2017) is calculated to evaluate the tradeoff between them. The final performance is reported as the average of three random seeds for a fair evaluation.
Table 1 shows that CoOp (Zhou et al., 2022c) achieves a higher average performance than CLIP on Base but a lower average performance on New, highlighting the need for generalization in prompt tuning. ProGrad (Zhu et al., 2023) and KgCoOp (Yao et al., 2023), which incorporate hand-crafted prompts during training, improve average performance on both Base and New. MaPLe (Khattak et al.,
2023a) and DePT (Zhang et al., 2024b) focus on improving performance on both Base and New by increasing model capacity. However, with only 4-shot training samples, they often overfit, limiting generalization. Our CoA-loss, when combined with a naive ensemble, improves Base performance but offers limited generalization as it only focuses on specialization. By incorporating CoA-weights, our CoCoA-Mix achieves the highest average performance on both Base and New without trade-offs. Notably, CoCoA-Mix surpasses the specialization performance of DePT while using $2.8\%$ of its parameters.
Table 2: Performance comparison on CIFAR100 in the FSCIL benchmark. Mean represents the average accuracy across all sessions, and PD indicates the performance difference between the first and last sessions.
<table><tr><td rowspan="2">METHOD</td><td colspan="9">ACC(%)↑</td><td rowspan="2">MEAN↑</td><td rowspan="2">PD↓</td></tr><tr><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td></tr><tr><td>L2P</td><td>89.9</td><td>86.0</td><td>81.8</td><td>80.3</td><td>80.0</td><td>74.6</td><td>73.2</td><td>72.6</td><td>65.0</td><td>78.2</td><td>24.9</td></tr><tr><td>CLIP-ZSL</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>77.9</td><td>-</td></tr><tr><td>CoOp-FSCIL</td><td>88.6</td><td>78.9</td><td>77.5</td><td>76.0</td><td>76.8</td><td>78.3</td><td>79.2</td><td>79.8</td><td>79.3</td><td>79.4</td><td>9.3</td></tr><tr><td>FACT w/ CLIP</td><td>87.8</td><td>84.0</td><td>81.4</td><td>78.0</td><td>77.8</td><td>76.3</td><td>75.0</td><td>72.5</td><td>71.9</td><td>78.3</td><td>15.9</td></tr><tr><td>FSPT-FSCIL</td><td>86.9</td><td>83.1</td><td>81.9</td><td>80.7</td><td>80.4</td><td>79.9</td><td>80.1</td><td>79.9</td><td>79.4</td><td>81.4</td><td>7.5</td></tr><tr><td>CoCOA-MIX (OURS)</td><td>88.2</td><td>85.6</td><td>84.6</td><td>82.7</td><td>82.8</td><td>82.5</td><td>82.3</td><td>81.8</td><td>80.8</td><td>83.5</td><td>7.4</td></tr></table>
Table 3: Performance comparison in cross-dataset transfer
<table><tr><td>METHOD</td><td>SOURCE</td><td>TARGET</td><td>H</td></tr><tr><td>CLIP</td><td>66.73</td><td>64.89</td><td>63.97</td></tr><tr><td>COOp</td><td>69.06 ± 0.43</td><td>59.88</td><td>61.52</td></tr><tr><td>PROGRAD</td><td>70.21 ± 0.16</td><td>62.36</td><td>63.58</td></tr><tr><td>KGCoOP</td><td>70.52 ± 0.05</td><td>64.45</td><td>65.17</td></tr><tr><td>MAPLE</td><td>69.53 ± 0.39</td><td>65.24</td><td>65.26</td></tr><tr><td>DEPT</td><td>68.03 ± 0.09</td><td>65.06</td><td>64.42</td></tr><tr><td>CoCoA-MIX</td><td>70.85 ± 0.09</td><td>65.27</td><td>66.07</td></tr></table>
Few-Shot Class-Incremental Learning (FSCIL) We evaluated our method on FSCIL tasks to verify its effectiveness in incremental learning with limited data. In FSCIL, the number of prompts $K$ was increased incrementally, with each prompt specializing in its session. For a fair comparison, CoCoA-Mix uses prompts with $M = 2$ per session. It has fewer parameters than methods with $M = 16$ until session 6 but requires more parameters from session 7. Table 2 shows the performance of FSCIL on the CIFAR100 dataset. L2P (Wang et al., 2022b), which dynamically selects prompts from a pool, shows high initial performance but suffers significant knowledge forgetting as new classes are added, leading to the highest performance difference (PD). CoOp-FSCIL (Zhou et al., 2022c) and FACT w/ CLIP (Zhou et al., 2022a) outperform zero-shot CLIP in early sessions but are affected by knowledge forgetting in later sessions. FSPT-FSCIL (Ran et al., 2024) outperforms zero-shot CLIP in all sessions by leveraging a brain-inspired strategy in prompt tuning. CoCoA-Mix performs lower in the first two sessions due to fewer parameters but achieves the highest performance in later sessions, outperforming the state-of-the-art methods. Details of the FSCIL implementation are provided in Appendix D.4.
Cross-Dataset Transfer We evaluate cross-dataset transfer by training on ImageNet with 1,000 classes in a 4-shot setting and testing on 10 different datasets. Table 3 shows the accuracy and harmonic mean for source and target datasets. CoOp improves source accuracy over zero-shot CLIP but
 Figure 4: Comparison of Base performance by loss function
reduces target accuracy, highlighting the need for generalization. ProGrad and KgCoOp similarly enhance source accuracy but fail to outperform zero-shot CLIP on the target dataset, indicating limited transferability of prompt knowledge. MaPLe and DePT improve transfer performance by introducing additional parameters but show limited source accuracy. CoCoA-Mix achieves the highest performance on both source and target datasets, demonstrating effective knowledge transfer across different datasets. Notably, CoCoA-Mix outperforms existing methods in generalization while utilizing only $0.26\%$ of the parameters used by MaPLe. Appendix E.1 provides detailed results on 10 datasets.
# 4.3. Effectiveness of Our Method
Performance Comparison with Existing Loss Functions We compared Base performance across various loss functions to demonstrate the effectiveness of CoA-loss for specialization in prompt tuning. Figure 4 shows the average Base performance for each loss function. Focal loss (FL) (Ross & Doolár, 2017) emphasizes misclassified samples but struggles to learn from well-classified ones, leading to poor performance compared with CE in prompt tuning. Generalized cross entropy (GCE) (Zhang & Sabuncu, 2018), which generalizes CE and mean absolute error (MAE), limits optimization on misclassified samples, restricting specialization. CE achieves better performance in prompt tuning by balancing well-classified and misclassified samples. MAE combined with CE treats all samples more equally and ensures consistent learning even in the few-shot setting, slightly improving performance. However, these loss functions fail to address confusing cases that significantly affect decision boundaries, limiting their performance. Adding
 (a)
 (b) Figure 5: (a) Proportion of predictions by zero-shot CLIP on EuroSAT. (b) Accuracy on easy test samples correctly predicted by zero-shot CLIP. (c) Accuracy on confusing test samples misclassified by zero-shot CLIP with a probability gap below 0.2. (d) Accuracy on all test samples.
 (c)
 (d)
Table 4: Comparison of performance based on the loss function used to train prompts and the strategy of mixing prompts. $T_{En}$ refers to the tuning ensemble methods (Lu et al., 2024). ViT-B/16 shows the average performance over 11 datasets, while $\mathrm{RN50 + RN101 + ViT - B / 16 + ViT - B / 32}$ reports the average over 10 datasets.
<table><tr><td>Backbone</td><td>Method</td><td>Loss</td><td>Ensemble</td><td>Base</td><td>New</td><td>H</td></tr><tr><td rowspan="5">ViT-B/16</td><td>CLIP</td><td>-</td><td>-</td><td>65.1</td><td>68.8</td><td>66.8</td></tr><tr><td>CLIP (w/ Ensemble)</td><td>-</td><td>Uniform Ensemble</td><td>70.6</td><td>74.3</td><td>72.3</td></tr><tr><td>CoA-loss (w/o Ensemble)</td><td>CoA-loss</td><td>-</td><td>78.6</td><td>68.5</td><td>72.9</td></tr><tr><td>CoA-loss (w/ Ensemble)</td><td>CoA-loss</td><td>Uniform Ensemble</td><td>79.1</td><td>73.7</td><td>76.2</td></tr><tr><td>CoCoA-Mix</td><td>CoA-loss</td><td>CoA-weights</td><td>79.3</td><td>75.1</td><td>77.0</td></tr><tr><td>RN50 + RN101</td><td>\( T_{En} + CoCoOp \)</td><td>CoCoOp</td><td>Sample-Aware Weight Generator</td><td>84.1</td><td>75.5</td><td>79.2</td></tr><tr><td rowspan="2">+ ViT-B/16 + ViT-B/32</td><td>\( T_{En} + CoA-Loss \)</td><td>CoA-loss</td><td>Sample-Aware Weight Generator</td><td>85.3</td><td>75.2</td><td>79.5</td></tr><tr><td>CoCoA-Mix</td><td>CoA-loss</td><td>CoA-weights</td><td>85.4</td><td>76.3</td><td>80.3</td></tr></table>
CoA-loss to CE achieves the best performance by effectively focusing on confusing cases. Detailed results and analysis are provided in Appendix E.3.
Effectiveness of Confusion-Aware Loss We analyze the effect of CoA-loss on model predictions using the EuroSAT dataset. Figure 5 compares training progress with and without CoA-loss. Figure 5(a) shows the proportion of predictions by zero-shot CLIP. Easy samples are correctly classified, while confusing samples are misclassified with a probability gap of less than 0.2 between the correct and incorrect classes. Hard samples are misclassified with a larger probability gap. Figure 5(b) and Figure 5(c) present performance on easy samples and confusing samples. While CoA-loss performs similarly to CE on easy samples, it significantly improves accuracy on confusing ones. Figure 5(d) shows that CoA-loss outperforms CE on test data by addressing confusing cases, enhancing class decision boundaries. The performance improvement on confusing samples with CoA-loss for each dataset is provided in Appendix E.2
Effectiveness of Confidence-Aware Weights We evaluate the effectiveness of CoA-weights in the context of prompt ensembling. As shown in Table 4, we compare var
ious ensembling strategies and loss functions across both single- and multi-backbone configurations. In the ViT-B/16 setting, uniform ensembling improves generalization performance over the CLIP baseline by aggregating predictions from multiple prompts. CoCoA-Mix, which integrates CoA-loss and CoA-weights, outperforms all other variants. This highlights the importance of confidence-aware weighting. In the model-level ensemble setting, CoCoA-Mix achieves the best performance, outperforming the tuning ensemble $(T_{\mathrm{En}})$ with a sample-aware weight generator (Lu et al., 2024). Notably, CoA-weights achieve this with only two learnable parameters, compared with over 205,204 parameters required by the sample-aware weight generator.
# Conclusion
We proposed CoCoA-Mix, a framework combining CoA-loss and CoA-weights to enhance specialization and generalization in prompt tuning. CoA-loss improves specialization by addressing confusing cases, while CoA-weights adjust the confidence of predictions to enhance generalization without sacrificing specialization. We believe our method sets a new direction for effective prompt tuning.
# Acknowledgements
This work was supported by Korea Evaluation Institute Of Industrial Technology (KEIT) grant funded by the Korea government(MOTIE) (No.20023455, Development of Cooperate Mapping, Environment Recognition and Autonomous Driving Technology for Multi Mobile Robots Operating in Large-scale Indoor Workspace). This research was supported by the KAIST Convergence Research Institute Operation Program.
# Impact Statement
Prompt tuning has emerged as a promising method for VLMs, enabling efficient adaptation to diverse tasks by optimizing a small set of parameters while keeping the core model frozen. However, real-world scenarios with unseen classes require more generalized solutions. We proposed a mixture model-based approach to enhance generality and improve performance in practical applications. We believe the outcomes of this research are largely positive, making it unnecessary to highlight specific negative impacts in this paper.
# References
Allingham, J. U., Ren, J., Dusenberry, M. W., Gu, X., Cui, Y., Tran, D., Liu, J. Z., and Lakshminarayanan, B. A simple zero-shot prompt weighting technique to improve prompt ensembling in text-image models. In International Conference on Machine Learning, pp. 547-568. PMLR, 2023. Bahng, H., Jahanian, A., Sankaranarayanan, S., and Isola, P. Exploring visual prompts for adapting large-scale models. arXiv preprint arXiv:2203.17274, 2022. Bossard, L., Guillaumin, M., and Van Gool, L. Food-101-mining discriminative components with random forests. In Proceedings of European Conference on Computer Vision, pp. 446-461, 2014. Cho, J., Lei, J., Tan, H., and Bansal, M. Unifying vision-and-language tasks via text generation. In International Conference on Machine Learning, pp. 1931-1942, 2021. Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3606-3613, 2014. Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. ImageNet: A large-scale hierarchical image database. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 248-255, 2009.
Dosovitskiy, A. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. Fei-Fei, L., Fergus, R., and Perona, P. Learning generative visual models from few training examples: An incremental Bayesian approach tested on 101 object categories. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshop, pp. 178-178, 2004. Fu, J., Xu, S., Liu, H., Liu, Y., Xie, N., Wang, C.-C., Liu, J., Sun, Y., and Wang, B. CMA-CLIP: Cross-modality attention CLIP for text-image classification. In Proceedings of the IEEE International Conference on Image Processing, pp. 2846-2850, 2022. Gildenblat, J. and contributors. PyTorch library for CAM methods. https://github.com/jacobgil/pytorch-grad-cam, 2021. Gu, X., Lin, T.-Y., Kuo, W., and Cui, Y. Open-vocabulary object detection via vision and language knowledge distillation. arXiv preprint arXiv:2104.13921, 2021. Helber, P., Bischke, B., Dengel, A., and Borth, D. EuroSAT: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(7):2217-2226, 2019. Jensen, J. L. W. V. Sur les fonctions convexes et les inégalités entre les valeurs moyennes. Acta mathematica, 30(1):175-193, 1906. Jia, M., Tang, L., Chen, B.-C., Cardie, C., Belongie, S., Hariharan, B., and Lim, S.-N. Visual prompt tuning. In Proceedings of European Conference on Computer Vision, pp. 709-727, 2022. Khattak, M. U., Rasheed, H., Maaz, M., Khan, S., and Khan, F. S. MaPLe: Multi-modal prompt learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 19113-19122, 2023a. Khattak, M. U., Wasim, S. T., Naseer, M., Khan, S., Yang, M.-H., and Khan, F. S. Self-regulating prompts: Foundational model adaptation without forgetting. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 15190-15200, 2023b. Kingma, D. P. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Krause, J., Stark, M., Deng, J., and Fei-Fei, L. 3D object representations for fine-grained categorization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshop, pp. 554-561, 2013.
Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. Lin, Y., Xie, Y., Chen, D., Xu, Y., Zhu, C., and Yuan, L. Revive: Regional visual representation matters in knowledge-based visual question answering. In Proceedings of the Annual Conference on Neural Information Processing Systems, volume 35, pp. 10560-10571, 2022. Lu, Z., Bai, J., Li, X., Xiao, Z., and Wang, X. Beyond sole strength: Customized ensembles for generalized vision-language models. In International Conference on Machine Learning, pp. 32924-32938. PMLR, 2024. Maji, S., Rahtu, E., Kannala, J., Blaschko, M., and Vedaldi, A. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013. Nguyen, A. T., Tran, T., Gal, Y., Torr, P., and Baydin, A. G. KL guided domain adaptation. In Proceedings of the International Conference on Learning Representations, 2022. Nilsback, M.-E. and Zisserman, A. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics, and Image Processing, pp. 722-729, 2008. Parkhi, O. M., Vedaldi, A., Zisserman, A., and Jawahar, C. Cats and dogs. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3498-3505, 2012. Ran, H., Gao, X., Li, L., Li, W., Tian, S., Wang, G., Shi, H., and Ning, X. Brain-inspired fast-and slow-update prompt tuning for few-shot class-incremental learning. IEEE Transactions on Neural Networks and Learning Systems, 2024. Rebguns, M. Wonderwords. https://pypi.org/project/wonderwords/, February 18, 2021. Ross, T.-Y. and Dólár, G. Focal loss for dense object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2980-2988, 2017. Soomro, K. UCF101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012. Tao, X., Hong, X., Chang, X., Dong, S., Wei, X., and Gong, Y. Few-shot class-incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12183-12192, 2020.
Wang, H., Wang, Z., Du, M., Yang, F., Zhang, Z., Ding, S., Mardziel, P., and Hu, X. Score-CAM: Score-weighted visual explanations for convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshop, pp. 24-25, 2020. Wang, P., Yang, A., Men, R., Lin, J., Bai, S., Li, Z., Ma, J., Zhou, C., Zhou, J., and Yang, H. OFA: Unifying architectures, tasks, and modalities through a simple sequence-to-sequence learning framework. In International Conference on Machine Learning, volume 162, pp. 23318-23340, 2022a. Wang, Z., Yu, J., Yu, A. W., Dai, Z., Tsvetkov, Y., and Cao, Y. SimVLM: Simple visual language model pretraining with weak supervision. arXiv preprint arXiv:2108.10904, 2021. Wang, Z., Zhang, Z., Lee, C.-Y., Zhang, H., Sun, R., Ren, X., Su, G., Perot, V., Dy, J., and Pfister, T. Learning to prompt for continual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 139-149, 2022b. Xian, Y., Schiele, B., and Akata, Z. Zero-shot learning the good, the bad and the ugly. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4582-4591, 2017. Xiao, J., Hays, J., Ehinger, K. A., Oliva, A., and Torralba, A. SUN database: Large-scale scene recognition from abbey to zoo. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition, pp. 3485-3492, 2010. Yao, H., Zhang, R., and Xu, C. Visual-language prompt tuning with knowledge-guided context optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6757-6767, 2023. Zhang, J., Ma, X., Guo, S., Li, P., Xu, W., Tang, X., and Hong, Z. Amend to alignment: Decoupled prompt tuning for mitigating spurious correlation in vision-language models. In International Conference on Machine Learning, 2024a. Zhang, J., Wu, S., Gao, L., Shen, H. T., and Song, J. DePT: Decoupled prompt tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12924-12933, 2024b. Zhang, Z. and Sabuncu, M. Generalized cross entropy loss for training deep neural networks with noisy labels. In Proceedings of the Annual Conference on Neural Information Processing Systems, volume 31, 2018.
Zhong, Y., Yang, J., Zhang, P., Li, C., Codella, N., Li, L. H., Zhou, L., Dai, X., Yuan, L., Li, Y., et al. RegionCLIP: Region-based language-image pretraining. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16793-16803, 2022. Zhou, D.-W., Wang, F.-Y., Ye, H.-J., Ma, L., Pu, S., and Zhan, D.-C. Forward compatible few-shot class incremental learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9046-9056, 2022a. Zhou, K., Yang, J., Loy, C. C., and Liu, Z. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16816-16825, 2022b. Zhou, K., Yang, J., Loy, C. C., and Liu, Z. Learning to prompt for vision-language models. International Journal of Computer Vision, 130(9):2337-2348, 2022c. Zhou, Z., Yang, M., Shi, J.-X., Guo, L.-Z., and Li, Y.-F. DeCoOP: Robust prompt tuning with out-of-distribution detection. In International Conference on Machine Learning, volume 235, pp. 62161-62177, 2024. Zhu, B., Niu, Y., Han, Y., Wu, Y., and Zhang, H. Prompt-aligned gradient for prompt tuning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 15659-15669, 2023.
# A. Proof of Theorem 3.2
Consider $K + 1$ individual prompts $\mathcal{T} = \{t_0, t_1, \ldots, t_K\}$ and a mixture model $\hat{p}_T^\pi$ with non-negative weights $\pi = \{\pi_0, \pi_1, \dots, \pi_K\}$ , where $\sum_{i=0}^{K} \pi_i = 1$ . Let $\mathcal{D}_T$ be an arbitrary target domain. The expected error $\epsilon_T(\hat{p}_T^\pi)$ of the mixture model on the target domain is defined as follows in terms of the Kullback-Leibler (KL) divergence:
$$\epsilon_ {T} (\hat {p} _ {\mathcal {T}} ^ {\pi}) = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \log \hat {p} _ {\mathcal {T}} ^ {\pi} (y) \right],$$
where $y$ is the ground-truth label for the image $\mathbf{x}$ .
Using the definition of the mixture model, $\hat{p}_{\mathcal{T}}^{\pi}(y) = \frac{\exp\left(\sum_{i=0}^{K}\pi_{i}\boldsymbol{s}_{\boldsymbol{t}_{i}}(y) / \tau\right)}{\sum_{l' \in \mathcal{Y}}\exp\left(\sum_{i=0}^{K}\pi_{i}\boldsymbol{s}_{\boldsymbol{t}_{i}}(l') / \tau\right)}$ , the expected error can be decomposed into two terms as follows:
$$\begin{array}{l} \epsilon_ {T} \left(\hat {p} _ {\mathcal {T}} ^ {\pi}\right) = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \log \hat {p} _ {\mathcal {T}} ^ {\pi} (y) \right] \\ = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \log \frac {\exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau\right)}{\sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l ^ {\prime}) / \tau\right)} \right] \\ = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau + \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right) \right] \\ = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau + \sum_ {i = 0} ^ {K} \pi_ {i} \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right) \right] \\ + \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l ^ {\prime}) / \tau\right) + \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l ^ {\prime}) / \tau\right) \right]. \\ \end{array}$$
The first term is rewritten using the definition of the individual predictive distribution $\hat{p}_{\boldsymbol{t}_i}$ for the prompt $\boldsymbol{t}_i$ , given as $\hat{p}_{\boldsymbol{t}_i}(y) = \frac{\exp\bigl(\boldsymbol{s}_{\boldsymbol{t}_i}(y) / \tau\bigr)}{\sum_{l' \in \mathcal{Y}} \exp\bigl(\boldsymbol{s}_{\boldsymbol{t}_i}(l') / \tau\bigr)}$ , as follows:
$$\begin{array}{l} \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau + \sum_ {i = 0} ^ {K} \pi_ {i} \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l ^ {\prime}) / \tau\right) \right] \\ = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau - \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right)\right) \right] \\ = \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \left(\log \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau\right) - \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right)\right) \right] \\ = \sum_ {i = 0} ^ {K} \pi_ {i} \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \log \frac {\exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau\right)}{\sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right)} \right] \\ = \sum_ {i = 0} ^ {K} \pi_ {i} \epsilon_ {T} (\hat {p} _ {\boldsymbol {t} _ {i}}). \\ \end{array}$$
As a result, the first term is equivalent to a convex combination of the expected errors of the individual predictive distributions with weights $\pi$ .
For the second term, Jensen's inequality (Jensen, 1906) can be applied to bound it, as $\log \sum$ exp is a convex function:
$$\begin{array}{l} \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right) + \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right) \right] \\ \leq \mathbb {E} _ {(\mathbf {x}, y) \sim \mathcal {D} _ {T}} \left[ - \sum_ {i = 0} ^ {K} \pi_ {i} \log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) / \tau\right) + \sum_ {i = 0} ^ {K} \pi_ {i} \left(\log \sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} \left(l ^ {\prime}\right) \tau\right)\right) \right] \\ \leq 0. \\ \end{array}$$
By combining the results from the first and second terms, we conclude that the expected error of the mixture model on the target domain is bounded as follows:
$$\epsilon_ {T} \left(\hat {p} _ {\mathcal {T}} ^ {\boldsymbol {\pi}}\right) \leq \sum_ {i} \pi_ {i} \epsilon_ {T} \left(\hat {p} _ {\boldsymbol {t} _ {i}}\right).$$
# B. Statistical Validation of Assumption 3.4
To empirically verify Assumption 3.4, we conducted a statistical experiment using the CIFAR-100 (Krizhevsky et al., 2009) dataset and the CLIP model. Specifically, we randomly partitioned the 100 classes into 50 in-classes and 50 out-classes. We then trained specialized prompts $\pmb{t}_i$ on the in-class subset using prompt tuning and compared their predictions against the zero-shot CLIP baseline on both domains. This process was repeated over 10 random splits.
Figure 6 presents a box plot summarizing the performance differences between the specialized prompt $\pmb{t}_i$ on the in-class domain $\mathcal{D}_{T_i}$ and the generalized zero-shot prompt $\pmb{t}_0$ . The results show that $\pmb{t}_i$ consistently outperforms $\pmb{t}_0$ on in-class samples from $\mathcal{D}_{T_i}$ , whereas $\pmb{t}_0$ achieves higher accuracy on out-class samples from $\mathcal{D}_{T_{j\neq i}}$ .
To assess statistical significance, we performed one-sided paired $t$ -tests on the per-split accuracy gaps. The resulting $p$ -values were $9.25 \times 10^{-12}$ for the in-class domain comparison ( $\mathrm{acc}_{t_i} > \mathrm{acc}_{t_0}$ ) and $2.06 \times 10^{-10}$ for the out-class domain comparison ( $\mathrm{acc}_{t_0} > \mathrm{acc}_{t_i}$ ), both significantly below the standard threshold of 0.05. These results allow us to reject the null hypothesis and confirm that both inequalities in Assumption 3.4 hold with strong statistical confidence.
These findings support the assumption that specialized predictions are more effective within their domain, whereas generalized predictions are preferable for unseen class domains.
 Figure 6: Box plots of accuracy differences across 10 random splits. The left shows performance gains of specialized over generalized predictions on in-class domain $\mathcal{D}_{T_i}$ , i.e. $\mathrm{acc}_{t_i} - \mathrm{acc}_{t_0}$ . The right shows gains of the generalized prediction on out-class domain $\mathcal{D}_{T_{j\neq i}}$ , i.e. $\mathrm{acc}_{t_0} - \mathrm{acc}_{t_i}$ .
# C. Effect of Cross-Entropy in the Mixture Model
The derivative of the cross-entropy $\mathcal{L}_{\mathrm{CE}}$ for the mixture model $\hat{p}_T^\pi$ with respect to $\pi_i^{\mathrm{in}}$ is as follows:
$$\begin{array}{l} \frac {\partial \mathcal {L} _ {\mathrm {C E}} (\mathbf {x} , y ; \hat {p} _ {\mathcal {T}} ^ {\boldsymbol {\pi}})}{\partial \pi_ {i}} = \frac {\partial \left(- \log \hat {p} _ {\mathcal {T}} ^ {\boldsymbol {\pi}} (y)\right)}{\partial \pi_ {i}} \\ = \frac {- 1}{\hat {p} _ {\mathcal {T}} ^ {\pi} (y)} \frac {\partial \hat {p} _ {\mathcal {T}} ^ {\pi} (y)}{\partial \pi_ {i}} \\ = \frac {- 1}{\hat {p} _ {\mathcal {T}} ^ {\pi} (y)} \frac {\partial}{\partial \pi_ {i}} \left(\frac {\exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) / \tau\right)}{\sum_ {l ^ {\prime} \in \mathcal {Y}} \exp \left(\sum_ {i = 0} ^ {K} \pi_ {i} \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l ^ {\prime}) / \tau\right)}\right) \\ = \frac {- 1}{\hat {p} _ {\mathcal {T}} ^ {\pi} (y)} \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) \hat {p} _ {\mathcal {T}} ^ {\pi} (y) - \hat {p} _ {\mathcal {T}} ^ {\pi} (y) \sum_ {l \in \mathcal {Y}} \hat {p} _ {\mathcal {T}} ^ {\pi} (l) \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l)\right) / \tau \\ = - \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) - \sum_ {l \in \mathcal {Y}} \hat {p} _ {\mathcal {T}} ^ {\pi} (l) \boldsymbol {s} _ {\boldsymbol {t} _ {i}} (l)\right) / \tau \\ = - \left(\boldsymbol {s} _ {\boldsymbol {t} _ {i}} (y) - \mathring {\boldsymbol {s}} _ {\boldsymbol {t} _ {i}}\right) / \tau , \\ \end{array}$$
where $\mathring{s}_{\pmb{t}_i}$ is the importance-weighted similarity defined as a weighted sum of the predicted probability of the mixture model and the similarity derived from the prompt $\pmb{t}_i$ , i.e. $\mathring{s}_{\pmb{t}_i} = \sum_{l \in \mathcal{Y}} \hat{p}_{\mathcal{T}}^{\pi}(l) s_{\pmb{t}_i}(l)$ . For example, if the mixture model predicts class $l^*$ with the highest probability, $\mathring{s}_{\pmb{t}_i}$ approximates the similarity $s_{\pmb{t}_i}(l^*)$ for class $l^*$ derived from prompt $\pmb{t}_i$ . Here, we explain how the CoA-weights $\pi_i$ for in-classes is optimized through the cross-entropy of the mixture model. For simplicity, we assume $\mathring{s}_{\pmb{t}_i} \approx s_{\pmb{t}_i}(l^*)$ , where $l^* = \arg \max_l \hat{p}_{\mathcal{T}}^{\pi}(l)$ .
In the case $s_{t_i}(y) > \mathring{s}_{t_i}$ , the prompt $t_i$ predicts the correct class $y$ with high similarity. Therefore, when the mixture model misclassifies, i.e., $l^* \neq y$ , the other prompts $t_{j \neq i}$ provide low similarities for the correct class $y$ . This case results in an increase in $\pi_i$ through gradient updates, encouraging the mixture model to rely more on $t_i$ .
Conversely, if $s_{\pmb{t}_i}(y) < \mathring{s}_{\pmb{t}_i}$ , the prompt $\pmb{t}_i$ predicts the correct class $y$ with low similarity. When the mixture model correctly classifies, i.e. $l^{*} = y$ , it suggests that the other prompts $\pmb{t}_{j \neq i}$ provide high similarities for the correct class $y$ , while the prompt $\pmb{t}_i$ underperforms. This case decreases $\pi_i$ , allowing the mixture model to trust the other prompts $\pmb{t}_{j \neq i}$ more.
# D. Implementation Details
# D.1. Details of CoA-Weights Optimization
There exist multiple strategies for optimizing the CoA-weights $\pi$ . To evaluate the effectiveness of different optimization strategies for CoA-weights, we compared two implementation approaches: one-stage optimization and two-stage optimization. Specifically, for one-stage optimization, we design the optimization process such that the temperature scale is weighted by $\pi_i$ , i.e., $\tau_i = \pi_i^{-1}\tau$ . We fix $\tau_0$ to the temperature of the pre-trained CLIP model, i.e. $\tau_0 = 0.01$ , and optimize $\tau_1$ jointly with prompt parameters. This enables the computation of $\pi$ satisfying $\sum_{i=0}^{K}\pi_i = 1$ , ensuring compatibility with the standard temperature scaling framework of CLIP. The optimization of a single scalar $\tau_1$ suffices to determine both $\pi$ and the global temperature $\tau$ , via the relation $\tau_i = \pi_i^{-1}\tau$ . However, the temperature scale $\tau$ is not fixed during optimization, which may introduce instability when $K \geq 2$ . In contrast, the two-stage strategy decouples prompt tuning and CoA-weights optimization. Here, $\pi$ is parameterized using a softmax of parameters $\alpha_0, \dots, \alpha_K$ . Concretely, we fix the pre-softmax logit $\alpha_0 = 0$ and optimize $\alpha_i$ under a fixed temperature $\tau = 0.01$ . The comparison of these strategies for the $K = 1$ case is reported in Table 5. The two strategies yield comparable performance, suggesting that the proposed loss function is robust to the specific choice of optimization parameterization for CoA-weights. In this paper, we used the one-stage strategy for most benchmarks and adopted the two-stage approach specifically for FSCIL tasks due to its stability advantages.
Table 5: Comparison of various optimization strategies with respect to $\pi_1$ and $\tau$ for Base and New domains. In one-stage optimization, $\tau_0$ is set to the temperature scale from pre-trained CLIP, i.e. 0.01. $\pi = \{\pi_0, \pi_1\}$ and $\tau$ are determined by optimizing $\tau_1$ . In two-stage optimization, $\alpha_0$ is set to 0, and $\pi$ and $\tau$ are determined by optimizing $\alpha_1$ .
<table><tr><td></td><td>π1</td><td>τ</td><td>Base</td><td>New</td><td>H</td></tr><tr><td>One-Stage Optimization</td><td>τ0/τ1+τ0</td><td>τ1·τ0/τ1+τ0</td><td>79.3</td><td>75.1</td><td>77.0</td></tr><tr><td>Two-Stage Optimization</td><td>exp(α1)/exp(α0)+exp(α1)</td><td>0.01</td><td>79.4</td><td>75.0</td><td>77.0</td></tr></table>
Table 6: 11 datasets used for base-to-new generalization and cross-dataset transfer
<table><tr><td>Dataset</td><td>CLASSES</td><td>TASK</td><td>DESCRIPTION</td><td>EXAMPLE CLASSES</td></tr><tr><td>IMAGENET</td><td>1,000</td><td>Object recognition</td><td>Large-scale dataset for object classification with diverse categories</td><td>tench, goldfish, great white shark, a tiger shark, etc.</td></tr><tr><td>CALTECH101</td><td>100</td><td>Object recognition</td><td>Variety of object categories with random background images.</td><td>Accordion, Airplane, Brain, Butterfly, Crab, Motorbike, etc.</td></tr><tr><td>OXFORDPETS</td><td>37</td><td>Fine-grained object recognition</td><td>Classification of pet breeds including cats and dogs.</td><td>Bengal, Persian, Beagle, American Bulldog, etc.</td></tr><tr><td>STANFORDCArs</td><td>196</td><td>Fine-grained object recognition</td><td>Images of various vehicle types, annotated by model.</td><td>2000 AM General Hummer SUV, 2007 BMW X5 SUV, etc.</td></tr><tr><td>FLOWERS102</td><td>102</td><td>Fine-grained object recognition</td><td>Classification of various flower species.</td><td>Daffodil, Pink Primrose, Tiger Lily, Yellow Iris, etc.</td></tr><tr><td>FOOD101</td><td>101</td><td>Object recognition</td><td>User-uploaded real-world food photos with varied backgrounds and noise.</td><td>Apple Pie, Waffles, Sushi, Chocolate Cake, Bibimbap, etc.</td></tr><tr><td>FGVCAIRCRAFT</td><td>100</td><td>Fine-grained object recognition</td><td>Aircraft images annotated hierarchically by variant, family, and manufacturer.</td><td>Boeing 717, DH-82, Falcon 2000, etc.</td></tr><tr><td>SUN397</td><td>397</td><td>Scene recognition</td><td>Covers diverse scenes including indoor, urban, and natural environments.</td><td>Abbey, Airport Terminal, Bedroom, Harbor, Bar, etc.</td></tr><tr><td>DTD</td><td>47</td><td>Texture attribute recognition</td><td>Real-world texture images annotated with descriptive attributes.</td><td>Striped, Dotted, Cracked, Fibrous, Scaly, Zigzagged, etc.</td></tr><tr><td>EUROSAT</td><td>10</td><td>Land use and land cover classification</td><td>Satellite images from Sentinel-2 focusing on land use and cover types.</td><td>Annual Crop Land, Forest, Highway or Road, River, etc.</td></tr><tr><td>UCF101</td><td>101</td><td>Action recognition</td><td>Video clips of human actions collected from YouTube in dynamic, real-world environments.</td><td>Apply Eye Makeup, Basketball Dunk, Playing Piano, etc.</td></tr></table>
# D.2. Details of Dataset
Table 6 lists datasets for base-to-new generalization and cross-dataset transfer. Evaluation across 11 datasets highlights generalizability and efficiency beyond specific tasks or domains.
# D.3. Base-to-New Generalization
Experiments were performed utilizing CLIP with a ViT-B/16 (Dosovitskiy, 2020) backbone. Training was conducted over 50 epochs with a batch size of 32. The prompt $t$ was optimized using the Adam optimizer with a learning rate of 0.002 and a weight decay of $5 \times 10^{-4}$ . CoA-weights were optimized using SGD with the same learning rate, a momentum of 0.9, and a weight decay of $5 \times 10^{-4}$ . The weight for $\mathcal{L}_{\mathrm{CoA}}$ was set to $w = 5.0$ , the weight for $\mathcal{L}_{\mathrm{Ent}}$ was set to 10.0, and the margin was set to $d = 0.2$ . The prompt length $M$ was set to 16.
# D.4. Few-Shot Class-Incremental Learning
Following Ran et al. (2024), experiments were conducted using CLIP with a ViT-L/14 (Dosovitskiy, 2020) backbone CoCoA-Mix used prompts of length $M = 2$ per session and accumulated them across sessions, requiring fewer parameters than the baseline except in the final two sessions. Each prompt was trained for specialization within its session, and the final prediction used all prompts from previous sessions. Tuned prompt $t_i$ for each session, along with CoA-weights $\pi_i^{\mathrm{in}}$ and $\pi_i^{\mathrm{out}}$ , were stored and reused. To ensure scaling stability across sessions, we used the two-stage optimization strategy for CoA-weights. Considering the number of iterations per session, CoA-weights were optimized for 2 epochs in the initial session, and for 100 epochs in all subsequent sessions. The margin $d$ of the loss $\mathcal{L}_{\mathrm{Ent}}$ was set to 0.1. In the initial session, the out-class set was generated using random words, and in subsequent sessions, it consisted of classes from previous sessions. All other settings followed those of base-to-new generalization.
# D.5. Cross-Dataset Transfer
Experiments used CLIP with a ViT-B/16 backbone. The weight for $\mathcal{L}_{\mathrm{CoA}}$ was set to $w = 7.0$ , while the loss weight for $\pi^{\mathrm{in}}$ was set to 2.0. Other settings followed those of base-to-new generalization.
Table 7: Performance comparison on 11 datasets in cross-dataset transfer.
<table><tr><td rowspan="2">Method</td><td rowspan="2">SOURCEIMAGENET</td><td rowspan="2">TARGETAVERAGE</td><td colspan="4">TARGET</td></tr><tr><td>CALTECH101</td><td>OXFORDPETS</td><td>STANFORDCARS</td><td>FLOWERS102</td></tr><tr><td>CLIP</td><td>66.73</td><td>64.89</td><td>93.27</td><td>89.18</td><td>65.56</td><td>68.05</td></tr><tr><td>COOP</td><td>69.06</td><td>59.88 (-5.01)</td><td>91.06 (-2.21)</td><td>86.74 (-2.44)</td><td>59.84 (-5.72)</td><td>62.38 (-5.67)</td></tr><tr><td>PROGRAD</td><td>70.21</td><td>62.36 (-2.53)</td><td>92.41 (-0.86)</td><td>87.90 (-1.28)</td><td>62.94 (-2.62)</td><td>66.98 (-1.07)</td></tr><tr><td>KGCoOP</td><td>70.52</td><td>64.45 (-0.43)</td><td>93.55 (+0.28)</td><td>89.86 (+0.68)</td><td>65.61 (+0.05)</td><td>68.33 (+0.28)</td></tr><tr><td>MAPLE</td><td>69.53</td><td>65.24 (+0.35)</td><td>93.43 (+0.16)</td><td>89.77 (+0.59)</td><td>65.70 (+0.14)</td><td>71.17 (+3.12)</td></tr><tr><td>DEPT</td><td>68.03</td><td>65.06 (+0.17)</td><td>94.07 (+0.80)</td><td>89.43 (+0.25)</td><td>65.87 (+0.31)</td><td>69.93 (+1.88)</td></tr><tr><td>CoCoA-MIX</td><td>70.85</td><td>65.27 (+0.38)</td><td>93.46 (+0.19)</td><td>89.07 (-0.11)</td><td>65.59 (+0.03)</td><td>68.72 (+0.67)</td></tr><tr><td rowspan="2">Method</td><td colspan="6">Target</td></tr><tr><td>FOOD101</td><td>FGVCAIRCRAFT</td><td>SUN397</td><td>DTD</td><td>EUROSAT</td><td>UCF101</td></tr><tr><td>CLIP</td><td>85.43</td><td>24.81</td><td>62.61</td><td>44.09</td><td>48.36</td><td>67.51</td></tr><tr><td>COOP</td><td>83.29 (-2.14)</td><td>16.71 (-8.10)</td><td>59.40 (-3.21)</td><td>38.44 (-5.65)</td><td>39.24 (-9.12)</td><td>61.66 (-5.85)</td></tr><tr><td>PROGRAD</td><td>84.37 (-1.06)</td><td>17.10 (-7.71)</td><td>62.67 (+0.06)</td><td>39.87 (-4.22)</td><td>45.39 (-2.97)</td><td>63.98 (-3.53)</td></tr><tr><td>KGCoOP</td><td>85.83 (+0.40)</td><td>21.18 (-3.63)</td><td>64.84 (+2.23)</td><td>44.30 (+0.21)</td><td>44.64 (-3.72)</td><td>66.39 (-1.12)</td></tr><tr><td>MAPLE</td><td>86.13 (+0.70)</td><td>23.27 (-1.54)</td><td>66.43 (+3.82)</td><td>44.83 (+0.74)</td><td>43.73 (-4.63)</td><td>67.93 (+0.42)</td></tr><tr><td>DEPT</td><td>86.27 (+0.84)</td><td>22.10 (-2.71)</td><td>65.77 (+3.16)</td><td>45.53 (+1.44)</td><td>44.00 (-4.36)</td><td>67.60 (+0.09)</td></tr><tr><td>CoCoA-MIX</td><td>85.78 (+0.35)</td><td>24.10 (-0.71)</td><td>63.61 (+1.00)</td><td>46.41 (+2.32)</td><td>48.18 (-0.18)</td><td>67.78 (+0.27)</td></tr></table>
# E. Additional Experimental Results
# E.1. Cross-Dataset Transfer
Table 7 presents the accuracy of the method trained on a single source dataset and evaluated on both source and target datasets. Parenthesized values represent the performance difference relative to zero-shot CLIP. CoCoA-Mix achieves the highest accuracy on the source dataset, highlighting the effectiveness of CoA-loss in specialization. It also achieved the highest average accuracy across 10 target datasets, validating the effect of CoA-weights. For FGVCAircraft, DTD, and EuroSAT, where zero-shot CLIP shows significant performance gaps between source and target datasets, CoCoA-Mix exhibits the most stable and effective transferability, maintaining high performance with minimal accuracy degradation compared with previous methods. This suggests that CoCoA-Mix is particularly effective under significant domain shifts. The relatively lower generalization improvement over base-to-new generalization is discussed in Appendix H.
# E.2. Performance Improvement on Confusing Samples of CoA-loss
We define confusing samples as those misclassified by zero-shot CLIP with a probability gap of 0.5 or less between the correct and incorrect classes. Figure 7 presents the performance of confusing samples from the test data across 11 datasets for the Base classes. While slight performance drops are observed on datasets such as Food101, SUN397, and DTD, CoA-loss consistently enhances specialization across most datasets, with notable improvements on OxfordPets, Flowers102, and UCF101. This demonstrates the effectiveness of CoA-loss in handling confusing cases while enhancing the performance across diverse datasets.
 Figure 7: Performance improvement on confusing samples, defined as instances with a probability gap $\leq 0.5$ between correct and incorrect labels or misclassified by zero-shot CLIP.
# E.3. Base Performance Comparison According to Loss Function
We compared CoA-loss with four loss functions: focal loss (FL) (Ross & Dóllar, 2017), generalized cross-entropy loss (GCE) (Zhang & Sabuncu, 2018), cross-entropy (CE), and mean absolute error (MAE). The results are presented in Figure 8.
FL modifies CE by weighting with $(1 - \hat{p})^{\gamma}$ as follows:
$$\mathcal {L} _ {\mathrm {F L}} (\mathbf {x}, y; \hat {p}) = - (1 - \hat {p} (y)) ^ {\gamma} \log \hat {p} (y), \tag {16}$$
where $\gamma \geq 0$ is a focusing parameter. FL prioritizes misclassified samples but limits learning from well-classified ones, leading to lower performance in prompt tuning.
GCE generalizes CE and MAE as follows:
$$\mathcal {L} _ {\mathrm {G C E}} (\mathbf {x}, y; \hat {p}) = \frac {1 - \hat {p} (y) ^ {q}}{q}, \tag {17}$$
where $q \in (0,1]$ transitions from CE ( $q \to 0$ ) to MAE ( $q = 1$ ). While designed to mitigate the overfitting of CE and slow convergence of MAE, GCE underperforms CE in prompt tuning.
CE, widely used in prompt tuning, is defined as follows:
$$\mathcal {L} _ {\mathrm {C E}} (\mathbf {x}, y; \hat {p}) = - \log \hat {p} (y). \tag {18}$$
Its gradients with respect to the similarity $s(y)$ and $s(c \neq y)$ are as follows, respectively:
$$\frac {\partial \mathcal {L} _ {\mathrm {C E}}}{\partial \boldsymbol {s} (y)} = - \frac {1}{\tau} (1 - \hat {p} (y)) \quad \text {a n d} \quad \frac {\partial \mathcal {L} _ {\mathrm {C E}}}{\partial \boldsymbol {s} (c \neq y)} = \frac {1}{\tau} \hat {p} (c), \tag {19}$$
where $\tau$ is the temperature. CE updates gradients based only on individual class probabilities, ignoring inter-class relationships.
Adding MAE to CE, the loss is defined as follows:
$$\mathcal {L} _ {\mathrm {C E} + \mathrm {M A E}} (\mathbf {x}, y; \hat {p}) = - \log \hat {p} (y) + w \frac {1}{| \mathcal {Y} |} \sum_ {l \in \mathcal {Y}} \left| \mathbb {1} _ {l = y} - \hat {p} (l) \right|, \tag {20}$$
where $w$ controls the contribution of MAE. While CE emphasizes difficult samples, MAE ensures uniform learning over all samples, improving robustness to noise. With optimized $w$ , CE+MAE slightly improves performance, but excessive MAE weighting reduces focus on difficult samples, degrading performance.
CoA-loss, similar to MAE, applies only to the correct class $y$ and is combined with CE as follows:
$$\mathcal {L} _ {\mathrm {C E} + \mathrm {C o A}} (\mathbf {x}, y; \hat {p}) = - \log \hat {p} (y) + w (1 - \hat {p} (y)), \tag {21}$$
where $w$ controls the contribution of CoA-loss. Unlike CE, CoA-loss considers both $\hat{p}(c \neq y)$ and $\hat{p}(y)$ when updating $\hat{p}(c \neq y)$ , focusing on confusing cases where $\hat{p}(y)$ and $\hat{p}(c \neq y)$ approach 0.5. By focusing learning near decision boundaries, $\mathrm{CE} + \mathrm{CoA}$ achieves the highest specialization performance.
 Figure 8: Performance comparison across various loss functions with varying hyperparameters. The hyperparameter setting for each loss is shown above each data.
Table 8: Effect of CoA-weight on Base and New classes.
<table><tr><td>πin i</td><td>πout i</td><td>BASE</td><td>NEW</td><td>H</td></tr><tr><td>X</td><td>X</td><td>79.12</td><td>73.66</td><td>76.15</td></tr><tr><td>✓</td><td>X</td><td>79.30</td><td>73.81</td><td>76.32</td></tr><tr><td>✓</td><td>✓</td><td>79.31</td><td>75.10</td><td>77.03</td></tr></table>
 (a)
 (b) Figure 9: Sensitivity analysis of hyperparameters. The dotted line indicates baseline performance. (a) Effect of CoA-loss weight $w$ on Base accuracy. (b) Effect of margin $d$ on New accuracy.
# F. Ablation Studies
# F.1. Effectiveness of Confidence-Aware Weights
To evaluate the effectiveness of CoA-weight, we conducted an ablation study on optimizing weights for Base classes $(\pi_i^{\mathrm{in}})$ and New classes $(\pi_i^{\mathrm{out}})$ separately and jointly. Table 8 shows that optimizing $\pi_i^{\mathrm{in}}$ for Base classes improves performance over the baseline. This indicates that confidence adjustment in the in-class domain provides additional benefits for specialization. When both $\pi_i^{\mathrm{in}}$ and $\pi_i^{\mathrm{out}}$ are optimized, the performance improves further, achieving the best harmonic mean between the Base and New classes. These results demonstrate that adapting weights for both in-classes and out-classes is crucial for achieving generalization without compromising specialization.
# F.2. Sensitivity of Hyperparameters
We analyzed the sensitivity of our method to hyperparameters by evaluating performance under different configurations. Specifically, we investigated the effect of varying weights $w$ for CoA-loss on Base classes and the margin $d$ for CoA-weights on New classes.
Figure 9(a) shows the Base performance for different $w$ values, with the red dashed line representing the standard cross-entropy baseline. Introducing CoA-loss improves specialization, and tuning $w$ effectively balances the focus on confusing cases, achieving superior performance. Figure 9(b) shows the New performance with varying margins $d$ . The red dashed line represents the baseline without $\pi^{\mathrm{out}}$ . Across all hyperparameter settings, our method outperforms the baseline, indicating that performance is relatively insensitive to the choice of margin $d$ .
# F.3. Generation of Unseen Classes
We conducted an ablation study to evaluate the effectiveness of different strategies for generating unseen classes. The study compares three methods: (1) no generation (None), (2) generating random strings (Random String), (3) generating a total of $N$ classes, with half as random strings and half sampled from the random word API (Rebguns, 2021) (Random String and Word), and (4) sampling $N$ words from the random word API (Rebguns, 2021) (Random Word). As represented in Table 9, sampling random words yields the best performance, outperforming other methods. This suggests that generating out-classes using semantically meaningful words, rather than arbitrary strings, further enhances generalization. This occurs because semantically meaningful words better align with learned embeddings, providing clearer semantic cues for distinguishing unseen classes, whereas arbitrary strings introduce noise into the embedding space.
Table 9: Ablation study comparing different strategies for generating unseen classes. The table reports accuracy on New classes.
<table><tr><td></td><td>NONE</td><td>RANDOM STRING</td><td>RANDOM STRING AND WORD</td><td>RANDOM WORD</td></tr><tr><td>ACCURACY</td><td>74.12</td><td>75.00</td><td>75.04</td><td>75.10</td></tr></table>
# G. Qualitative Visualizations
To better understand model behavior, we provide ScoreCAM (Wang et al., 2020) using the PyTorch library by Gildenblat et al. (2021), comparing CoCoA-Mix with zero-shot CLIP and CoOp. The visualization results are shown in Figure 10. In the Flowers102 dataset (New), CoCoA-Mix more accurately attends to semantically meaningful regions in out-class samples, suggesting that CoA-weights effectively enhance generalization. In the FGVC Aircraft dataset (Base), CoA-loss focuses more precisely on fine-grained details such as text on airplane wings, outperforming zero-shot CLIP in specialization. These qualitative results demonstrate that CoA-loss and CoA-weights contribute to generalization and specialization, respectively.
 Figure 10: ScoreCAM results on Flowers102 and FGVCAircraft. Red indicates higher activation. The leftmost column shows the image and ground-truth label. Other columns show the ScoreCAM results and predicted labels for each method.
# H. Limitation and Future Work
This study focused on textual prompt tuning. To demonstrate that improved performances in the source domain lead to better performance in the target domain, we adopted the following relation from Nguyen et al. (2022):
$$\epsilon_ {T} (\hat {p}) \leq \epsilon_ {S} (\hat {p}) + \frac {C}{\sqrt {2}} \sqrt {\operatorname {K L} \left(p _ {T} (\mathbf {z}) \mid p _ {S} (\mathbf {z})\right) + \delta}, \tag {22}$$
where $\mathbf{z}$ is defined as a visual embedding; $C$ is a constant that bounds $\log \hat{p}(l)$ , ensuring each class probability is at least $\exp(-C)$ ; $p_T$ and $p_S$ are the marginal distribution of $\mathbf{z}$ for the target and source domains, respectively;
This assumes that visual embeddings $\mathbf{z}$ remain consistent across domains, implying similar embeddings for images of the same semantic but differing styles. However, pre-trained CLIP can generate distinct visual embeddings for images with varying styles. As a result, while the proposed method ensures that prompts specialized for the source domain perform well in the target domain from a class perspective, it does not guarantee performance across target domains with different styles. This limitation is reflected in the results, where cross-dataset transfer shows weaker generalization compared with base-to-new generalization. Future work could address this by optimizing visual prompts to align embeddings of images with different styles but the same semantics. Such methods could enhance specialization and generalization across both classes and styles, enabling more robust performance across diverse domains.123version https://git-lfs.github.com/spec/v1oid sha256:f211bf5e45903b89b86c709a62a945590ef6cab23d3acb2bdb82f23ac802291esize 1604135123version https://git-lfs.github.com/spec/v1oid sha256:6d9608356d2dae1c5cef4f60f084c2816fcbbf487408e66663b16406f83fe816size 765425123version https://git-lfs.github.com/spec/v1oid sha256:36bc764cbaf4f4e62eab154b8e42df6cedc6a28c5d6ffd14078005ecfff348b5size 149066123version https://git-lfs.github.com/spec/v1oid sha256:4dc11cb9f557635a8cba3c3fd624f3f9c56d1d69d756b4170ef36f291d7f2932size 172071123version https://git-lfs.github.com/spec/v1oid sha256:266611f95079b3afb2e235b85c7f75b9da02d92486395caf6ac73b9bacd3bb73size 631392123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612# Zhan Qu\*123 Daniel Gomm\*45 Michael Farber 12
# Abstract
Temporal Graph Neural Networks (TGNNs) are widely used to model dynamic systems where relationships and features evolve over time. Although TGNNs demonstrate strong predictive capabilities in these domains, their complex architectures pose significant challenges for explainability. Counterfactual explanation methods provide a promising solution by illustrating how modifications to input graphs can influence model predictions. To address this challenge, we present CoDy—Counterfactual Explainer for Dynamic Graphs—a model-agnostic, instance-level explanation approach that identifies counterfactual subgraphs to interpret TGNN predictions. CoDy employs a search algorithm that combines Monte Carlo Tree Search with heuristic selection policies, efficiently exploring a vast search space of potential explanatory subgraphs by leveraging spatial, temporal, and local event impact information. Extensive experiments against state-of-the-art factual and counterfactual baselines demonstrate CoDy's effectiveness, with improvements of $16\%$ in $\mathrm{AUFSC}_{+}$ over the strongest baseline. Our code is available at: https://github.com/daniel-gomm/CoDy
# 1. Introduction
Dynamic graphs are commonly used to model applications with features that change over time, such as social networks, e-commerce platforms, and collaborative online encyclopedias like Wikipedia (Huang et al., 2024; Longa et al., 2023; Yu et al., 2023). In addition to the static topological graph structure, dynamic graphs also capture the continuously
$^{*}$ Equal contribution $^{1}$ TU Dresden, Dresden, Germany $^{2}$ ScaDS.AI, Dresden, Germany $^{3}$ Karlsruhe Institute of Technology, Karlsruhe, Germany $^{4}$ University of Amsterdam, Amsterdam, Netherlands $^{5}$ Centrum Wiskunde en Informatica, Amsterdam, Netherlands. Correspondence to: Daniel Gomm <daniel.gomm@cwi.nl>, Zhan Qu <zhan.qu@tu-dresden.de>.
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
 Figure 1. Bipartite dynamic graph of student posts on a university social network. Edge colors represent their ages.

evolving temporal dependencies. Consequently, Temporal Graph Neural Networks (TGNNs) have been specifically developed to leverage the rich spatial and temporal information inherent in dynamic graphs (Zhao et al., 2019; Rossi et al., 2020; Xu et al., 2020). However, as with many deep learning models, TGNNs often function as "black boxes", offering limited insight into their decision-making processes (Xia et al., 2023; Chen & Ying, 2023).
Explainability methods for Graph Neural Networks (GNNs) aim to identify a small subset of nodes and edges that most strongly influence a model's prediction. However, most existing methods are designed for static graphs and do not generalize well to dynamic graphs, which involve complex temporal interactions (He et al., 2022; Xia et al., 2023; Chen & Ying, 2023). In temporal graphs, multiple events may occur at the same timestamp and the same position, adding complexity to the dependencies between interactions (Han et al., 2020; He et al., 2022). The explanations for TGNNs should be temporally approximate and spatially adjacent to the target (Kovanen et al., 2011; Chen & Ying, 2023).
The few methods targeting TGNN models focus primarily on factual explanations, which identify specific nodes and edges contributing to a prediction (Xia et al., 2023; Chen & Ying, 2023). They fall short of exploring how changes in the input graph could lead to different outcomes. Counterfactual explanations, which illustrate how altering the graph changes the prediction, are gaining popularity for their ability to establish causal relationships and highlight decision
 Figure 2. CoDy search framework. The left side shows an example of a temporal input graph, where the explained future link is highlighted in blue, and the other links are color-coded based on their ages. On the right, one iteration of the CoDy algorithm is illustrated. Each rectangle represents a node in the search tree, corresponding to a specific perturbation of the input graph.
boundaries (Byrne, 2019; Prado-Romero et al., 2024). They provide actionable insights, help identify biases, and can uncover adversarial examples (Lucic et al., 2022). Despite temporal relationships in TGNNs often naturally suggesting causal links between nodes, no existing methods effectively leverage counterfactual explanations. Fig. 1 shows an example comparing factual and counterfactual explanations for a TGNN model's prediction that Student B will post on the Math 2 forum in the future. The factual explanation traces this prediction through indirect connections: Student B previously posted on Math 1, Student A posted on both Math 1 and Math 2, and both A and B posted on History 1. This can be complex and cognitively demanding to interpret. In contrast, the counterfactual explanation simplifies the reasoning by showing that, if Student B had not posted on Math 1, the post on Math 2 would not have occurred—highlighting the minimal set of actions necessary for the prediction (Lucic et al., 2022; Prado-Romero et al., 2024). In summary, factual explanations aim to identify a subgraph with sufficient information to reproduce the same prediction, while counterfactual methods seek the subset of information necessary to alter the outcome (Tan et al., 2022).
To address the need for concise and actionable explanations, we introduce CoDy (Counterfactual Explainer for Dynamic Graphs), a model-agnostic instance-level explainer for TGNNs. CoDy adopts principles from Monte Carlo Tree Search to efficiently identify counterfactual examples by modifying a subset of past events to alter the model's prediction. Further, we develop policies that leverage spatiotemporal structure and local event impacts to enhance search efficiency and effectiveness. Since CoDy is the first counterfactual explanation method for TGNNs, we develop GreeDy (Greedy Explainer for Dynamic Graphs), a strong counterfactual baseline that employs greedy search.
We propose a comprehensive evaluation framework that jointly assesses factual and counterfactual explanations on dynamic graphs. Our evaluation shows that CoDy excels in generating counterfactual explanations for TGNN models such as TGN (Rossi et al., 2020) and TGAT (Xu et al., 2020), outperforming GreeDy and factual methods, including PG-Explainer (Luo et al., 2020) and T-GNNExplainer (Xia et al., 2023) across multiple datasets. Additionally, we demonstrate that incorporating spatio-temporal context and local event impact significantly improves the relevance and fidelity of counterfactual explanations. This insight opens new directions for advancing TGNN explainability by leveraging richer temporal and structural cues.
In summary, our main contributions are as follows:
1. We introduce CoDy, the first method for generating counterfactual explanations for TGNNs. 2. We develop GreeDy, a baseline approach for counterfactual explanations in dynamic graphs. 3. We create an evaluation framework tailored to counterfactual explanations on dynamic graphs. 4. We conduct extensive benchmarks of CoDy, showing its superior performance compared to counterfactual and factual baselines.
# 2. Related Work
Numerous explainability methods have been proposed for GNNs on static graphs, leveraging techniques such as gradients (Baldassarre & Azizpour, 2019; Pope et al., 2019), perturbations (Ying et al., 2019; Luo et al., 2020), decomposition rules (Schnake et al., 2021), surrogate models (Huang et al., 2022; Vu & Thai, 2020), Monte Carlo Tree Search
(MCTS) (Yuan et al., 2021), and generative models (Yuan et al., 2020; Shan et al., 2021; Miao et al., 2022; Li et al., 2023). Still, explainability for Temporal Graph Neural Networks (TGNNs) remains underexplored and challenging.
Dynamic graphs are commonly represented using Discrete-Time Dynamic Graphs (DTDGs) and Continuous-Time Dynamic Graphs (CTDGs) (Kazemi et al., 2020). DTDGs represent a system through a sequence of static snapshots, each corresponding to a specific time interval. Most existing explainability methods focus on DTDGs, relying on techniques such as surrogate models (He et al., 2022), temporal decomposition (Liu et al., 2023), and model-specific feature analysis (Fan et al., 2021). These approaches typically aggregate feature importances across snapshots to provide explanations. Recently, generative approaches such as GRACIE (Prenkaj et al., 2024) have been proposed for counterfactual explanation in DTDGs. GRACIE leverages class-specific variational autoencoders to account for distributional shifts across discrete time steps and performs generative classification by modeling class-conditional graph distributions. Predictions are inferred via latent reconstruction loss, enabling principled counterfactual generation without relying on fixed decision boundaries. However, GRACIE is tailored to discrete-time snapshots and cannot be readily applied to CTDGs without substantial adaptation to account for continuous, event-based graph dynamics.
In contrast, CTDGs capture continuously evolving interactions through timestamped events, making them more representative of real-world applications such as social networks. Despite their significance, explainability for CTDGs remains relatively unexplored, with only two methods proposed: T-GNNExplainer (Xia et al., 2023) and TempME (Chen & Ying, 2023). T-GNNExplainer employs a search-based perturbation approach, utilizing MCTS and a Multi-Layer Perceptron-based navigator to predict event importances and guide search space exploration. TempME, on the other hand, identifies key temporal motifs—recurring patterns in dynamic graphs—to explain predictions.
Existing methods, however, are limited to factual explanations that identify influential factors but do not consider alternative scenarios. Counterfactual explanations, which have been successfully applied to static GNNs (Tan et al., 2022; Lucic et al., 2022), provide a more intuitive way to explore "what if" scenarios by identifying minimal changes needed to alter model predictions. However, adapting counterfactual explanations to temporal graphs is challenging due to their evolving nature and complex dependencies.
To address this, we propose a novel counterfactual explanation approach for CTDG-based TGNNs that captures both temporal dependencies and spatial structures. Our method enhances interpretability by providing explanations that are not only intuitive but also actionable.
# 3. Preliminaries and Problem Formulation
Continuous Time Dynamic Graphs (CTDG) We denote a CTDG as a sequence of timestamped events $\mathcal{G} = \{\varepsilon_1, \varepsilon_2, \ldots\}$ . Each event $\varepsilon_i$ is associated with a timestamp $t_i$ so that $t_{i-1} < t_i < t_{i+1}$ . Events represent the addition, removal, or attribute change of nodes or edges. Within a CTDG, we distinguish temporal distance, which is the difference in timestamps between two events, and spatial distance, defined as the shortest path distance within the graph structure between the nodes or edges involved in the events at their respective times. The $k$ -hop neighborhood of an event $\varepsilon_i$ covers the set of events that occurred within $k$ -edges of any nodes involved in event $\varepsilon_i$ until time $t_i$ .
Future Link Prediction A future link prediction model $f: \{\mathcal{G}(t_i), \varepsilon_i\} \to \mathbb{R}$ estimates the likelihood that a future event $\varepsilon_i$ will occur in the graph. Without loss of generality, we assume that the model $f$ outputs logit values as an approximation of these odds. The prediction is based on the history of events $\mathcal{G}(t_i) = \{\varepsilon_l | \varepsilon_l \in \mathcal{G}, t_l \leq t_i\}$ in the temporal graph $\mathcal{G}$ up to time $t_i$ . The model $f$ can be any suitable function, such as a TGNN trained for this task. A binary classification function $p: \mathbb{R} \to \{0,1\}$ transforms the output of $f$ into a definitive prediction, where 1 indicates that the future link is predicted to occur.
Counterfactual Examples in Future Link Prediction Counterfactual explanations provide actionable insights into specific predictions, making them particularly valuable for interpreting the outputs of complex deep graph models like TGNNs. A counterfactual example $\mathcal{X}_{\varepsilon_i}$ , explaining a prediction of a future link $\varepsilon_i$ , consists of a critical subset of past events $\mathcal{X}_{\varepsilon_i} \subseteq \mathcal{G}(t_i)$ necessary for the original prediction. This necessity is defined by the condition:
$$p \left(f \left(\mathcal {G} \left(t _ {i}\right), \varepsilon_ {i}\right)\right) \neq p \left(f \left(\left(\mathcal {G} \left(t _ {i}\right) \backslash \mathcal {X} _ {\varepsilon_ {i}}\right), \varepsilon_ {i}\right)\right) \tag {1}$$
For any given future link $\varepsilon_{i}$ , there may be multiple or no counterfactual examples. A counterfactual explainer, denoted as $ex(\cdot)$ , provides a rationale for the model's prediction. For future link predictions, $ex(\cdot)$ is a function that takes as input the TGNN model $f$ , the temporal graph $\mathcal{G}(t_i)$ , and the future link $\varepsilon_{i}$ , and outputs a subset of the original graph's events as counterfactual explanation, i.e. any combination of past events:
$$e x: \{f, \mathcal {G} (t _ {i}), \varepsilon_ {i} \} \rightarrow \bigcup_ {k = 0} ^ {| (\mathcal {G} (t _ {i}) \backslash \varepsilon_ {i}) |} \binom {\mathcal {G} (t _ {i}) \backslash \varepsilon_ {i}} {k} \tag {2}$$
The output of $ex$ can be any combination of past events. Formula 2 adheres to the notation for permutations described by Stanley (1986).
Objectives for Counterfactual Explanation We identify two primary objectives: maximizing the discovery of counterfactual examples and minimizing the complexity of these explanations. The goal of maximizing discoveries is to provide counterfactual explanations for as many instances as possible, while minimizing complexity aligns with the principle of Occam's razor, suggesting that explanations should be concise and contain only relevant details (Yuan et al., 2023; Tan et al., 2022). Thus, the explanation should contain as few events as possible.
# 4. Methodology
This section presents the Counterfactual Explainer for Models on Dynamic Graphs (CoDy) alongside the baseline method, Greedy Explainer for Models on Dynamic Graphs (GreeDy). Both approaches elucidate predictions made by TGNNs on CTDGs, focusing on efficiently navigating a defined search space to identify counterfactual examples.
Search Space In a dynamic graph, each subset of past events related to a future link may constitute a counterfactual example. Therefore, the complete search space $S_{\varepsilon_i}$ includes all combinations of past events of the predicted future link $\varepsilon_i$ . Given that this search space grows exponentially with the number of past events, we streamline the search process by imposing spatial and temporal constraints, narrowing the focus to a subset of past events located within the spatiotemporal vicinity of the target future link event. To limit the search space spatially, we only consider events within a $k$ -hop-neighborhood of the target future link. The value of $k$ is selected based on the specific dynamic graph model; for explaining TGNNs, we set $k$ equal to the number of layers in the TGNN, as contemporary TGNNs primarily aggregate information from events within this neighborhood (Yuan et al., 2021). Temporally, we retain only the $m_{max}$ most recent events that satisfy the spatial constraint. We denote this constrained subset of past events as $C(\mathcal{G}, \varepsilon_i, k, m_{max})$ , yielding the constrained search space $\hat{S}\varepsilon_i$ :
$$\hat {S} _ {\varepsilon_ {i}} = \bigcup_ {l = 0} ^ {| C (\mathcal {G}, \varepsilon_ {i}, k, m _ {\max }) |} \binom {C (\mathcal {G}, \varepsilon_ {i}, k, m _ {\max })} {l} \tag {3}$$
Search Tree Structure The search is guided by a partial search tree $P$ . Each node represents removing a unique subset of past events from the original input graph. The root node $n_{root}$ corresponds to the original input graph without removing events, while other nodes represent the result of omitting past events from the graph. The depth of a node reflects the number of omitted events, with deeper nodes corresponding to more extensive modifications.
In contrast to search trees utilized for factual explanations (Xia et al., 2023; Yuan et al., 2021), the search tree
in CoDy is specifically designed for counterfactual exploration. The goal is to identify the minimal set of events whose removal alters the model's prediction. Any child node in the tree extends the set of omitted events associated with its parent node by an additional event. This search tree is dynamically constructed as the search progresses, facilitating efficient traversal through the space of potential counterfactual explanations while minimizing unnecessary expansions. This structure promotes the identification of concise and relevant counterfactual examples, aligning with the dual objectives of maximizing discoveries and minimizing complexity.
# 4.1. Selection Policies
Selection policies guide the traversal of the partial search tree by prioritizing which nodes to explore. Each node in the search tree represents a unique combination of past events, with child nodes differing by the omission of a single event from their parent node. The selection policies rank these potential event omissions, directing the search toward efficiently discovering counterfactual examples. We propose four distinct policies:
- Random A baseline policy that randomly ranks events for omission from the input graph, serving as a comparison against more structured strategies. - Temporal This policy ranks events based on their temporal distance from the explained event $\varepsilon_{i}$ , assuming that more recent events have a greater influence on the model's prediction. The ranking function is defined as:
$$r _ {\text {t e m p}} \left(\varepsilon_ {j}\right) = \left| t _ {i} - t _ {j} \right| \tag {4}$$
where $t_i$ is the time of the future link event and $t_j$ is the timestamp of the past event $\varepsilon_j$ . Events with smaller $r_{temp}$ (i.e., shorter temporal distance) are prioritized.
- Spatio-Temporal This policy integrates both spatial proximity and temporal recency. Events are initially ranked by their spatial distance to the nodes involved in the explained event $\varepsilon_{i}$ . Among events with the same spatial proximity, they are further ranked by temporal distance. The ranking function is:
$$r _ {s p - t e m p} \left(\varepsilon_ {j}\right) = \left(d _ {\text {s p a t i a l}} \left(\varepsilon_ {j}, \varepsilon_ {i}\right), \left| t _ {i} - t _ {j} \right|\right) \tag {5}$$
where $d_{\text{spatial}}(\varepsilon_j, \varepsilon_i)$ is the shortest path distance between the nodes of $\varepsilon_j$ and $\varepsilon_i$ at time $t_i$ .
- Event-Impact This policy evaluates the impact of omitting each event from the full input graph on the model prediction by measuring the change in prediction logits. The event impact for an event $\varepsilon_{j}$ is defined as the difference between the original prediction $p_{orig}$
and the prediction $p_j$ made when $\varepsilon_{j}$ is removed from the input graph. The ranking is determined by:
$$\Delta \left(p _ {\text {o r i g}}, p _ {j}\right) = \left\{ \begin{array}{l l} p _ {\text {o r i g}} - p _ {j}, & \text {i f} p _ {\text {o r i g}} \geq 0 \\ p _ {j} - p _ {\text {o r i g}}, & \text {e l s e} \end{array} \right. \tag {6}$$
The search tree is first fully expanded at depth 1, exploring the effects of separately removing each event in the search space $C(\mathcal{G}, \varepsilon_i, k, m_{max})$ , calculating $\Delta(p_{orig}, p_j)$ for each event, and ranking events based on the magnitude of this change. Events with larger event impact on the prediction are prioritized.
Each selection policy offers a unique heuristic to guide the search. The Temporal and Spatio-Temporal policies leverage the structural properties of the graph by exploiting event timing and spatial relationships. In contrast, the Event-Impact policy directly measures the predictive influence of individual events, allowing for a more informed search based on the model's internal decision-making process. These policies provide a diverse set of strategies to navigate the search space efficiently and effectively.
# 4.2. GreeDy: Greedy Explainer on Dynamic Graphs
GreeDy is a search algorithm designed to find impactful counterfactual explanations by greedily exploring the search space. This exploration iteratively advances through the partial search tree $P$ by selecting paths that result in the greatest immediate change in the TGNN's prediction. Appendix A details the full algorithm.
At each iteration, GreeDy evaluates a subset of $l$ child nodes, sampled based on a selection policy. The sampled child nodes are ranked based on their potential to cause a shift in the TGNN model's prediction, with priority given to nodes that yield the most significant change. The search continues until a counterfactual example is found or further exploration no longer produces meaningful shifts.
The algorithm's output is the most impactful explanation discovered during the search, represented by the set of events whose omission causes the largest change in the model's prediction. This result can either be a valid counterfactual example or simply the set of events with the greatest non-counterfactual impact on the model's prediction.
# 4.3. CoDy: Counterfactual Explainer on Dynamic Graphs
CoDy draws on Monte Carlo Tree Search (Kocsis & Szepesvári, 2006), adapting its four key steps—Selection, Simulation, Expansion, and Backpropagation—to suit the search for counterfactual explanations in dynamic graphs. Algorithm 1 provides a high-level overview of CoDy.
Figure 2 illustrates an example iteration within the CoDy
Algorithm 1 Search algorithm of CoDy.
Input: TGNN model $f$ , input graph $\mathcal{G}$ , explained event $\varepsilon_{i}$ , selection policy $\delta$ , max iterations $it_{max}$
Output: best explanation found
$$p _ {o r i g} \leftarrow f (\mathcal {G} (t _ {i}), \varepsilon_ {i})$$
$$n _ {r o o t} \leftarrow (\varnothing , n u l l, n u l l, \varnothing , 0, n u l l, 1)$$
$$i t \leftarrow 0$$
while $it < it_{max}$ and $n_{root}$ is selectable do
$$n _ {s e l e c t e d} \leftarrow \mathbf {s e l e c t} \left(n _ {\text {r o o t}}, \delta\right)$$
$$\mathbf {s i m u l a t} \left(n _ {\text {s e l e c t e d}}, f, \mathcal {G}, \varepsilon_ {i}\right)$$
$$\mathbf {e x p a n d} (n _ {\text {s e l e c t e d}}, p _ {\text {o r i g}})$$
$$\text {b a c k p r o p a g a t e} \left(\text {p a r e n t} _ {\text {s e l e c t e d}}\right)$$
$$i t \leftarrow i t + 1$$
end
$$n _ {b e s t} \leftarrow \text {s e l e c t} _ {\text {b e s t}} (n _ {\text {r o o t}})$$
$$\text {r e t u r n} s _ {\text {b e s t}}$$
algorithm. The process begins with the recursive selection of a node in the search tree. In the depicted case, node $n_1$ is initially chosen due to its high score. Node $n_1$ has three unexpanded child nodes, each without a score. Following the temporal selection policy, node $n_4$ is selected next. Since $n_4$ has no child nodes, the recursion halts at this point. The simulation step then follows, where the model's output is inferred by perturbing the original input graph, omitting the events corresponding to $n_4$ . After this, node $n_4$ is assigned a score based on the TGNN model's output. The node is then expanded to include its child nodes. Finally, the new score is backpropagated through the tree, updating the scores of all parent nodes until the root node $n_{root}$ . In the following subsections, we provide an overview of these steps, with full details available in Appendix B.
Selection Each search iteration begins by selecting a node for expansion, starting from the root and recursively traversing the tree. During this traversal, the algorithm evaluates and selects child nodes based on the selection score $\text{sel\_score}(n_k)$ , which balances the need to explore new nodes and exploit known high-scoring ones:
$$\operatorname {s e l} _ {-} \operatorname {s c o r e} \left(n _ {k}\right) = \alpha \cdot \operatorname {s c o r e} _ {k} + (1 - \alpha) \cdot \operatorname {s c o r e} _ {\text {e x p l o r e}} \left(n _ {k}\right) \tag {7}$$
The exploration score $score_{explore}(n_k)$ is derived from the 'Upper Confidence Bound 1' (Auer et al., 2002), encouraging exploration, while $score_k$ denotes the exploitation score, reflecting the node's known potential to lead to a counterfactual example based on the outcomes of previous simulations. The parameter $\alpha \in [0,1]$ controls the trade-off between exploration and exploitation.
Simulation After selecting a node, the simulation step consists of inferring the prediction of the target TGNN
model using a perturbed input graph. Specifically, events associated with the selected node $n_j$ are omitted from the original input graph, resulting in a new prediction $p_j$ . This prediction is then used to compute the score $j$ :
$$s c o r e _ {j} \leftarrow \max \left(0, \frac {\Delta (p _ {o r i g} , p _ {j})}{| p _ {o r i g} |}\right) \tag {8}$$
A $score_{j} > 1$ signifies that the perturbation set associated with $n_{j}$ forms a counterfactual example. In this case, this set of nodes is saved as a counterfactual example.
Expansion The expansion adds child nodes to the selected node. Following the definition of the search tree, each new child node is initialized with a set of events to omit from the input graph. The attribute $score_{k}$ of each added child node $n_{k}$ is set to null, indicating that these nodes are unexplored.
Backpropagation The backpropagation recursively updates the search tree, starting from the parent node of the expanded node and proceeding until the root node. During this process, the exploitation and exploration scores are recalculated. The exploration score $score_{k}$ of $n_{k}$ is updated as:
$$\operatorname {s c o r e} _ {j} \leftarrow \frac {\operatorname* {m a x} \left(0 , \frac {\Delta \left(p _ {\text {o r i g}} , p _ {j}\right)}{\left| p _ {\text {o r i g}} \right|}\right) + \sum_ {n _ {k} \in C _ {j}} \left(\operatorname {s c o r e} _ {k} * \operatorname {s e l} _ {k}\right)}{\operatorname {s e l} _ {j}} \tag {9}$$
Here, $C_j$ refers to the child nodes of $n_j$ , and $sel_j$ represents the total number of selections of node $n_j$ .
Explanation Selection Once the search tree is fully expanded or the maximum number of iterations is reached, CoDy selects an explanation. To minimize complexity, CoDy prioritizes counterfactual examples with the minimum number of events. If multiple candidates share this minimal size, the one inducing the largest change in the TGNN's prediction (as defined in Eq. 6) is chosen, reflecting the most decisive minimal explanation. If no valid counterfactuals are found, a fallback-strategy is applied, which selects the most informative perturbation set encountered during the search, i.e., the one producing the greatest prediction shift according to Eq.6.
To enhance search efficiency, CoDy incorporates several optimization techniques: constraints are applied to minimize explanation complexity, caching mechanisms are utilized to reduce redundant calculations, and a two-stage approximation-confirmation approach is implemented to expedite inference during search.
# 5. Experiments
# 5.1. Experimental Setup
Datasets We evaluate on three datasets: Wikipedia (Kumar et al., 2019), UCI-Messages (Kunegis, 2013), and UCI-Forums (Kunegis, 2013). These datasets have diverse graph structures and event dynamics, allowing us to assess the generalizability of CoDy across different types of networks. The UCI datasets come from online social networks without node or edge features. Specifically, UCI-Messages is a unipartite graph of messages sent between students, while UCI-Forums is a bipartite graph of interactions between students and forums. The Wikipedia dataset consists of events representing edits made to Wikipedia articles. It is bipartite, with edges associated with attributes that detail edits to Wikipedia articles. Appendix C supplements detailed statistics and discusses the diversity of these datasets.
Target Models We evaluate two dynamic graph models: TGN (Rossi et al., 2020) and TGAT (Xu et al., 2020). Both are widely used in dynamic graph research (Souza et al., 2022; Chen & Ying, 2023; Xia et al., 2023) and excel at capturing temporal patterns within dynamic graphs. They are considered state-of-the-art for various dynamic graph tasks (Rossi et al., 2020; Souza et al., 2022). Despite their predictive success, TGN and TGAT operate as black-box models, providing limited insight into how input features influence their predictions. Due to page limitations, the results for TGAT are presented only in Appendix E, as they closely resemble those for TGN.
Configurations We train the TGN model using the "TGN-attn" configuration from the original paper (Rossi et al., 2020). The trained TGN model achieves high average precision scores (Transductive/Inductive): UCI-Messages $85.86\% / 83.26\%$ ; UCI-Forums $92.97\% / 89.39\%$ ; Wikipedia $97.80\% / 97.39\%$ . The TGAT model achieves comparable performance: UCI-Messages $85.14\% / 82.00\%$ ; UCI-Forums $91.31\% / 83.73\%$ ; Wikipedia $97.47\% / 96.74\%$ .
Factual Baselines We adapt two factual explainers as baselines: PGExplainer (Luo et al., 2020) and T-GNNExplainer (Xia et al., 2023). Though PGExplainer was originally developed for static graphs, it provides a valuable comparative perspective when adapted to dynamic contexts. We apply it with a fixed explanation sparsity of 0.2. T-GNNExplainer is designed for Temporal Graph Neural Networks and operates at the event level, making it an ideal baseline for our methodology. We follow its original specifications, using 500 iterations and 30 candidate events. While TempME (Chen & Ying, 2023) also explains TGNNs, it has a fundamentally different motif-based approach and limited comparability with our event-level counterfactual explanation framework. The authors primarily report neg-
Table 1. Results for the ${AUFSC}_{ + }$ , ${AUFSC}_{ - }$ ,and char scores of different explanation methods applied to the TGN model. Results are reported for three datasets: UCI-Messages (msg.), UCI-Forums (for.), and Wikipedia (wiki.). The best result for each experimental setting is shown in bold, and the second best is underlined.
<table><tr><td rowspan="3">Dataset</td><td colspan="6">\( AUFSC_{+} \)</td><td colspan="6">\( AUFSC_{-} \)</td><td colspan="6">char</td></tr><tr><td colspan="2">Correct</td><td colspan="4">Incorrect</td><td colspan="2">Correct</td><td colspan="4">Incorrect</td><td colspan="2">Correct</td><td colspan="4">Incorrect</td></tr><tr><td>msg.</td><td>for.</td><td>wiki.</td><td>msg.</td><td>for.</td><td>wiki.</td><td>msg.</td><td>for.</td><td>wiki.</td><td>msg.</td><td>for.</td><td>wiki.</td><td>msg.</td><td>for.</td><td>wiki.</td><td>msg.</td><td>for.</td><td>wiki.</td></tr><tr><td>PGExplainer</td><td>0.02</td><td>0.03</td><td>0.03</td><td>0.08</td><td>0.04</td><td>0.11</td><td>0.39</td><td>0.35</td><td>0.67</td><td>0.61</td><td>0.67</td><td>0.54</td><td>0.05</td><td>0.07</td><td>0.09</td><td>0.17</td><td>0.08</td><td>0.22</td></tr><tr><td>T-GNNExplainer</td><td>0.05</td><td>0.03</td><td>0.01</td><td>0.14</td><td>0.19</td><td>0.10</td><td>0.45</td><td>0.36</td><td>0.61</td><td>0.53</td><td>0.49</td><td>0.43</td><td>0.17</td><td>0.08</td><td>0.09</td><td>0.39</td><td>0.40</td><td>0.34</td></tr><tr><td>GreeDy-rand.</td><td>0.02</td><td>0.05</td><td>0.04</td><td>0.07</td><td>0.06</td><td>0.10</td><td>0.33</td><td>0.27</td><td>0.53</td><td>0.95</td><td>0.97</td><td>0.91</td><td>0.04</td><td>0.08</td><td>0.09</td><td>0.14</td><td>0.12</td><td>0.19</td></tr><tr><td>GreeDy-temp.</td><td>0.13</td><td>0.41</td><td>0.08</td><td>0.32</td><td>0.30</td><td>0.29</td><td>0.52</td><td>0.58</td><td>0.72</td><td>0.95</td><td>0.95</td><td>0.87</td><td>0.22</td><td>0.50</td><td>0.17</td><td>0.49</td><td>0.47</td><td>0.45</td></tr><tr><td>GreeDy-spa-temp.</td><td>0.19</td><td>0.44</td><td>0.12</td><td>0.37</td><td>0.29</td><td>0.37</td><td>0.64</td><td>0.60</td><td>0.76</td><td>0.93</td><td>0.91</td><td>0.85</td><td>0.31</td><td>0.53</td><td>0.23</td><td>0.54</td><td>0.46</td><td>0.54</td></tr><tr><td>GreeDy-evnt-impact</td><td>0.10</td><td>0.28</td><td>0.07</td><td>0.34</td><td>0.26</td><td>0.27</td><td>0.62</td><td>0.61</td><td>0.67</td><td>0.95</td><td>0.96</td><td>0.88</td><td>0.18</td><td>0.39</td><td>0.14</td><td>0.51</td><td>0.42</td><td>0.43</td></tr><tr><td>CoDy-rand.</td><td>0.10</td><td>0.30</td><td>0.12</td><td>0.34</td><td>0.30</td><td>0.41</td><td>0.63</td><td>0.59</td><td>0.82</td><td>0.91</td><td>0.92</td><td>0.82</td><td>0.19</td><td>0.43</td><td>0.24</td><td>0.52</td><td>0.47</td><td>0.58</td></tr><tr><td>CoDy-temp.</td><td>0.13</td><td>0.36</td><td>0.11</td><td>0.38</td><td>0.36</td><td>0.46</td><td>0.64</td><td>0.58</td><td>0.83</td><td>0.92</td><td>0.93</td><td>0.84</td><td>0.23</td><td>0.49</td><td>0.22</td><td>0.55</td><td>0.54</td><td>0.62</td></tr><tr><td>CoDy-spa-temp.</td><td>0.19</td><td>0.43</td><td>0.16</td><td>0.39</td><td>0.35</td><td>0.50</td><td>0.67</td><td>0.63</td><td>0.84</td><td>0.92</td><td>0.90</td><td>0.82</td><td>0.31</td><td>0.54</td><td>0.30</td><td>0.57</td><td>0.52</td><td>0.65</td></tr><tr><td>CoDy-evnt-impact</td><td>0.16</td><td>0.38</td><td>0.14</td><td>0.40</td><td>0.39</td><td>0.52</td><td>0.65</td><td>0.61</td><td>0.82</td><td>0.92</td><td>0.90</td><td>0.85</td><td>0.27</td><td>0.50</td><td>0.27</td><td>0.58</td><td>0.57</td><td>0.68</td></tr></table>
ative scores, suggesting explanations that preserve model predictions, instead of altering them. Additionally, the provided code is incomplete. We thus decided not to include TempME as a baseline.
Counterfactual Explainers We configure GreeDy with a candidate event limit of 64, sampling up to 10 events per iteration. For CoDy, we also limit the search space to 64 events, with a maximum of 300 iterations and $\alpha = \frac{2}{3}$ to emphasize exploration over exploitation. Appendix G shows a sensitivity analysis on these parameters.
Explained Instances Recognizing that explanations can differ between correct and incorrect predictions (Amara et al., 2022), we separately evaluate instances where the TGNN makes correct versus incorrect predictions. This distinction allows for a more comprehensive assessment of the robustness and reliability of explanation methods across different prediction outcomes.
# 5.2. Evaluation Framework
Factual and counterfactual explanations inherently address different aspects of model predictions. Factual explanations aim to identify the sufficient information for a prediction, while counterfactual explanations focus on identifying the necessary information (Tan et al., 2022). Our evaluation framework thus comprises metrics that allow a nuanced evaluation of necessity and sufficiency. Sparsity measures the complexity of an explanation by measuring the proportion of utilized features relative to the total number of available features. Sparsity scores range from 0 to 1, with lower scores indicating more concise explanations. Fidelity measures how effectively an explanation identifies key input characteristics that drive predictions. Based on the definitions of the probability of necessity and the probability of sufficiency introduced by Tan et al. (2022), we adopt two fidelity metrics, $fid_{-}$ and $fid_{+}$ . $fid_{-}$ measures how well the explanations capture sufficient features required so that the predictions remain unchanged (Amara et al., 2022).
In contrast, $fid_{+}$ assesses if removing the identified features changes the model's prediction, thus capturing the necessity (Amara et al., 2022). We assess the relationship between fidelity and sparsity by calculating the Area Under the Fidelity-Sparsity Curve (AUFSC) as $AUFSC_{+}$ and $AUFSC_{-}$ , respectively. We also report the Characterization Score char, which is the harmonic mean of $fid_{-}$ and $fid_{+}$ (Amara et al., 2022), and provides an integrated assessment of sufficiency and necessity.
Formal definitions of the metrics are provided in Appendix D. Appendix F provides additional evaluations on explainer runtime, the impact of search iterations, and the similarities between explanations from different explainers. Positive results further highlight CoDy's strong performance.
# 5.3. Results
# 5.3.1. NECESSITY OF EXPLANATIONS
Table 1 presents a comprehensive overview of the $AUFSC_{+}$ scores in various experimental scenarios. CoDy generally achieves the highest $AUFSC_{+}$ scores, except for correct predictions in the UCI-Forums dataset, where GreeDy-spatiotemporal (0.44) narrowly exceeds the result of CoDy-spatiotemporal (0.43). This highlights the proficiency of CoDy in providing concise necessary explanations. We observe a consistent trend of CoDy-spatiotemporal excelling in explaining correct predictions, while CoDy-event-impact performs better in elucidating incorrect predictions, albeit by minor margins (0.01–0.04). This hints at the higher importance of events that are spatially and temporally close to a correctly predicted future link, whereas for incorrect predictions, this seems to be of slightly less importance. For GreeDy, the spatio-temporal selection policy generally yields the best results. In general, factual baselines show poor performance in $AUFSC_{+}$ scores; T-GNNExplainer, despite being specifically developed for TGNNs, averages 75.05% lower than the top-performing explainer, CoDyspatiotemporal.
The disparity between explanations for correct and incor
 Figure 3. Cumulative $fid_{+}$ score relative to an upper sparsity limit for incorrect predictions with TGN as target model. PGExplainer is excluded since it is assessed with a fixed sparsity.



rect predictions is particularly pronounced in UCI-Messages and Wikipedia. All explainers identify necessary explanations for incorrect predictions more than twice as often as for correct ones. This suggests a fundamental difference between correct and incorrect predictions. For incorrect predictions, the model tends to misinterpret past information, making explanations easier to identify. In contrast, identifying a counterfactual example for correct predictions requires omitting information to render the prediction incorrect, which can be challenging if most past data align with the prediction. Despite this, explaining incorrect predictions is often more insightful, as it reveals misleading input features and uncovers model limitations. This understanding can inform model improvements and enhance robustness by highlighting areas where the model is vulnerable. Additionally, focusing on incorrect predictions allows for a clearer examination of the decision-making process, revealing potential biases and providing actionable insights for refining the model.
The superior performance of CoDy is further illustrated in Figure 3, which shows the $fid_{+}$ score achieved with explanations up to a given sparsity level. At sparsity 1, all necessary explanations are considered. All CoDy variants, especially spatio-temporal and event-impact, exhibit a rapid increase in $fid_{+}$ at low sparsity levels, highlighting CoDy's effectiveness in delivering concise explanations. T-GNNExplainer fails to achieve comparable performance, even at high sparsity levels, as it often neglects the most critical features relevant to the model's predictions.
Overall, CoDy, particularly with the spatio-temporal and event-impact policies, excels at balancing the dual objectives of maximizing counterfactual example discovery and minimizing explanation complexity. Unlike GreeDy, which rigidly follows its initial search direction, CoDy dynamically adapts to information gathered during search. Although GreeDy may occasionally outperform CoDy when its early path aligns with the optimal solution, CoDy's flexibility generally leads to better results. Further experiments show that CoDy's performance can be further improved by increasing search iterations (see Appendix F.3) and hyperparameter tuning (see Appendix G).
# 5.3.2. SUFFICIENCY OF EXPLANATIONS
Analyzing the sufficiency of the explanations through the AUFSC_ score, as shown in Table 1, reveals that CoDy consistently achieves high scores of over 0.82 for incorrect predictions and 0.58 for correct predictions, indicating that the generated explanations fulfill the sufficiency criteria to a high degree. Among CoDy variants, performance remains notably stable across different settings, with only minor differences observed.
Although factual methods are expected to achieve better $AUFSC_{-}$ scores, as they aim to identify sufficient explanations for predictions (Tan et al., 2022), PGExplainer and T-GNNExplainer do not consistently outperform their counterfactual counterparts. While T-GNNExplainer achieves impressive $fid_{-}$ scores of 0.82 and 0.9 for correct predictions in UCI-Messages and Wikipedia, it generally falls behind CoDy and GreeDy in $AUFSC_{-}$ . This inconsistency may be attributed to specific implementation details in T-GNNExplainer, particularly an approximation used in model calls, as noted by its original authors (Xia et al., 2023). Such approximations may hinder its ability to fully capture sufficient explanations.
Overall, the strong performance of CoDy and GreeDy underscores their effectiveness in providing concise yet impactful explanations, demonstrating that counterfactual methods excel not only in necessity but also in sufficiency.
# 5.3.3. CONVERGENT ANALYSIS
The characterization score char synthesizes the dimensions of sufficiency and necessity into a single score. Table 1 presents the explainers' performance along this metric. Notably, CoDy-event-impact excels in explaining incorrect predictions, whereas CoDy-spatio-temporal is superior for correct predictions. The $AUFSC_{+}$ and $AUFSC_{-}$ scores reveal that CoDy-event-impact and CoDy-spatio-temporal not only deliver excellent explanations in terms of necessity but also maintain comparably strong sufficiency. This underscores the significance of the fallback strategy, ensuring the provision of explanations even in the absence of counterfactual examples. These fallback explanations still deliver
mostly sufficient explanations. Thus, even though not all explanations are counterfactual, they consistently highlight pertinent input information.
# 5.3.4. COMPARISON OF SELECTION POLICIES
Selection policies significantly impact the performance of GreeDy and CoDy. The random policy yields the poorest results for either method. For GreeDy, applying the temporal selection policy improves the $AUFSC_{+}$ score by $386\%$ on average, while the spatio-temporal and event-impact policies yield improvements of $485\%$ and $304\%$ , respectively, over the random policy. CoDy exhibits a similar trend, albeit with smaller average improvements: $14.3\%$ for temporal; $36.7\%$ for spatio-temporal; $29.6\%$ for event-impact. This underscores the importance of spatial and temporal information for explanations. Across all tasks, CoDy-spatio-temporal outperforms the strongest baseline (i.e., GreeDy-spatio-temporal) by $16\%$ in $AUFSC_{+}$ .
The results demonstrate that CoDy robustly adapts its search based on initial results, exploring different paths if necessary. GreeDy adheres to its initial path, making it more reliant on the selection policy and susceptible to local optima.
Overall, the evaluation shows that CoDy consistently outperforms baseline methods, validating its effectiveness in generating factual and counterfactual explanations. This approach not only improves the identification of necessary and sufficient information but also shows the importance of leveraging spatio-temporal and event-impact insights to effectively navigate the complex search space.
# 5.3.5. PRACTICAL CONSIDERATIONS
In practice, CoDy emerges as the most robust and reliable choice. While it may require more computation when searching for minimal sparsity, its performance remains consistent across diverse scenarios. A practical implementation can significantly reduce runtime by terminating the search upon finding the first valid counterfactual, while still retaining CoDy's strong explanatory capabilities.
If computational efficiency and rapid explanation generation are the primary concerns, GreeDy offers a compelling, faster alternative. It can yield good results quickly, especially when its initial greedy choices align with an effective counterfactual path. However, this speed comes at the cost of a higher risk of suboptimal explanations and a greater likelihood of getting stuck in local optima.
The spatio-temporal selection strategy is the most suitable choice for real-world applications where ground-truth labels are not available. It performs best on correct predictions—which are most common in properly functioning TGNNs—and only slightly underperforms the event-impact policy when explaining incorrect predictions.
# 6. Conclusion
In this paper, we introduced CoDy, a counterfactual explanation method tailored for Temporal Graph Neural Networks (TGNNs) operating on Continuous-Time Dynamic Graphs. CoDy adapts Monte Carlo Tree Search to generate concise and actionable explanations. Our extensive evaluation demonstrates that CoDy outperforms existing factual explanation methods, such as PGExplainer and T-GNNExplainer, as well as GreeDy, a novel counterfactual baseline based on greedy search. We further show that incorporating spatiotemporal and event-impact information effectively guides the search process, significantly enhancing the quality of counterfactual explanations for TGNNs.
While our evaluation confirms CoDy's ability to identify compact counterfactual examples, future work could investigate its practical utility through user studies in real-world applications. Additionally, although CoDy currently focuses on generating explanations by removing graph components, it could be extended to also support operations such as adding nodes or edges, modifying features, or adjusting event timestamps. These extensions would substantially enlarge the search space, necessitating the development of new strategies to manage the increased complexity.
Despite these challenges, CoDy and its selection policies offer strong potential to advance the interpretability of TGNNs. By providing deeper insights into model decisions, CoDy can support the adoption of TGNNs in high-stakes domains such as finance, healthcare, and scientific research.
# Impact Statement
This work contributes to the broader goal of interpretable machine learning by introducing a novel counterfactual explanation method for temporal graph neural networks (TGNNs). As TGNNs are increasingly applied in high-stakes domains, such as finance and healthcare. CoDy provides actionable, model-agnostic explanations that can help users trust, debug, and audit temporal models. This work promotes transparency in evolving decision environments and may serve as a foundation for future human-in-the-loop or regulatory-compliant AI systems.
# Acknowledgements
The authors acknowledge support from the state of Baden-Württemberg through bwHPC and conducted substantial parts of this work at the Karlsruhe Institute of Technology. This work was funded by the Federal Ministry of Education and Research of Germany and the Saxon State Ministry for Science, Culture, and Tourism as part of the Center for Scalable Data Analytics and Artificial Intelligence Dresden/Leipzig (ScaDS.AI, project ID: SCADS24B).
# References
Amara, K., Ying, Z., Zhang, Z., Han, Z., Zhao, Y., Shan, Y., Brandes, U., Schemm, S., and Zhang, C. Graphframex: Towards systematic evaluation of explainability methods for graph neural networks. In Learning on Graphs Conference, LoG 2022, 9-12 December 2022, Virtual Event, volume 198 of Proceedings of Machine Learning Research, pp. 44. PMLR, 2022. Auer, P., Cesa-Bianchi, N., and Fischer, P. Finite-time Analysis of the Multiarmed Bandit Problem. Machine Learning, 47(2):235-256, 2002. ISSN 1573-0565. Baldassarre, F. and Azizpour, H. Explainability techniques for graph convolutional networks. In International Conference on Machine Learning (ICML) Workshops, 2019 Workshop on Learning and Reasoning with Graph-Structured Representations, 2019. Byrne, R. M. J. Counterfactuals in Explainable Artificial Intelligence (XAI): Evidence from Human Reasoning. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, pp. 6276-6282, 2019. Chen, J. and Ying, Z. Tempme: Towards the explainability of temporal graph neural networks via motif discovery. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. Fan, Y., Yao, Y., and Joe-Wong, C. Gcn-se: Attention as explainability for node classification in dynamic graphs. In 2021 IEEE International Conference on Data Mining (ICDM), pp. 1060-1065. IEEE Computer Society, 2021. Han, Z., Chen, P., Ma, Y., and Tresp, V. Explainable subgraph reasoning for forecasting on temporal knowledge graphs. In International conference on learning representations, 2020. He, W., Vu, M. N., Jiang, Z., and Thai, M. T. An explainer for temporal graph neural networks. In IEEE Global Communications Conference, GLOBECOM 2022, Rio de Janeiro, Brazil, December 4-8, 2022, pp. 6384-6389. IEEE, 2022. Huang, Q., Yamada, M., Tian, Y., Singh, D., and Chang, Y. Graphlime: Local interpretable model explanations for graph neural networks. IEEE Transactions on Knowledge and Data Engineering, 35(7):6968-6972, 2022. Huang, S., Poursafaei, F., Danovitch, J., Fey, M., Hu, W., Rossi, E., Leskovec, J., Bronstein, M., Rabusseau, G., and Rabbany, R. Temporal graph benchmark for machine learning on temporal graphs. Advances in Neural Information Processing Systems, 36, 2024.
Kazemi, S. M., Goel, R., Jain, K., Kobyzev, I., Sethi, A., Forsyth, P., and Poupart, P. Representation learning for dynamic graphs: A survey. J. Mach. Learn. Res., 21: 70:1-70:73, 2020. Kocsis, L. and Szepesvári, C. Bandit Based Monte-Carlo Planning. In Furnkranz, J., Scheffer, T., and Spiliopoulou, M. (eds.), Machine Learning: ECML 2006, Lecture Notes in Computer Science, pp. 282-293. Springer, 2006. ISBN 978-3-540-46056-5. Kovanen, L., Karsai, M., Kaski, K., Kertesz, J., and Saramaki, J. Temporal motifs in time-dependent networks. Journal of Statistical Mechanics: Theory and Experiment, 2011(11):P11005, 2011. Kumar, S., Zhang, X., and Leskovec, J. Predicting dynamic embedding trajectory in temporal interaction networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD 2019, Anchorage, AK, USA, August 4-8, 2019, pp. 1269-1278. ACM, 2019. Kunegis, J. KONECT - The Koblenz Network Collection. In Proc. Int. Conf. on World Wide Web Companion, pp. 1343-1350, 2013. Li, W., Li, Y., Li, Z., HAO, J., and Pang, Y. DAG matters! GFlownets enhanced explainer for graph neural networks. In The Eleventh International Conference on Learning Representations, 2023. Liu, Y. L., Zhang, X., and Xie, S. A differential geometric view and explainability of gnn on evolving graphs. In The Eleventh International Conference on Learning Representations (ICLR 2023). International Conference on Learning Representations, 2023. Longa, A., Lachi, V., Santin, G., Bianchini, M., Lepri, B., Lio, P., Scarselli, F., and Passerini, A. Graph neural networks for temporal graphs: State of the art, open challenges, and opportunities. Transactions on Machine Learning Research, 8, 2023. Lucic, A., ter Hoeve, M. A., Tolomei, G., de Rijke, M., and Silvestri, F. Cf-gnnexplainer: Counterfactual explanations for graph neural networks. In International Conference on Artificial Intelligence and Statistics, AISTATS 2022, 28-30 March 2022, Virtual Event, volume 151 of Proceedings of Machine Learning Research, pp. 4499-4511. PMLR, 2022. Luo, D., Cheng, W., Xu, D., Yu, W., Zong, B., Chen, H., and Zhang, X. Parameterized explainer for graph neural network. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
Miao, S., Liu, M., and Li, P. Interpretable and generalizable graph learning via stochastic attention mechanism. In International Conference on Machine Learning, pp. 15524-15543. PMLR, 2022. Pope, P. E., Kolouri, S., Rostami, M., Martin, C. E., and Hoffmann, H. Explainability methods for graph convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2019, Long Beach, CA, USA, June 16-20, 2019, pp. 10772-10781. Computer Vision Foundation / IEEE, 2019. Prado-Romero, M. A., Prenkaj, B., Stilo, G., and Giannotti, F. A survey on graph counterfactual explanations: definitions, methods, evaluation, and research challenges. ACM Computing Surveys, 56(7):1-37, 2024. Prenkaj, B., Villaizán-Vallelado, M., Leemann, T., and Kasneci, G. Unifying evolution, explanation, and discernment: A generative approach for dynamic graph counterfactuals. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 2420-2431, 2024. Rossi, E., Chamberlain, B., Frasca, F., Eynard, D., Monti, F., and Bronstein, M. Temporal graph networks for deep learning on dynamic graphs. CoRR, abs/2006.10637, 2020. Schnake, T., Eberle, O., Lederer, J., Nakajima, S., Schütt, K. T., Müller, K.-R., and Montavon, G. Higher-order explanations of graph neural networks via relevant walks. IEEE transactions on pattern analysis and machine intelligence, 44(11):7581-7596, 2021. Shan, C., Shen, Y., Zhang, Y., Li, X., and Li, D. Reinforcement learning enhanced explainer for graph neural networks. In Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pp. 22523-22533, 2021. Souza, A., Mesquita, D., Kaski, S., and Garg, V. Provably expressive temporal graph networks. Advances in neural information processing systems, 35:32257-32269, 2022. Stanley, R. P. Enumerative Combinatorics. Springer US, Boston, MA, 1986. ISBN 978-1-4615-9765-0 978-1-4615-9763-6. Tan, J., Geng, S., Fu, Z., Ge, Y., Xu, S., Li, Y., and Zhang, Y. Learning and evaluating graph neural network explanations based on counterfactual and factual reasoning. In WWW '22: The ACM Web Conference 2022, Virtual Event, Lyon, France, April 25 - 29, 2022, pp. 1018-1027. ACM, 2022.
Vu, M. N. and Thai, M. T. Pgm-explainer: Probabilistic graphical model explanations for graph neural networks. In Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. Xia, W., Lai, M., Shan, C., Zhang, Y., Dai, X., Li, X., and Li, D. Explaining temporal graph models through an explorer-navigator framework. In The Eleventh International Conference on Learning Representations, 2023. Xu, D., Ruan, C., Körpeoglu, E., Kumar, S., and Achan, K. Inductive representation learning on temporal graphs. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. Ying, Z., Bourgeois, D., You, J., Zitnik, M., and Leskovec, J. Gnnexplainer: Generating explanations for graph neural networks. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pp. 9240-9251, 2019. Yu, L., Sun, L., Du, B., and Lv, W. Towards better dynamic graph learning: New architecture and unified library. Advances in Neural Information Processing Systems, 36: 67686-67700, 2023. Yuan, H., Tang, J., Hu, X., and Ji, S. XGNN: towards model-level explanations of graph neural networks. In KDD '20: The 26th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Virtual Event, CA, USA, August 23-27, 2020, pp. 430-438. ACM, 2020. Yuan, H., Yu, H., Wang, J., Li, K., and Ji, S. On explainability of graph neural networks via subgraph explorations. In Proceedings of the 38th International Conference on Machine Learning, ICML 2021, 18-24 July 2021, Virtual Event, volume 139 of Proceedings of Machine Learning Research, pp. 12241-12252. PMLR, 2021. Yuan, H., Yu, H., Gui, S., and Ji, S. Explainability in graph neural networks: A taxonomic survey. IEEE Trans. Pattern Anal. Mach. Intell., 45(5):5782-5799, 2023. Zhao, L., Song, Y., Zhang, C., Liu, Y., Wang, P., Lin, T., Deng, M., and Li, H. T-gcn: A temporal graph convolutional network for traffic prediction. IEEE transactions on intelligent transportation systems, 21(9):3848-3858, 2019.
# A. Details of the GreeDy Algorithm
Input: TGNN model $f$ , input graph $\mathcal{G}$ , explained event $\varepsilon_{i}$ , selection policy $\delta$ , number of events to sample in each iteration $l$
Algorithm 2 GreeDy search algorithm for counterfactual examples. Output: best explanation found $\mathcal{X}$ $n_{best} \gets n_{root}$ ; ```txt$p_{orig} \gets f(\mathcal{G}(t_i), \varepsilon_i)$ $n_{root} \gets (\emptyset, p_{orig}, null, \emptyset)$```
while $s_{best}$ does not include all candidate events $C(\mathcal{G},\varepsilon_i,k,m_{max})$ do end ```latexchildrenbest $\leftarrow$ set of $l$ child nodes with highest rank according to $\delta$ , each child nchild initialized with prediction $p_{child} = f((\mathcal{G}(t_i)\backslash s_{child}),\varepsilon_i)$ $n_{best - child}\gets \arg \max_{n_j\in childrenbest}\Delta (p_{orig},p_j)$ if $\Delta (p_{best},p_{best - child}) > 0$ then /\* nbest-child shifts the prediction further towards the opposite sign of the original prediction $n_{best}\gets n_{best - child}$ if $\Delta (p_{orig},p_{best}) > |p_{orig}|$ then /\* sbest is a counterfactual example end else | break end```
```txtreturn $s_{best}$```
 Figure 4 depicts the operation of GreeDy. Each iteration involves selecting three past events $(l = 3)$ using a policy $\delta$ . Starting from the root node, node $n_2$ is chosen as the best node ( $n_{best}$ ) in the first iteration, with a perturbation set $s_2 = \varepsilon_2$ and a prediction score of 1.996. As iterations proceed, the prediction score of $n_{best}$ decreases until it becomes negative in the third iteration. At this point, the search ends, yielding the counterfactual example $\mathcal{X} = s_9 = \varepsilon_2, \varepsilon_1, \varepsilon_5$ . Figure 4. Example for the operation of the GreeDy approach.
# B. Details of the CoDy Algorithm
CoDy models nodes in the search tree as tuples. A node $n_j$ is defined by the tuple:
$$n _ {j} = \left(s _ {j}, p _ {j}, \text {p a r e n t} _ {j}, \text {c h i l d r e n} _ {j}, \text {s e l e c t i o n s} _ {j}, \text {s c o r e} _ {j}, \text {s e l e c t a b l e} _ {j}\right) \tag {10}$$
$s_j$ denotes the perturbation set (i.e., set of past events) associated with $n_j$ . $parent_j$ denotes the parent node in the search tree, while $children_j$ denotes the set of child nodes in the search tree. $selections_j$ is an integer value that tracks how often the specific node has been selected. $selectable_j$ indicates whether the node is still considered for selection (for example, it does not make sense to select a node that already constitutes a counterfactual example, since its child nodes can only contain counterfactual examples with higher complexity).
Algorithm 3 shows the recursive child node selection process. Child nodes are first ranked by their selection score and ties in this score are broken using a selection policy $\delta$ .
Algorithm 3 Recursive selection algorithm. ```txtFunction select $(n_j,\delta)$ .. if $n_j$ is not yet expanded then return $n_j$ end $n_{best}\gets \arg \max_{n_k\in \text{selectable\_children}(n_j)}\text{sel\_score}(n_k)$ if there is more than one child with the highest selection score then $n_{best}\gets$ highest ranking child node according to selection strategy $\delta$ end return select $(n_{best})$ end```
The simulation algorithm (Algorithm 4) consists of calling the explained TGNN to predict the score for the future link given the input graph without the events $s_j$ associated with the selected node $n_j$ .
Algorithm 4 Algorithm for simulating the link prediction on the selected node. ```txtFunction simulate $(n_j, f, \mathcal{G}, \varepsilon_i)$ : $p_j \gets f((\mathcal{G}(t_i) \setminus s_j), \varepsilon_i)$ return $p_j$ end```
Algorithm 5 showcases the expansion process. First, values for $selection_{j}$ and $score_{j}$ are set for the selected node $n_j$ . Second, depending on whether $s_j$ constitutes a counterfactual example the node is added to the list of counterfactual examples, or expanded further. This expansion entails adding all possible child nodes with initial null values.
Algorithm 5 Function for expanding the selected node. ```txtFunction expand $(n_j, p_{orig})$ : selections $j \gets 1$ score $j \gets \max \left(0, \frac{\Delta(p_{orig}, p_j)}{|p_{orig}|}\right)$ if score $j > 1$ then | selectable $j \gets 0$ Add $n_j$ to a list of counterfactual examples cfexamples else children $j \gets \{(s_k, null, n_j, \emptyset, 0, null, 1): s_k \in \hat{S}_{\varepsilon_j} \text{ with } |s_k| = |s_j| + 1, s_j \subset s_k\}$ if children $j = \emptyset$ then end end```
The backpropagation algorithm (Algorithm 6) recursively updates the score $j$ , selections $j$ , and selectable $j$ values of each traversed node $n_j$ .
Algorithm 6 Backpropagation function that recursively updates the information of nodes in the search tree. Function backpropagate $(n_j)$ .. if $n_j = null$ then return end selectionsj $\leftarrow$ selectionsj + 1 scorej $\leftarrow$ max $\left(0,\frac{\Delta(p_{orig},p_j)}{|p_{orig}|}\right)$ scorej $\leftarrow$ scorej + $\sum_{n_k\in children_j}(score_k*$ selectionsk) scorej $\leftarrow$ scorej if No child in childrenj is selectable then |selectablej $\leftarrow 0$ end
# C. Dataset Statistics
The explainers are evaluated on three different datasets. These datasets are diverse in terms of their size, their structure, and the temporal density of events, aiming to verify that the explanation approaches perform similarly on different datasets.
Table 2 provides an overview of the key statistics of datasets. The two datasets from the UCI social network cover a longer timespan and are more sparse in the temporal dimension than the Wikipedia dataset. Another substantial difference is that, in contrast to the other datasets, the UCI-Messages dataset contains a relatively high number of unique edges compared to the number of total edges. Furthermore, the UCI-Messages and UCI-Forums datasets have proportionally fewer multi-edges compared to the Wikipedia dataset.
Table 2. Statistics for datasets
<table><tr><td>Dataset</td><td># Nodes</td><td>#Edges</td><td># Unique Edges</td><td>Timespan</td><td>Graph Type</td></tr><tr><td>UCI-Messages (Kunegis, 2013)</td><td>1,899</td><td>59,835</td><td>20,296</td><td>196 days</td><td>Unipartite</td></tr><tr><td>UCI-Forums (Kunegis, 2013)</td><td>1,421</td><td>33,720</td><td>7,089</td><td>165 days</td><td>Bipartite</td></tr><tr><td>Wikipedia (Kumar et al., 2019)</td><td>9,227</td><td>157,474</td><td>18,257</td><td>30 days</td><td>Bipartite</td></tr></table>
# D. Evaluation Framework
We evaluate the explanation methods using sparisty, $fid_{+}$ , $fid_{-}$ , $AUFSC_{+}$ , $AUFSC_{-}$ , and char.
Sparsity: Sparsity is a widely used metric to gauge the complexity of explanations (Prado-Romero et al., 2024; Yuan et al., 2023; Amara et al., 2022), capturing how well the complexity of explanations is minimized. We define it as the mean ratio between the size of explanations $|\mathcal{X}_{\varepsilon_i}|$ and the size of the full set of candidate events $|C(\mathcal{G}, \varepsilon_i, k, m_{max})|$ :
$$\text {s p a r s i t y} = \frac {1}{N} \sum_ {i = 1} ^ {N} \frac {\left| \mathcal {X} _ {\varepsilon_ {i}} \right|}{\left| C \left(\mathcal {G} , \varepsilon_ {i} , k , m _ {\max }\right) \right|} \tag {11}$$
Fidelity: The fidelity metrics capture how well the explanations capture pertinent events. Since we are comparing factual and counterfactual explainers we adapt the definitions for the probability of sufficiency and the probability of necessity introduced by Tan et al. (2022) and map them to two fidelity metrics, $fid_{+}$ and $fid_{-}$ , for the context of temporal graphs. In line with the definitions of Amara et al. (2022) we assess fidelity with regards to the predictions of the model, not in regards to the ground truth labels. This is sometimes termed "correctness" or "validity" Prado-Romero et al. (2024).
$$f i d _ {-} = \frac {1}{N} \sum_ {i = 1} ^ {N} \mathbb {1} \left(p \left(f \left(\mathcal {G} \left(t _ {i}\right)\right), \varepsilon_ {i}\right) = p \left(f \left(\mathcal {X} _ {\varepsilon_ {i}}, \varepsilon_ {i}\right)\right)\right) \tag {12}$$
$$f i d _ {+} = 1 - \frac {1}{N} \sum_ {i = 1} ^ {N} \mathbb {1} \left(p \left(f \left(\mathcal {G} \left(t _ {i}\right)\right), \varepsilon_ {i}\right) = p \left(f \left(\left(\mathcal {G} \left(t _ {i}\right) \backslash \mathcal {X} _ {\varepsilon_ {i}}\right), \varepsilon_ {i}\right)\right)\right) \tag {13}$$
In these equations, $\varepsilon_1,\dots,\varepsilon_N$ represent the explained future links in an experiment, and $\mathcal{X}_{\varepsilon_1},\dots,\mathcal{X}_{\varepsilon_N}$ denote their corresponding explanations. The indicator function $\mathbb{1}(a = b)$ returns 1, if $a$ equals to $b$ , otherwise, it returns 0. Based on the fidelity scores we calculate $AUFSC_{+}$ and $AUFSC_{-}$ by integrating over the fidelity-sparsity curve.
Characterization Score: To jointly assess necessity and sufficiency, we adopt the characterization score char introduced by Amara et al. (2022):
$$\operatorname {c h a r} = \frac {w _ {+} + w _ {-}}{\frac {w _ {+}}{f i d _ {+}} + \frac {w _ {-}}{f i d _ {-}}} \tag {14}$$
Here, $w_{+}$ and $w_{-}$ are weights for $fid_{+}$ and $fid_{-}$ that allow putting more emphasis on either sufficiency or necessity. To make a fair comparison between the counterfactual explainers and the factual baselines, the weights are set to $w_{+} = w_{-} = 0.5$ . The characterization score char takes on values between 0 and 1, where larger values indicate better performance.
# E. Evaluation of Explanation Methods Applied to TGAT
When explaining the TGAT model (Xu et al., 2020) we find similar results to the findings on TGN. The results presented in Table 3 show the counterfactual explanation methods GreeDy and CoDy outperforming the factual baseline T-GNNExplainer regarding sparsity, $f i d_{+}$ and the char score. T-GNNExplainer fares better regarding the $f i d_{-}$ metric, achieving the highest score for correct predictions in the UCI-Messages (0.76) and the Wikipedia (0.87) dataset. In the other settings, the counterfactual explainers achieve better results.
The main difference in the performance of GreeDy and CoDy is that with the evaluated settings, GreeDy-spatio-temporal nearly outperforms all CoDy variants regarding $fid_{+}$ on the UCI-Messages dataset. Looking at the relationship between $fid_{+}$ and sparsity in Figure 5 shows the reason for the limited performance of CoDy in these settings: While GreeDy and CoDy variants find a similar amount of necessary explanations with low sparsity, GreeDy-spatio-temporal also finds more counterfactual examples with higher sparsity. The fact that CoDy does not elucidate explanations with larger sparsities to a similar degree suggests that the explainer is configured sub-optimally. We investigate this further in the sensitivity analysis performed in G and show that changing the balance between exploration and exploitation through parameter $\alpha$ , and increasing the candidate size $m_{max}$ can boost the performance of CoDy without increasing search iterations.
Table 3. Results on the fidelity+, sparsity, fidelity-, and char scores of the different explanation methods for explaining correct and incorrect predictions for the TGAT target model. The best result for each experimental setting is bold, and the second best is underlined.
<table><tr><td rowspan="2"></td><td colspan="6">Fidelity+</td><td colspan="6">Sparsity</td></tr><tr><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td></tr><tr><td>T-GNNExplainer</td><td>0.14</td><td>0.08</td><td>0.11</td><td>0.19</td><td>0.08</td><td>0.24</td><td>0.36</td><td>0.29</td><td>0.03</td><td>0.26</td><td>0.25</td><td>0.39</td></tr><tr><td>GreeDy-rand.</td><td>0.06</td><td>0.08</td><td>0.21</td><td>0.18</td><td>0.05</td><td>0.11</td><td>0.1</td><td>0.04</td><td>0.07</td><td>0.08</td><td>0.04</td><td>0.02</td></tr><tr><td>GreeDy-temp.</td><td>0.17</td><td>0.26</td><td>0.42</td><td>0.36</td><td>0.10</td><td>0.30</td><td>0.07</td><td>0.04</td><td>0.05</td><td>0.05</td><td>0.06</td><td>0.03</td></tr><tr><td>GreeDy-spa-temp.</td><td>0.38</td><td>0.34</td><td>0.47</td><td>0.35</td><td>0.14</td><td>0.39</td><td>0.11</td><td>0.05</td><td>0.06</td><td>0.05</td><td>0.07</td><td>0.04</td></tr><tr><td>GreeDy-event-impact</td><td>0.22</td><td>0.29</td><td>0.31</td><td>0.33</td><td>0.08</td><td>0.28</td><td>0.11</td><td>0.07</td><td>0.09</td><td>0.09</td><td>0.05</td><td>0.02</td></tr><tr><td>CoDy-rand.</td><td>0.17</td><td>0.26</td><td>0.38</td><td>0.34</td><td>0.15</td><td>0.35</td><td>0.03</td><td>0.04</td><td>0.22</td><td>0.06</td><td>0.08</td><td>0.05</td></tr><tr><td>CoDy-temp.</td><td>0.19</td><td>0.30</td><td>0.46</td><td>0.37</td><td>0.18</td><td>0.35</td><td>0.03</td><td>0.04</td><td>0.13</td><td>0.05</td><td>0.08</td><td>0.04</td></tr><tr><td>CoDy-spa-temp.</td><td>0.32</td><td>0.33</td><td>0.56</td><td>0.35</td><td>0.18</td><td>0.35</td><td>0.05</td><td>0.04</td><td>0.08</td><td>0.04</td><td>0.08</td><td>0.04</td></tr><tr><td>CoDy-event-impact</td><td>0.24</td><td>0.32</td><td>0.48</td><td>0.34</td><td>0.18</td><td>0.41</td><td>0.04</td><td>0.05</td><td>0.21</td><td>0.06</td><td>0.08</td><td>0.05</td></tr><tr><td rowspan="2"></td><td colspan="6">Fidelity-</td><td colspan="6">Char</td></tr><tr><td>UCI-MESSAGES corr.</td><td>inc.</td><td>UCI-Forums corr.</td><td>inc.</td><td>Wikipedia corr.</td><td>inc.</td><td>UCI-MESSAGES corr.</td><td>inc.</td><td>UCI-Forums corr.</td><td>inc.</td><td>Wikipedia corr.</td><td>inc.</td></tr><tr><td>T-GNNExplainer</td><td>0.76</td><td>0.91</td><td>0.46</td><td>0.50</td><td>0.87</td><td>0.84</td><td>0.24</td><td>0.14</td><td>0.17</td><td>0.03</td><td>0.14</td><td>0.38</td></tr><tr><td>GreeDy-rand.</td><td>0.39</td><td>1.00</td><td>0.49</td><td>0.97</td><td>0.57</td><td>0.93</td><td>0.10</td><td>0.15</td><td>0.29</td><td>0.30</td><td>0.09</td><td>0.19</td></tr><tr><td>GreeDy-temp.</td><td>0.57</td><td>1.00</td><td>0.67</td><td>0.99</td><td>0.77</td><td>0.90</td><td>0.26</td><td>0.41</td><td>0.51</td><td>0.53</td><td>0.17</td><td>0.45</td></tr><tr><td>GreeDy-spa-temp.</td><td>0.32</td><td>1.00</td><td>0.69</td><td>0.95</td><td>0.82</td><td>0.88</td><td>0.48</td><td>0.50</td><td>0.56</td><td>0.51</td><td>0.23</td><td>0.54</td></tr><tr><td>GreeDy-event-impact</td><td>0.66</td><td>1.00</td><td>0.69</td><td>0.98</td><td>0.72</td><td>0.90</td><td>0.32</td><td>0.44</td><td>0.43</td><td>0.49</td><td>0.14</td><td>0.43</td></tr><tr><td>CoDy-rand.</td><td>0.66</td><td>1.00</td><td>0.76</td><td>0.96</td><td>0.81</td><td>0.97</td><td>0.26</td><td>0.41</td><td>0.51</td><td>0.50</td><td>0.25</td><td>0.51</td></tr><tr><td>CoDy-temp.</td><td>0.65</td><td>1.00</td><td>0.76</td><td>0.98</td><td>0.83</td><td>0.97</td><td>0.29</td><td>0.46</td><td>0.57</td><td>0.54</td><td>0.29</td><td>0.51</td></tr><tr><td>CoDy-spa-temp.</td><td>0.61</td><td>1.00</td><td>0.77</td><td>0.95</td><td>0.83</td><td>0.96</td><td>0.42</td><td>0.50</td><td>0.65</td><td>0.51</td><td>0.29</td><td>0.51</td></tr><tr><td>CoDy-event-impact</td><td>0.66</td><td>1.00</td><td>0.77</td><td>0.97</td><td>0.83</td><td>0.97</td><td>0.35</td><td>0.48</td><td>0.59</td><td>0.50</td><td>0.30</td><td>0.58</td></tr></table>






 Figure 5. Results on the relationship between $fid_{+}$ and sparsity under different experimental settings for the TGAT model.
# F. Extended Evaluation of Explanation Methods Applied to TGN
We supplement our analysis of the evaluation of our explanation approaches with further results extracted from explaining predictions by the TGN model. Detailed results on the fidelity and sparsity scores are depicted in Table 4. The results on fidelity largely overlap with the results in AUFSC.
Figure 7 shows the relationship between $fid_{+}$ and sparsity for correct predictions. On the UCI-Forums dataset, we see the only setting where a GreeDy variant outperforms all CoDy variants. In F.3, we show that increasing the number of search iterations leads to CoDy outperforming GreeDy in this setting as well.
Table 4. Results on the fidelity+, sparsity, fidelity-, and char scores of the different explanation methods for explaining correct and incorrect predictions. The best result for each experimental setting is bold, and the second best is underlined.
<table><tr><td rowspan="2"></td><td colspan="6">Fidelity+</td><td colspan="6">Sparsity</td></tr><tr><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td></tr><tr><td>PGExplainer (Luo et al., 2020)</td><td>0.03</td><td>0.10</td><td>0.04</td><td>0.05</td><td>0.05</td><td>0.13</td><td>0.20</td><td>0.20</td><td>0.20</td><td>0.20</td><td>0.20</td><td>0.20</td></tr><tr><td>T-GNNExplainer (Xia et al., 2023)</td><td>0.10</td><td>0.25</td><td>0.05</td><td>0.28</td><td>0.05</td><td>0.22</td><td>0.43</td><td>0.35</td><td>0.29</td><td>0.35</td><td>0.33</td><td>0.43</td></tr><tr><td>GreeDy-random</td><td>0.02</td><td>0.08</td><td>0.05</td><td>0.07</td><td>0.05</td><td>0.11</td><td>0.03</td><td>0.02</td><td>0.02</td><td>0.02</td><td>0.04</td><td>0.02</td></tr><tr><td>GreeDy-temporal</td><td>0.14</td><td>0.33</td><td>0.43</td><td>0.31</td><td>0.10</td><td>0.30</td><td>0.05</td><td>0.04</td><td>0.05</td><td>0.03</td><td>0.06</td><td>0.03</td></tr><tr><td>GreeDy-spatio-temporal</td><td>0.20</td><td>0.38</td><td>0.46</td><td>0.30</td><td>0.14</td><td>0.39</td><td>0.08</td><td>0.04</td><td>0.05</td><td>0.04</td><td>0.07</td><td>0.04</td></tr><tr><td>GreeDy-event-impact</td><td>0.11</td><td>0.35</td><td>0.29</td><td>0.27</td><td>0.08</td><td>0.28</td><td>0.06</td><td>0.03</td><td>0.04</td><td>0.03</td><td>0.05</td><td>0.02</td></tr><tr><td>CoDy-random</td><td>0.11</td><td>0.36</td><td>0.32</td><td>0.31</td><td>0.14</td><td>0.43</td><td>0.08</td><td>0.05</td><td>0.09</td><td>0.06</td><td>0.07</td><td>0.07</td></tr><tr><td>CoDy-temporal</td><td>0.14</td><td>0.39</td><td>0.39</td><td>0.38</td><td>0.13</td><td>0.48</td><td>0.07</td><td>0.04</td><td>0.10</td><td>0.05</td><td>0.06</td><td>0.06</td></tr><tr><td>CoDy-spatio-temporal</td><td>0.20</td><td>0.41</td><td>0.44</td><td>0.36</td><td>0.18</td><td>0.53</td><td>0.06</td><td>0.04</td><td>0.08</td><td>0.04</td><td>0.07</td><td>0.05</td></tr><tr><td>CoDy-event-impact</td><td>0.17</td><td>0.42</td><td>0.40</td><td>0.41</td><td>0.16</td><td>0.54</td><td>0.07</td><td>0.05</td><td>0.09</td><td>0.06</td><td>0.07</td><td>0.06</td></tr><tr><td rowspan="2"></td><td colspan="6">Fidelity-</td><td colspan="6">Char</td></tr><tr><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td><td>UCI-MESSAGES corr.</td><td>wrg.</td><td>UCI-Forums corr.</td><td>wrg.</td><td>Wikipedia corr.</td><td>wrg.</td></tr><tr><td>PGExplainer (Luo et al., 2020)</td><td>0.49</td><td>0.76</td><td>0.44</td><td>0.84</td><td>0.87</td><td>0.68</td><td>0.05</td><td>0.17</td><td>0.07</td><td>0.08</td><td>0.09</td><td>0.22</td></tr><tr><td>T-GNNExplainer (Xia et al., 2023)</td><td>0.82</td><td>0.83</td><td>0.57</td><td>0.72</td><td>0.90</td><td>0.69</td><td>0.17</td><td>0.39</td><td>0.08</td><td>0.40</td><td>0.09</td><td>0.34</td></tr><tr><td>GreeDy-random</td><td>0.34</td><td>0.97</td><td>0.28</td><td>0.99</td><td>0.57</td><td>0.93</td><td>0.04</td><td>0.14</td><td>0.08</td><td>0.12</td><td>0.09</td><td>0.19</td></tr><tr><td>GreeDy-temporal</td><td>0.56</td><td>0.98</td><td>0.61</td><td>0.98</td><td>0.77</td><td>0.90</td><td>0.22</td><td>0.49</td><td>0.50</td><td>0.47</td><td>0.17</td><td>0.45</td></tr><tr><td>GreeDy-spatio-temporal</td><td>0.70</td><td>0.96</td><td>0.64</td><td>0.95</td><td>0.82</td><td>0.88</td><td>0.31</td><td>0.54</td><td>0.53</td><td>0.46</td><td>0.23</td><td>0.54</td></tr><tr><td>GreeDy-event-impact</td><td>0.67</td><td>0.98</td><td>0.64</td><td>0.99</td><td>0.72</td><td>0.90</td><td>0.18</td><td>0.51</td><td>0.39</td><td>0.42</td><td>0.14</td><td>0.43</td></tr><tr><td>CoDy-random</td><td>0.68</td><td>0.95</td><td>0.66</td><td>0.97</td><td>0.88</td><td>0.88</td><td>0.19</td><td>0.52</td><td>0.43</td><td>0.47</td><td>0.24</td><td>0.58</td></tr><tr><td>CoDy-temporal</td><td>0.69</td><td>0.96</td><td>0.66</td><td>0.98</td><td>0.88</td><td>0.88</td><td>0.23</td><td>0.55</td><td>0.49</td><td>0.54</td><td>0.22</td><td>0.62</td></tr><tr><td>CoDy-spatio-temporal</td><td>0.72</td><td>0.95</td><td>0.69</td><td>0.93</td><td>0.91</td><td>0.86</td><td>0.31</td><td>0.57</td><td>0.54</td><td>0.52</td><td>0.30</td><td>0.65</td></tr><tr><td>CoDy-event-impact</td><td>0.70</td><td>0.96</td><td>0.68</td><td>0.95</td><td>0.88</td><td>0.90</td><td>0.27</td><td>0.58</td><td>0.50</td><td>0.57</td><td>0.27</td><td>0.68</td></tr></table>




 Figure 6. Results on the relationship between $fid_{+}$ and sparsity under different experimental settings for the TGN model.


# F.1. Fidelity+ to Sparsity for correct predictions
 Figure 7. Results on the relationship between $fid_{+}$ and sparsity for correct predictions made by the TGN model.



# F.2. Runtime
 UCI-Forums
 Wikipedia
 Figure 8. Average duration for explaining predictions across various settings when targeting the TGN model.

We report the runtime achieved during the evaluation of the explainers. For replicability, we run the experiments on a high-performance computing cluster with an Intel Xeon Gold 6230 CPU, 16GB of RAM, and an NVIDIA Tesla V100 SXM2 GPU with 32GB of VRAM.
Figure 8 presents the average explanation times across datasets. GreeDy consistently requires the least time, with its event-impact variant taking longer due to more frequent calls to the TGNN, as detailed in Table 5. In comparison, CoDy calls this function more often than GreeDy, which concludes explanations upon finding a counterfactual example or reaching a search impasse. CoDy, in contrast, continues until a set number of iterations are completed or the search tree is fully explored.
The potential runtime increase of CoDy over GreeDy is largely a configurable design choice. In our experiments, CoDy continues searching for a better explanation, even after a valid counterfactual has already been found. Thus, the runtime of CoDy could be substantially reduced by only searching until finding the first counterfactual example instead of searching for the predefined number of maximum iterations. Further, a hybrid approach of CoDy and GreeDy could be employed to speed up the search. By first employing GreeDy and, if unsuccessful, running CoDy, starting with the existing partial search tree initialized with GreeDy, one could harness the performance of GreeDy, while benefiting from the better performance of CoDy.
CoDy, GreeDy, and T-GNNExplainer allocate $97.85\%$ , $99.83\%$ , and $82.72\%$ of their time, respectively, to calling the TGNN. This indicates that CoDy's scalability is largely dependent on the underlying TGNN model, which may encounter difficulties with larger or more complex datasets (as seen in the Wikipedia dataset in Figure 8). By efficiently navigating the search space through a balanced approach to exploration and exploitation, along with heuristic selection policies, CoDy optimizes the explanation process, which is especially important for complex and suboptimal TGNN implementations. Notably, T-GNNExplainer dedicates more time to the search process than the other methods.
Since calling the TGNN constitutes the predominant part of the runtime we analyze the time complexity of CoDy in terms of the number of calls to the TGNN. Following Algorithm 1, CoDy has a worst-case time complexity of $O(it_{max})$ in all variants except for the event-impact where the initial local gradient exploration of the $N$ candidate event adds to the complexity, resulting in a worst-case complexity of $O(it_{max} + N)$ .
Table 5 shows consistent call frequencies to the prediction model across datasets for each explainer. However, CoDy and GreeDy show significant variation in explanation times across datasets, especially on the Wikipedia dataset. This could be due to the dataset's longer model response times, possibly because of its edge features and larger size compared to the other datasets. Note that PGExplainer and T-GNNExplainer are excluded from this table because PGExplainer does not directly interact with TGNNs, and T-GNNExplainer relies on an approximation of the TGNN models.
Overall, GreeDy offers the shortest explanation durations, making it preferable for rapid explanations.
Table 5. Average number of calls to the TGNN performed by the explanation methods for the different experimental settings performed by GreeDy and CoDy.
<table><tr><td></td><td colspan="2">UCI-Messages</td><td colspan="2">UCI-Forums</td><td colspan="2">Wikipedia</td></tr><tr><td></td><td>Correct</td><td>Incorrect</td><td>Correct</td><td>Incorrect</td><td>Correct</td><td>Incorrect</td></tr><tr><td>GreeDy-random</td><td>27.10</td><td>23.40</td><td>24.80</td><td>21.80</td><td>23.15</td><td>18.55</td></tr><tr><td>GreeDy-temporal</td><td>43.70</td><td>29.85</td><td>36.15</td><td>29.15</td><td>32.30</td><td>24.65</td></tr><tr><td>GreeDy-spatio-temporal</td><td>57.60</td><td>29.40</td><td>37.65</td><td>35.25</td><td>39.35</td><td>22.35</td></tr><tr><td>GreeDy-event-impact</td><td>100.15</td><td>79.18</td><td>88.10</td><td>78.15</td><td>80.47</td><td>69.36</td></tr><tr><td>CoDy-random</td><td>287.91</td><td>246.83</td><td>261.13</td><td>257.23</td><td>284.52</td><td>237.16</td></tr><tr><td>CoDy-temporal</td><td>287.92</td><td>245.64</td><td>261.23</td><td>256.31</td><td>284.85</td><td>236.26</td></tr><tr><td>CoDy-spatio-temporal</td><td>287.95</td><td>245.44</td><td>260.95</td><td>256.44</td><td>284.98</td><td>236.26</td></tr><tr><td>CoDy-event-impact</td><td>346.50</td><td>292.23</td><td>312.00</td><td>305.70</td><td>339.90</td><td>272.52</td></tr></table>
# F.3. Search Iterations
In the experiments with CoDy, a key parameter is the maximum number of search iterations ( $it_{max}$ ), initially set at 300. Further investigation on performance involved increasing $it_{max}$ to 1200, specifically focusing on correct predictions in the Wikipedia dataset where GreeDy-spatio-temporal surpasses all CoDy variants. Figure 9 illustrates the $fid_{+}$ scores relative to the number of iterations, highlighting that CoDy variants eventually outperform GreeDy counterparts, albeit with varying iteration requirements. While random and event-impact policies require fewer iterations, CoDy-spatio-temporal and CoDy-temporal need close to 1000 and 1200 iterations, respectively, for superiority.
 Figure 9. Comparison of $fid_{+}$ scores for various explanation methods on the Wikipedia dataset and the TGN model, highlighting CoDy's performance over iterations.

The figure reveals that CoDy can potentially find the minimal counterfactual example with unlimited iterations, by exploring the entire search space. However, the high iteration count for certain CoDy variants to outperform GreeDy indicates a need for optimizing the parameter $\alpha$ , which balance exploration and exploitation. This is inferred from GreeDy's initial superiority, suggesting its more effective exploration of the search space. CoDy's delay in matching GreeDy's partial search tree performance implies an imbalance in its selection policy.
# F.4. Similarities in Explanations
The Jaccard similarity is used to compare explanations from various explainers, focusing on correct predictions in the Wikipedia dataset (Figure 10). This heatmap serves as a representative example. T-GNNExplainer's explanations differ significantly from those of GreeDy and CoDy, partly due to their lower sparsity (Table 1). GreeDy-temporal and GreeDyspatio-temporal show high similarity, as do GreeDy-spatio-temporal and CoDy explanations.
Comparatively, CoDy variants' explanations are more similar to each other. CoDy-temporal and CoDy-spatio-temporal have high similarities with each other and with CoDy-event-impact. This indicates CoDy's search procedure's ability to explore similar areas, highlighting the likeness of temporal, spatio-temporal, and event-impact policies over the random policy.
 Figure 10. Results on the Jaccard similarity between explanations of correct predictions on the Wikipedia dataset for explaining the TGN model.
# G. Sensitivity Analysis
For running the experiments, we did not tune the parameters of CoDy and instead relied on informed guesses for suitable parameters. To gauge the impact of tuning the exploration parameter $\alpha$ , as well as the influence of the size of the constraint search space $m_{max}$ in a sensitivity analysis. For this analysis, we ran experiments explaining correct predictions of the TGAT model on the UCI-Messages dataset with the spatio-temporal selection policy. The base experiment uses hyperparameters $\alpha = \frac{2}{3}$ and $m_{max} = 64$ . To shift the balance between exploration and exploitation we run an experimentation with a stronger emphasis on exploration with $\alpha = \frac{1}{2}$ , $m_{max} = 64$ , and an experiment with a stronger emphasis on exploitation with $\alpha = \frac{3}{4}$ , $m_{max} = 64$ . To explore different search-space sizes, we run an experiment with $m_{max} = 48$ , and one with $m_{max} = 96$ .
 Figure 11. $fid_{+}$ -sparsity plots for experiments in sensitivity analysis.


Looking at the influence of adjusting $\alpha$ , we see that incentivizing exploitation (larger $\alpha$ ) improves the performance of CoDy. This suggests that the experimental configuration is suboptimal and misses explanations that require more aggressive exploitation of the partial search tree.
Similarly, the candidate size $m_{max}$ has an influence on the performance of CoDy. Here, increasing the candidate size to 96 improves performance, whereas lowering it to 48 deteriorates the performance. These results hint that there exist explanations to be found beyond the limit of 64 candidates. Increasing the candidate size can thus improve performance, which is the case in the evaluated setting.
Overall, the results of the sensitivity analysis highlight that CoDy has the potential to achieve significantly higher scores by tuning the parameters to the specific data and model. However, as shown in our evaluation, CoDy achieves state-of-the-art performance for counterfactual explanations on dynamic graphs even without such tuning efforts.123version https://git-lfs.github.com/spec/v1oid sha256:80e286d19c520198456a0091a6ce4e1d8487e68bbd9473f6cd8985fce59a1bafsize 1339427123version https://git-lfs.github.com/spec/v1oid sha256:c6add89937693df8394c250367adf00fdf624006f59bcec51e98fc2547de455asize 776669123version https://git-lfs.github.com/spec/v1oid sha256:cbf11deb572edd0506d049ac071262fcd794704c03093bc708b36d69e2db5649size 124975123version https://git-lfs.github.com/spec/v1oid sha256:cb46ef99b2749b7d07f60b045601921be94b90ee5df69874a9d5445dd1f144c9size 163795123version https://git-lfs.github.com/spec/v1oid sha256:ed101aca24bbdaa5bdabf20388931aa222a36c8e7c4a647e9c98000508309311size 1107741123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531Shi Liu $^{*1}$ Weijie Su $^{*1} \boxtimes 1$ Xizhou Zhu $^{21}$ Wenhai Wang $^{31}$ Jifeng Dai $^{21}$
# Abstract
Recent advancements in Large Vision-Language Models built upon Large Language Models have established aligning visual features with LLM representations as the dominant paradigm. However, inherited LLM architectural designs introduce suboptimal characteristics for multimodal processing. First, LVLMs exhibit a bimodal distribution in attention allocation, leading to the progressive neglect of middle visual content as context expands. Second, conventional positional encoding schemes fail to preserve vital 2D structural relationships when processing dynamic high-resolution images. To address these limitations, we propose CoMemo - a dual-path architecture that combines a Context image path with an image Memory path for visual processing, effectively alleviating visual information neglect. Additionally, we introduce RoPE-DHR, a novel positional encoding mechanism that employs thumbnail-based positional aggregation to maintain 2D spatial awareness while mitigating remote decay in extended sequences. Evaluations across seven benchmarks, including long-context comprehension, multi-image reasoning, and visual question answering, demonstrate CoMemo's superior performance compared to conventional LVLM architectures. Project page is available at https://lalbj.github.io/projects/CoMemo/.
# 1. Introduction
Recent advances in large language models (LLMs) have demonstrated unprecedented generative capabilities (Ouyang et al., 2022; Touvron et al., 2023), primarily driven by the exponential scaling of training data and model
$^{\dagger}$ Equal contribution $^{\dagger}$ Project lead $^1$ Shanghai Artificial Intelligence Laboratory $^2$ Tsinghua University $^3$ The Chinese University of Hong Kong. Correspondence to: Weijie Su <suwei-jie@pjlab.org.cn>.
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
parameters. Building upon this foundation, large vision-language models (LVLMs) have emerged as powerful multimodal systems that align visual representations with LLM embedding spaces to enable cross-modal reasoning (Liu et al., 2024b; Alayrac et al., 2022). Current methodologies for visual information injection predominantly follow two architectural paradigms.
The first paradigm (referred to as LVLM-X, e.g., Flamingo (Alayrac et al., 2022)) employs cross-attention mechanisms to integrate visual features into textual representations. While this approach offers flexible modality interaction, recent studies (Laurençon et al., 2024) have revealed its suboptimal performance compared to alternative approaches when using identical LLM backbones and training data - a finding corroborated by our studies in Figure 1.
The second paradigm (referred to as LVLM-S, e.g., LLaVA (Liu et al., 2024b)) aligns visual tokens into text token embeddings space and then performs autoregressive processing. This paradigm is more compatible with LLM architectures; however, the preservation intrinsic mechanisms such as attention bimodality (Xiao et al., 2023; Liu et al., 2025a) and the linearly increasing position encoding leads to critical limitations: (1) the "lost in the middle" (Liu et al., 2024c; Song et al., 2024) phenomenon degrades performance with increasing context length, and (2) positional encoding sparsity induces remote decay and 2d-dimensional lost in high-resolution image processing.
In this paper, we propose a novel framework for LVLM, named CoMemo. Our key idea is to introduce an additional image-processing mechanism that is unaffected by context, without modifying the internal mechanisms of the LLM. Specifically, we concatenate image tokens with text tokens as the input sequence for fully autoregressive processing, while simultaneously feeding the image tokens into a mixin layer for cross-attention computation. Cross-attention retrieves image information based on text, avoiding the issue of image neglect that can occur in causal self-attention. However, simply combining these two structures, as in NVLM-H (Dai et al., 2024), does not work well. To address this, we first investigated a balanced scheme for visual representation inputs. Then, we introduced a three-stage training technique to prevent overreliance on the cross-attention path, effectively transforming it into a "memory
 Figure 1: Evaluation results of three architectures with same training data and model size (2B). Please refer to Tables 2 to 4 for details.
 (a) LVLM-S.
 (b) LVLM-X.
 (c) Ours. Figure 2: Comparison three types of architectures for LVLMs. Method (a) use image encoder to align visual features with the LLM's continuous token representation space. Method (b) employs mixin layer with cross-attention to update LLM's hidden states based on visual features. And Method (c) contrast a dual-path structure to enable the model to focus more on visual content during generation.
path." Meanwhile, the fully autoregressive process serves as the primary path for introducing image context, referred to as the "context path."
The positional encoding scheme in LVLMs typically adopts RoPE from LLMs, treating each image patch token as an individual token for encoding. However, this approach results in highly sparse positional encodings for dynamic high-resolution image patch tokens. Such sparse encoding can lead to remote decay issues in positional encoding, and the one-dimensional incremental encoding scheme also loses the two-dimensional information of the image. To address this, we propose a novel positional encoding scheme based on the dynamic high-resolution method. Specifically, in the dynamic high-resolution approach, the image is divided into multiple image tiles and a single image thumbnail. We treat the image thumbnail as part of the input sequence for standard sequential positional encoding, while mapping the image tiles to the image thumbnail index based on their two-dimensional positional relationships.
To fully evaluate the impact of the CoMemo architecture, we collected a set of multimodal benchmarks and categorized them into seven evaluation tasks: Caption, Long-generation, Multi-image, Long-context, Math, General VQA, and OCR-related tasks. The results demonstrate CoMemo's superiority over LVLM-X/S baselines under same data and model settings. Our framework achieves $17.2\%$ , $7.0\%$ and $5.6\%$ relative improvement on Caption, Long-Generation and Long-Context tasks respectively, with consistent gains across various benchmarks.
# 2. Design Thinking for CoMemo
# 2.1. Why LVLMs Tend to "lose in the middle"?
Previous studies have shown that both LLMs and LVLMs exhibit the "Lost in the middle" phenomenon (Liu et al.,
 Figure 3: Average gradients and attention weights assigned to tokens at corresponding positions. We computed the average over 1,000 samples.
2024c; Song et al., 2024), as illustrated in Figure 8a. This refers to their struggle to capture key information placed in the middle of the input. However, this phenomenon arises from the causal self-attention and in-context mechanisms inherent in these models. Both LLMs and LVLMs are trained using the next-token prediction paradigm, which heavily relies on contextual tokens during prediction.
As shown in Figure 3, we plot the gradients of each input token during training and the attention weights assigned to each token during inference for the InternVL2 model. To handle sequences of varying lengths, we map each sequence into 100 bins based on the position of each token. A significant portion of the gradient for the current predicted token is backpropagated to nearby tokens. As a result, models trained in this way tend to allocate most of their attention to adjacent tokens during inference, while the initial token, which has a larger gradient and attention, acts as an attention sink to release redundant attention (Xiao et al., 2023). This results in the effective capture of key information at the be
 Figure 4: Remote decay estimation for InternVL2-2B. The relative distance refers to the difference between absolute position IDs. In RoPE, the position ID of each input token increments by 1 with the input sequence.
ginning of the sequence, as well as nearby tokens benefiting from contextual attention.
However, key information placed in the middle of the sequence is more likely to be lost. As the context length increases, the middle segment, which is at a higher risk of being lost, also extends.
Finding 1: The attention distribution mechanism in causal self-attention is the cause of the "Lost in the middle" phenomenon. This mechanism also limits the performance of LVLMs in long-context scenarios.
# 2.2. Remote Decay in LVLMs with DHR
Dynamic high resolution significantly enhances the performance of visual tasks by introducing more visual context, especially in tasks that require high resolution, such as OCR-related evaluations. However, this benefit introduces a critical trade-off: excessive visual context exacerbates the remote decay issue in Rotary Position Embedding (RoPE), ultimately limiting model effectiveness in long-context scenarios.
RoPE implements relative position encoding through absolute encoding mechanisms, formally expressed as:
$$\left(\boldsymbol {\mathcal {R}} _ {m} \boldsymbol {q}\right) ^ {\top} \left(\boldsymbol {\mathcal {R}} _ {n} \boldsymbol {k}\right) = \operatorname {R e} \left[ \sum_ {i = 0} ^ {d / 2 - 1} \boldsymbol {q} _ {[ 2 i: 2 i + 1 ]} \boldsymbol {k} _ {[ 2 i: 2 i + 1 ]} ^ {*} e ^ {\mathrm {i} (m - n) \theta_ {i}} \right] \tag {1}$$
where $m, n$ denote token positions, $d$ the embedding dimension, and $\theta_{i}$ follows the sinusoidal position encoding scheme. This formulation inherently inherits the remote decay characteristics of sinusoidal encodings.
RoPE exhibits the remote decay property where the relative size between tokens decreases as the relative distance in
 Figure 5: Balancing experiments. Experiment settings are described in Section 2.3. "1k", "2k" and "4k" means pretrain steps. All scores are evaluated after fine-tuning the pretrained checkpoint corresponding to the x-axis.
creases (Su, 2021), as shown in Figure 4. While standard InternVL2 processes 256 image tokens per image, activating DHR with a dynamic number of 6 expands this to 1,792 tokens—a $7 \times$ increase that further reduces the influence of image tokens during generation.
Finding 2: The context expansion from DHR fundamentally aggravates image neglect.
# 2.3. The Balance Between tow Pathways
CoMemo faces a critical challenge in balancing two visual processing pathways: the cross-attention path and the fully autoregressive path. Through systematic experiments with different high-resolution allocation strategies and training strategies, we identify two key balancing principles. In the mixin layers, we incorporate a gating mechanism that utilizes gate values to reflect the influence of the cross-attention path during the decoding process. Therefore, we choose to evaluate the dependency of LVLM on these two paths from this perspective. Our analysis averages the gates values of mixin layers to quantify pathway preference, with performance evaluated across captioning, general VQA, and OCR tasks.
Balance in DHR Allocation. We compare three distinct DHR allocation strategies: (1) allocating DHR information exclusively to the fully autoregressive path, termed DHR-S, (2) assigning it solely to the cross-attention path, termed DHR-X, which corresponds to the allocation mechanism of NVLM-H (Dai et al., 2024), and (3) distributing it to both pathways, termed DHR-B. In unilateral allocation scenarios, the counterpart pathway receives only thumbnail resolution information. As shown in Figure 5, DHR allocation significantly influences pathway specialization. When DHR is exclusively allocated to one pathway, the model shows a pronounced bias toward that pathway. In contrast, dual-pathway allocation results in more stable and balanced
model behavior.
Balance in training steps. Our findings reveal that pretraining steps profoundly affects the equilibrium between the two mechanisms. Although fine-tuning involves extended training (9,000 steps), the visual processing paradigm is largely established during pretraining. In Figure 5, the DHR-B configuration demonstrates that insufficient pretraining steps result in suboptimal alignment, leading to compromised fine-tuning performance. Conversely, excessive pretraining induces over-reliance on specific pathways. While fine-tuning stage attempts to mitigate this imbalance, it ultimately fails to fully rectify the entrenched dependency in "DHR-B-4k" in Figure 5.
This phenomenon arises because during pretraining, only the memory branch and projector parameters are trainable. The projector's limited function of mapping image representations into the text space provides minimal gains in visual comprehension. Consequently, prolonged pretraining naturally reinforces reliance on the cross-attention branch.
Finding 3: CoMemo exhibits a fundamental balancing challenge between dual visual processing pathways.
Finding 4: CoMemo's dual-path visual processing paradigm establishes during pretraining.
# 3. Method
# 3.1.RoPE-DHR
Standard RoPE implementations in LLMs employ a continuous incremental positional encoding scheme, which is inherited by LVLMs. While effective for sequential text data, this approach faces significant limitations when processing high-resolution visual inputs: (1) remote decay due to extended context lengths, and (2) dimensional collapse of 2D spatial relationships. To address these limitations, we propose RoPE-DHR, a novel position encoding method that employs a hierarchical strategy.
We first processes the thumbnail patch tokens using conventional RoPE to generate base position IDs. For high-resolution tiles, we establish geometric correspondence by mapping each tile patch's coordinates $(x_{tile}, y_{tile})$ to its corresponding thumbnail patch index $i_{thumb}$ . This mapping is defined as:
$$i _ {t h u m b} = \left(\lfloor x _ {t i l e} \times \frac {W _ {t i l e}}{W _ {o r i g}} \rfloor + w b _ {t i l e}, \lfloor y _ {t i l e} \times \frac {H _ {o r i g}}{H _ {t h u m b}} \rfloor + h b _ {t i l e}\right) \tag {2}$$
where $(W_{orig},H_{orig})$ and $(W_{tile},H_{tile})$ denote the original and tile dimensions respectively. The terms $wb_{tile}$ and $hb_{tile}$
represents the start position biases for the tile in the width and height dimensions. This mapping preserves 2D spatial relationships while maintaining compatibility with existing RoPE implementations. In Figure 6, we visualize the raw image, the thunnail and their corresponding patch token position IDs using a color bar.
Crucially, our method decouples positional encoding from absolute sequence positions through: (1) length reduction: prevent the sparse position encoding for DHR by compression the position length in global perspective. (2) geometry reserve: tile patches inherit positional context from their thumbnail anchors.
# 3.2. Architecture of CoMemo
While LLaVA-like architectures demonstrate effective visual-language alignment, they exhibit a tendency to disregard visual information when processing lengthy contextual inputs or generating extended responses. To address this limitation, we propose the CoMemo architecture, which is based on three key structures:
Dual-stream Structure. CoMemo maintains tow visual processing streams: (1) context path serves as the primary processing stream where image representations are treated as special tokens, concatenated with text tokens to form the input sequence for autoregressive modeling. (2) memory path establishes an auxiliary processing stream where image representations interact with the input sequence through cross-attention mechanisms. The two paths maintain identical image representations, ensuring feature consistency while enabling complementary processing and the balance between in tow path as we discussed in Section 2.3.
Position-aware Cross-attention. Existing LVLM-X typically employ absolute positional encoding for image patch tokens during encoding (Dubey et al., 2024), with some variants introducing additional positional semantics through specialized tokens (Dai et al., 2024). However, these approaches provide only unidirectional positional awareness. To address this limitation, we implement RoPE in cross-modal attention, establishing bidirectional positional awareness: query positions $(pos_{s})$ correspond to input sequence token ordering and key positions $(pos_{i})$ align with visual token indices in the input sequence. The attention mask employs bidirectional visibility constraints, similar to mPlugowl3 (Ye et al., 2024), where image tokens are visible to their corresponding sequence positions while maintaining bidirectional attention.
Memory Mixin Strategy As shown in Figure 7, CoMemomixin layers are interleaved with standard transformer blocks at a 1:4 ratio. Each memory layer performs: (1) Gated Cross-attention: Modulates visual influence through learnable attention gates (attn_gate). (2) Adaptive Feed
 (1,1)
 (2,1)
 thumnail
(1,2)
 (1,2)

 (1,1)
 (2,1)


 thumnail
 Figure 6: The computation process of Rope-DHR. The colors are assigned based on a mapping of position IDs in RoPE. Figure 7: Framework of CoMemo. Both paths share the same encoder and projector. The pixel shuffle technique is adopted from InternVL series (Team, 2024; Chen et al., 2024c).
# Algorithm 1 Mixin Layers
Require: $h_s$ (sequence hidden states),
$h_j$ (image hidden states),
attn_gate,ffw_gate,
pos $_s$ (sequence position IDs), posi (image position IDs)
Ensure: Updated $h_s$
1: $h_s \gets h_s + \tanh(\text{attn\_gate}) \odot$
cross_attn $(q = h_s, kv =$
$h_i, pos_s = pos_s, pos_i = pos_i$
2: $h_s\gets$
$h_s + \tanh(\mathrm{ffw\_gate}) \odot \mathrm{ffw}(h_s)$
3: Return: $h_s$
forward: Enhances feature transformation via gated nonlinearity (ffw_GATE).
During autoregressive decoding, CoMemo requires only a single-step computation between the current decoding token and the cached visual memory states, eliminating the need for key-value caches. This approach circumvents the issue of increasing key-value cache size as the sequence lengthens. The orthogonal design of the architecture ensures compatibility with existing LLaVA variants.
# 3.3. Training Stages
Traditional LVLMs training consists of two phases: pretraining and fine-tuning. During the pretraining phase, we selectively update the projector module and memory architecture parameters while keeping other components frozen. This phase prioritizes cross-modal representation alignment and dynamic equilibrium between dual visual processing pathways.
A critical challenge emerges during pretraining stemming from asymmetric parameter updates: (1) Insufficient training iterations lead to suboptimal projector learning; (2) Prolonged training induces excessive dependency on the memory pathway for LVLM decoding. This imbalance originates from the disparate update strategies - full fine-tuning of memory parameters versus partial tuning of the context projector. Consequently, the LVLM exhibits inherent bias towards memory-based information retrieval to achieve loss minimization.
To mitigate this optimization bias, we propose a three-stage training strategy. In the first stage, we tune the parameters
of projector and mixin layers. In the next stage, we freeze the gate parameters. This design aims to enable the model to learn representation alignment and balance the dual-path structure in the first stage. After a certain number of training steps to prevent over-reliance on the cross-attention path, we freeze the corresponding gate control parameters and continue training until the alignment structure is sufficiently learned.
The subsequent fine-tuning stage adopts full-parameter training paradigm. During this stage, all model parameters become trainable with the training objective shifted towards instruction-following.
# 4. Experiments
# 4.1. Setup
To ensure a fair comparison of the capabilities across various architectures, all three of our models utilize the same pretraining and fine-tuning datasets. Each architecture adopts InternLM-1.8B as the LLM backbone and InternViT-300M as the image encoder. The hidden dimensions of each architecture's network, along with hyperparameters such as learning rate and weight decay during training, are also kept consistent. We use the same training data as InternVL-2. Therefore, LVLM-S in our experiments essentially represents InternVL-2. Training for all architectures is divided into two phases: pretraining and fine-tuning. For specific settings, please refer to the appendix.
Table 1: Comparison with other LVLMs of different architectures. * indicates results obtained from our own experiments. Other results are sourced from official reports or third-party evaluation leaderboards.
<table><tr><td rowspan="2">Model</td><td rowspan="2">Params.</td><td colspan="3">Caption</td><td colspan="2">Long-Generation</td><td colspan="3">Multi-Image</td><td colspan="2">Long-Context</td><td colspan="2">Math</td><td colspan="2">General VQA</td><td colspan="3">OCR-Related</td><td></td></tr><tr><td>COCO</td><td>Flickr</td><td>No-Caps</td><td>LLaVA Ben.</td><td>MMDU</td><td>BLINK</td><td>Mantis</td><td>MMT</td><td>MM-NIAH</td><td>Mile-Bench</td><td>MathVista</td><td>MathVision</td><td>MMBench</td><td>MME</td><td>MMVP</td><td>AI2D</td><td>CharQA</td><td>TextVQA</td></tr><tr><td>Closed-Source</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>GPT-4o</td><td>-</td><td>-</td><td>-</td><td>-</td><td>70.2</td><td>68.0</td><td>-</td><td>65.4</td><td>-</td><td>60.3</td><td>63.8</td><td>-</td><td>-</td><td>-</td><td>-</td><td>84.6</td><td>85.7</td><td>77.4</td><td></td></tr><tr><td>GPT-4V</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>54.6</td><td>62.7</td><td>64.3</td><td>-</td><td>53.0</td><td>58.1</td><td>-</td><td>-</td><td>1926.6</td><td>38.7</td><td>78.2</td><td>78.5</td><td>78.0</td><td></td></tr><tr><td>LVLM-X</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>mPlug-owl3</td><td>8B</td><td>90*</td><td>72*</td><td>94.2*</td><td>64.2*</td><td>-</td><td>50.3</td><td>63.1</td><td>-</td><td>50.0*</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>73.4</td><td>-</td><td>-</td><td></td></tr><tr><td>LLama3.2-V</td><td>11B</td><td>-</td><td>-</td><td>-</td><td>80.9</td><td>-</td><td>39.8</td><td>-</td><td>53.1</td><td>-</td><td>51.5</td><td>-</td><td>77.3</td><td>1820.5</td><td>-</td><td>91.1</td><td>83.4</td><td>73.1</td><td></td></tr><tr><td>LVLM-S</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>MiniCPM-V-2</td><td>2.8B</td><td>-</td><td>-</td><td>-</td><td>66.1</td><td>-</td><td>41.2</td><td>-</td><td>54.5</td><td>-</td><td>39*</td><td>15.4</td><td>62.9</td><td>1808.2</td><td>-</td><td>64.8</td><td>59.6</td><td>-</td><td></td></tr><tr><td>InternVL-2</td><td>2B</td><td>79.1*</td><td>65.4*</td><td>60.0*</td><td>62.9*</td><td>28.7*</td><td>38.2*</td><td>48.3*</td><td>50.2*</td><td>27.0*</td><td>52.1*</td><td>48.0*</td><td>16.4*</td><td>73.1*</td><td>1869*</td><td>31.3*</td><td>74.3*</td><td>75.6*</td><td>74.2*</td></tr><tr><td>InternVL-2.5</td><td>2B</td><td>114*</td><td>80.2*</td><td>108.6*</td><td>-</td><td>33.6*</td><td>44.0</td><td>54.8</td><td>54.5</td><td>22.2*</td><td>50.1*</td><td>51.3</td><td>13.5</td><td>74.7</td><td>2138.2</td><td>40</td><td>74.9</td><td>79.2</td><td>74.3</td></tr><tr><td>Qwen2-VL</td><td>2B</td><td>108.2</td><td>86.3</td><td>-</td><td>52.5</td><td>-</td><td>44.4</td><td>-</td><td>55.1</td><td>-</td><td>-</td><td>43.0</td><td>19.7</td><td>-</td><td>2326.8</td><td>-</td><td>74.7</td><td>73.5</td><td>79.7</td></tr><tr><td>CoMemo</td><td>2B</td><td>98.6</td><td>78.5</td><td>78.8</td><td>66.9</td><td>38.7</td><td>43.5</td><td>50.6</td><td>51.3</td><td>34.2</td><td>54.6</td><td>50</td><td>17.0</td><td>74.2</td><td>1904</td><td>36.0</td><td>74.2</td><td>73.6</td><td>72.6</td></tr></table>
Table 2: The results on Generation and Math benchmarks. The test settings are described in Section 4.3. The highest scores are highlighted in bold.
<table><tr><td rowspan="2">Model</td><td colspan="3">Caption</td><td colspan="2">Long Generation</td><td colspan="2">Math</td></tr><tr><td>COCO</td><td>Flickr</td><td>No-Caps</td><td>LLaVABench</td><td>MMDU</td><td>MathVista</td><td>MathVision</td></tr><tr><td>LVLM-X</td><td>84.9</td><td>68.9</td><td>62.9</td><td>50.8</td><td>31.5</td><td>44.2</td><td>15.8</td></tr><tr><td>LVLM-S</td><td>79.1</td><td>65.4</td><td>60.0</td><td>62.9</td><td>28.7</td><td>48.0</td><td>16.4</td></tr><tr><td>Ours</td><td>98.6</td><td>78.5</td><td>78.8</td><td>66.9</td><td>38.7</td><td>50.0</td><td>17.0</td></tr></table>
# 4.2. Comparison with Other LVLMs
As shown in Table 1, we benchmark CoMemo against leading open-source and proprietary LVLMs. It is important to note that our primary objective is architectural ablation rather than absolute performance maximization. The comparison with other models serves to demonstrate that our model was trained on a large-scale dataset and achieves top-tier performance, rather than being tested on toy datasets.
# 4.3. Generation and Math Benchmark
Contemporary multimodal benchmarks primarily rely on constrained response formats (e.g., multiple-choice questions and Yes/No queries) to facilitate evaluation. However, such approaches inadequately assess open-ended reasoning capabilities, as free-form responses introduce higher diversity and complexity. To comprehensively evaluate model capabilities across different granularities, we collected several benchmarks for open-ended evaluation:
- Caption Generation: Evaluates the model's ability to generate concise image descriptions (10-15 words) using CIDEr scores on COCO (Lin et al., 2014a), Flickr30k (Plummer et al., 2015), and NoCaps (Agrawal et al., 2019) datasets. - Long Generation: Evaluates extended inference using LLaVABench (Liu et al., 2024b) and MMDU (Liu et al., 2024e). LLaVABench focuses on single-image context reasoning, involving a few hundred context tokens, while MMDU is a multi-image analysis with
Table 3: The results on Multi-image and Long-context benchmarks. The test settings are described in Section 4.4. The highest scores are highlighted in bold.
<table><tr><td rowspan="2">Model</td><td colspan="3">Multi-Image</td><td colspan="3">Long-Context</td></tr><tr><td>BLINK</td><td>Mantis</td><td>MMT</td><td>MM-NIAH-M</td><td>MM-NIAH-T</td><td>MileBench</td></tr><tr><td>LVLM-X</td><td>41.5</td><td>46.5</td><td>47.8</td><td>39.51</td><td>29.51</td><td>53.21</td></tr><tr><td>LVLM-S</td><td>38.2</td><td>48.3</td><td>50.2</td><td>26.7</td><td>27.3</td><td>52.1</td></tr><tr><td>Ours</td><td>43.5</td><td>50.6</td><td>51.3</td><td>33.7</td><td>34.6</td><td>54.6</td></tr></table>
lengthy textual context (avg. 6.4k tokens) and multiple images (ranging from 2 to 20 images).
- Math: Measures model reasoning ability on math diagrams and visual math problems using MathVision (Wang et al., 2024a) and MathVista (Lu et al., 2023). During evaluation, we asked the model to provide step-by-step reasoning and extracted the final answer to calculate accuracy.
As shown in 2, our analysis reveals three key findings. First, LVLM-X's continuous attention mechanism demonstrates superiority in pure visual captioning tasks, achieving a $+4\%$ average improvement. Second, LVLM-S's causal attention architecture achieves better performance in knowledge-intensive scenarios, demonstrating enhanced contextual reasoning capabilities from its LLM backbone. Our proposed CoMemo combines the advantages of both approaches, outperforming the original architectures across various tasks. This supports our hypothesis that dual-path attention allocation effectively integrates the benefits of both architectures: maintaining visual grounding while enabling complex reasoning.
# 4.4. Multi-image and Long-context Benchmark
To systematically evaluate multimodal long-context understanding, we establish two complementary evaluation dimensions:
- Multi-image: When DHR is enabled, each image contributes approximately 2k tokens to the context length, thereby necessitating extended context capacity for multi-image analysis. We evaluate performance on the BLINK (Fu et al., 2025), Mantis (Jiang et al., 2024), and MMT (Ying et al., 2024) datasets. - Long-context: Tests information extraction in long context scenarios. We select MM-NIAH (Wang et al., 2024c) evaluation that detects image/text needles within hybrid long contexts. And MileBench (Song et al., 2024) progressively challenging tasks with 2-109 images. These benchmarks systematically quantify long-context capabilities from both textual token and visual token perspectives.
As shown in Table 3, our proposed architecture achieves the best performance in scenarios involving multiple images and long contexts. Specifically, MM-Niah-T represents the needle that is the key information placed in the text, while MM-NIAH-M represents the needle placed in the image. In the evaluation of MM-NIAH-T, the memory structure stores image data that is unrelated to the needle, redundant information. Nevertheless, our model still achieves the best performance. This not only demonstrates that compressing the image token position space through RoPE-DHR enhances the model's ability to understand long sequence texts but also indicates that the Memory structure does not cause the model to overfocus on image information, thereby preserving its ability to retrieve and reason with language effectively.
In the MileBench evaluation, due to the potential for excessive image tokens leading to long context sequences and out-of-memory issues, we did not enable DHR settings. Therefore, in this evaluation, each image in the input sequence has only a single image thumbnail. In this scenario, our architecture's positional encoding is the same as LVLM-S, primarily reflecting the role of the memory structure. Despite this, our architecture still achieved a $2.5\%$ improvement over LVLM-S.
The MileBench benchmark also includes needle in haystack tasks for both text and image scenarios. In Figure 8, we visualize the average results for these two types of NIAH tasks in MileBench. As mentioned earlier, we observed that the attention mechanism of LLMs and LVLMs exhibits a bimodal distribution, where LVLMs tend to focus more on the beginning and the most recent tokens, leading to the "Lost in the middle" phenomenon. This means that when the needle is placed in the middle of the sequence, the model's performance on NIAH tasks deteriorates. Our architecture, however, addresses this issue by continuously focusing on the "middle image information" during the token generation process, effectively mitigating this problem.
 (a) LVLM-S. Figure 8: Heatmap of results for the NIAH evaluation on MileBench benchmark. The depth percentage indicates the position of the target information (needle) relative to the entire sequence.
 (b) CoMemo
Table 4: The results on General VQA and OCR-related benchmarks. The test settings are described in Section 4.5. The highest scores are highlighted in bold.
<table><tr><td rowspan="2">Model</td><td colspan="3">General VQA</td><td colspan="3">OCR-Related</td></tr><tr><td>MMBench</td><td>MME</td><td>MMVP</td><td>AI2D</td><td>ChartQA</td><td>TextVQA</td></tr><tr><td>LVLM-X</td><td>69.6</td><td>1812</td><td>27.3</td><td>69.9</td><td>69.4</td><td>68.8</td></tr><tr><td>LVLM-S</td><td>73.1</td><td>1869</td><td>31.3</td><td>74.3</td><td>75.6</td><td>74.2</td></tr><tr><td>Ours</td><td>74.2</td><td>1904</td><td>36.0</td><td>74.2</td><td>73.6</td><td>72.6</td></tr></table>
# 4.5. General VQA and OCR Benchmark
To comprehensively evaluate CoMemo's multimodal understanding capabilities, we conduct extensive experiments on conventional vision-language benchmarks covering two main categories:
- General VQA: Assessing visual perception and reasoning abilities through single-image question answering, including MMBench (Liu et al., 2025b), MME (Fu et al., 2023), and MMVP (Zhong et al., 2023). - OCR-Related: Requiring fine-grained information extraction from diagrams and charts, evaluated on AI2D (Hiippala et al., 2021), TextVQA (Singh et al., 2019b), and ChartQA (Masry et al., 2022b).
The input sequences in these two types of benchmarks are relatively short, and responses typically consisting of single words or short phrases. In contrast, CoMemo incorporates a memory structure that alleviates image neglect by introducing an additional image focus mechanism. Additionally, RoPE-DHR addresses image neglect by compressing image information to reduce the long-range decay caused by positional encoding. While these techniques are not specifically tailored for the benchmarks mentioned above, our architecture still performs competitively when compared to
# LVLM-S.
As shown in Table 4, our architecture performs slightly better than LVLM-S on some general multimodal benchmarks. However, in tasks such as text and OCR, which require high-resolution image information, traditional approaches typically rely on more granular image representations. This approach contrasts with the philosophy underlying our approach, which focuses on improving the model's long-context and long-generation capabilities.
# 4.6. Training and Inference Efficiency Comparison
Table 5: Training efficiency comparison across different 2B parameter models.
<table><tr><td>Model</td><td>Batch size</td><td># of A100 GPUs</td><td>Train steps/s</td><td>Train samples/s</td></tr><tr><td>LVLM-X</td><td>1024</td><td>64</td><td>0.123</td><td>15.71</td></tr><tr><td>LVLM-S</td><td>1024</td><td>64</td><td>0.105</td><td>13.4</td></tr><tr><td>CoMemo</td><td>1024</td><td>64</td><td>0.096</td><td>12.26</td></tr></table>
Table 6: Inference speed comparison across different 2B parameter models (lower is better).
<table><tr><td>Model</td><td>Batch size</td><td># of A100 GPUs</td><td>Caption COCO (sec)</td><td>MMBench (sec)</td><td>MMNIAH (min)</td><td>TextVQA (sec)</td></tr><tr><td>LVLM-X</td><td>1</td><td>8</td><td>260</td><td>76</td><td>22</td><td>88</td></tr><tr><td>LVLM-S</td><td>1</td><td>8</td><td>270</td><td>90</td><td>25</td><td>100</td></tr><tr><td>CoMemo</td><td>1</td><td>8</td><td>280</td><td>110</td><td>30</td><td>120</td></tr></table>
To comprehensively compare the training and inference efficiency of three architectures, we measured their sample throughput during training and inference times across multiple benchmarks. As shown in Table 5 and Table 6, we report the training and inference efficiency for each architecture. The results demonstrate that CoMemo achieves latency comparable to LVLM-S. Although LVLM-X exhibits higher efficiency due to the use of fewer image tokens, its performance is significantly inferior to both CoMemo and LVLM-S.
# 4.7. Ablation Study
Ablation on Components of CoMemo. We conducted a complete ablation study on components using a 2B-scale model, as shown in Variants 1 to 5 in Table 7. When only RoPE-DHR is introduced, the compressed position encoding significantly improves performance on both long-generation and long-context tasks (Variant 2). When only the memory path was introduced, it addressed issues related to neglecting image information, leading to some improvement in the model's performance (Variant 3). However, since the image tokens in the memory path lack positional information, during cross-attention computation, there is no positional correspondence between image tokens and text tokens. Moreover, the lack of distinguishing features between image tiles, thunnails, and multiple images hindered the model's capabilities in different dimensions. Therefore,
after incorporating RoPE-DHR, the model's capabilities in different dimensions were further enhanced (Variant 5). However, since RoPE-DHR is essentially a compression-oriented encoding, it may affect scenarios like OCR that require fine-grained information.
Ablation on compression ratio of RoPE-DHR. In the main experiments, RoPE-DHR uses shared position IDs for image tokens in the thumbnail and their corresponding subimage tokens. This approach effectively compresses the position encoding. Therefore, we propose a variant, RoPE-DHR without compression, where the position encodings for subimage tokens corresponding to a two-dimensional position increment by 1 relative to the thumbnail image tokens, while the position IDs between thumbnail image tokens increment based on the number of tokens at their corresponding positions, rather than by 1. The experimental results are shown in Table 7 in Variants 4. It can be observed that, without compression, the model outperforms the LVLM-S architecture across all dimensions.
Ablation on different scale models. To verify that CoMemo adheres to the scaling law, we select InternLM-7B as the language model for experiments at the 7B scale. As shown in Table 7 in Variant 6 and 7, at the 8B scale, CoMemo's average performance across all dimensions remains superior to the LVLM-S architecture. The CoMemo architecture continues to deliver outstanding performance in both Cation and Long-context tasks. As language models scale up, the impact of compressed position encoding becomes more pronounced in OCR tasks.
Consistency on Different Datasets. We also conducted dataset-switching experiments using the open-source InternVL-1.2 1.2M fine-tuning dataset (OpenGVLab, 2024) during the SFT stage, while keeping the pretraining data consistent. As shown in Variants 8 to 9 in Table 7, even with the changes in the dataset, our CoMemo consistently outperforms the LVLM-S architecture across various dimensions.
# 5. Related Works
# 5.1. Mainstream LVLMs and Their Architectures
Contemporary LVLMs typically employ pre-trained language models as decoders, utilizing two dominant strategies for visual-text alignment: (1) cross-attention mechanisms and (2) joint projector-autoregressive architectures.
Fully Autoregressive LVLMs: LLaVA (Liu et al., 2024b) pioneered this approach by projecting image representations into the LLM's space and jointly decoding them with text tokens. Subsequent models like VILA-v1.5 (Lin et al., 2024) and LLaVA-Next (Liu et al., 2024a) built on this architecture, with LLaVA-Next introducing dynamic high-resolution techniques for improved performance. Other ad
Table 7: Ablation Study. The test settings are described in Section 4.7. "NC" means to use RoPE-DHR without compression.
<table><tr><td>Name</td><td>Params.</td><td>Memory</td><td>RoPE-DHR</td><td>Datasets</td><td>Overall</td><td>Caption</td><td>Long-Generation</td><td>Multi-Image</td><td>Long-Context</td><td>Math</td><td>General VQA</td><td>OCR-Related</td></tr><tr><td>Variant 1</td><td>2B</td><td>×</td><td>×</td><td>Ours</td><td>55.4</td><td>68.1</td><td>45.8</td><td>45.5</td><td>39.5</td><td>32.2</td><td>65.9</td><td>74.7</td></tr><tr><td>Variant 2</td><td>2B</td><td>×</td><td>✓</td><td>Ours</td><td>56.7</td><td>67.2</td><td>51.4</td><td>47.5</td><td>42.0</td><td>31.7</td><td>69.2</td><td>72.9</td></tr><tr><td>Variant 3</td><td>2B</td><td>✓</td><td>×</td><td>Ours</td><td>59.0</td><td>82.8</td><td>49.6</td><td>46.0</td><td>43.0</td><td>32.2</td><td>66.7</td><td>75.6</td></tr><tr><td>Variant 4</td><td>2B</td><td>✓</td><td>NC</td><td>Ours</td><td>59.5</td><td>79.7</td><td>51.9</td><td>48.5</td><td>43.1</td><td>34.7</td><td>67.3</td><td>74.8</td></tr><tr><td>Variant 5</td><td>2B</td><td>✓</td><td>✓</td><td>Ours</td><td>60.5</td><td>85.3</td><td>52.8</td><td>48.5</td><td>44.4</td><td>33.5</td><td>68.4</td><td>73.4</td></tr><tr><td>Variant 6</td><td>8B</td><td>×</td><td>×</td><td>Ours</td><td>65.4</td><td>77.7</td><td>61.0</td><td>57.4</td><td>45.3</td><td>38.7</td><td>78.3</td><td>82.3</td></tr><tr><td>Variant 7</td><td>8B</td><td>✓</td><td>✓</td><td>Ours</td><td>68.0</td><td>92.1</td><td>61.4</td><td>57.7</td><td>50.8</td><td>38.9</td><td>78.1</td><td>79.1</td></tr><tr><td>Variant 8</td><td>2B</td><td>×</td><td>×</td><td>1.2M</td><td>51.1</td><td>79.7</td><td>36.1</td><td>44.1</td><td>28.7</td><td>28.8</td><td>58.5</td><td>61.8</td></tr><tr><td>Variant 9</td><td>2B</td><td>✓</td><td>✓</td><td>1.2M</td><td>54.6</td><td>89.5</td><td>38.4</td><td>46.2</td><td>31.5</td><td>28.7</td><td>62.3</td><td>63.5</td></tr></table>
vancements include Qwen2-VL (Wang et al., 2024b), which introduced M-RoPE, and InternVL-2.5 (Chen et al., 2024c), which used pixel shuffle to reduce token count after DHR. DeepSeek-VL2 (Wu et al., 2024) employed a pretrained MoE-based LLM. However, this alignment approach inherits the LLM's generation mechanism, which can lead to issues such as "image neglect" or the "lost in the middle" problem.
Cross-Attention-Based LVLMs: Flamingo (Alayrac et al., 2022) is an early example of LVLMs using cross-attention mechanisms. Later models, like Idefics (Laurençon et al., 2024) and LLaMa-3.2-Vision (Dubey et al., 2024), adopted its mixin layer design, which introduces cross-attention and gating mechanisms. EVLM (Chen et al., 2024b) experimented with using intermediate Vision Transformer representations as inputs to the mixin layer. mPlug-owl3 (Ye et al., 2024) added adaptive gating and hyper-layer fusion to combine cross-attention and self-attention. This approach enables visual understanding while maintaining the LLM's frozen language ability, as seen in LLaMa-3.2-Vision. However, in these models, image representations are aligned directly to the LLM's hidden state, whereas LLaVA-like methods align them with the text token space, better leveraging autoregressive decoding capabilities and improving performance.
# 5.2. Position Encoding Schemes in LVLMs
Most LVLMs use position encoding methods inherited from LLMs, primarily RoPE. In these models, each image patch token is treated like a text token and assigned position IDs for RoPE computation. However, several advancements address specific challenges. MiniCPM-V (Yao et al., 2024) introduced an absolute position encoding for each image tile in the context of DHR, while LLaMA-3.2-V (Yao et al., 2024) designed encodings for both image tiles and patch tokens. NVLM (Yao et al., 2024), also leveraging DHR, added special tokens before each tile to convey positional information. While effective for predefined DHR ratios, these methods lack scalability.
In contrast, Qwen-VL2 (Wang et al., 2024b) introduced M-RoPE, a multi-dimensional position encoding extending RoPE to three channels (temporal, height, width) for images and videos. However, this position encoding requires
a customized ViT and thus cannot be applied to LVLMs employing DHR.
Our proposed RoPE-DHR, based on 1D principles, offers a 2D-aware encoding scheme that addresses these challenges without the extra computational burden.
# 6. Conclusion
We present CoMemo, a novel architecture for Large Vision-Language Models specifically designed for long-form generation and extended context understanding. Our approach features a dual-path image processing mechanism and introduces RoPE-DHR to alleviate remote decay in DHR scenarios while restoring critical two-dimensional spatial information. These innovations significantly enhance model performance across multiple tasks including image captioning, long-form generation, long-context understanding, multi-image analysis, and general visual question answering. We hope this work will contribute to the advancement of the vision-language modeling community.
# Impact Statement
This paper presents work whose goal is to advance the field of Large Vision-Language Model. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
# Acknowledgments
The work is supported by the National Key R&D Program of China (NO. 2022ZD0161301), by the National Natural Science Foundation of China (U24A20325, 62321005, 62376134).
# References
Agrawal, H., Desai, K., Wang, Y., Chen, X., Jain, R., Johnson, M., Batra, D., Parikh, D., Lee, S., and Anderson, P. Nocaps: Novel object captioning at scale. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 8948-8957, 2019. Alayrac, J.-B., Donahue, J., Luc, P., Miech, A., Barr, I., Hasson, Y., Lenc, K., Mensch, A., Millican, K., Reynolds,
M., et al. Flamingo: a visual language model for few-shot learning. Advances in neural information processing systems, 35:23716-23736, 2022. Amini, A., Gabriel, S., Lin, P., Koncel-Kedziorski, R., Choi, Y., and Hajishirzi, H. Mathqa: Towards interpretable math word problem solving with operation-based formalisms. arXiv preprint arXiv:1905.13319, 2019. Ben Abacha, A., Hasan, S. A., Datla, V. V., Demner-Fushman, D., and Müller, H. Vqa-med: Overview of the medical visual question answering task at imageclef 2019. In Proceedings of CLEF (Conference and Labs of the Evaluation Forum) 2019 Working Notes. 9-12 September 2019, 2019. Biten, A. F., Tito, R., Mafla, A., Gomez, L., Rusinol, M., Valveny, E., Jawahar, C., and Karatzas, D. Scene text visual question answering. pp. 4291-4301, 2019. Byeon, M., Park, B., Kim, H., Lee, S., Baek, W., and Kim, S. Coyo-700m: Image-text pair dataset. https://github.com/kakaobrain/ coyo-dataset, 2022. Cao, J. and Xiao, J. An augmented benchmark dataset for geometric question answering through dual parallel text encoding. In COLING, pp. 1511-1520, 2022. Carter, J. Textocr-gpt4v. https://huggingface.co/datasets/jimmycarter/textocr-gpt4v, 2024. Chang, S., Palzer, D., Li, J., Fosler-Lussier, E., and Xiao, N. Mapqa: A dataset for question answering on choropleth maps. arXiv preprint arXiv:2211.08545, 2022. Chen, G. H., Chen, S., Zhang, R., Chen, J., Wu, X., Zhang, Z., Chen, Z., Li, J., Wan, X., and Wang, B. Allava: Harnessing gpt4v-synthesized data for a lite vision-language model. arXiv preprint arXiv:2402.11684, 2024a. Chen, J., Li, T., Qin, J., Lu, P., Lin, L., Chen, C., and Liang, X. Unigeo: Unifying geometry logical reasoning via reformulating mathematical expression. arXiv preprint arXiv:2212.02746, 2022. Chen, K., Zhang, Z., Zeng, W., Zhang, R., Zhu, F., and Zhao, R. Shikra: Unleashing multimodal llm's referential dialogue magic. arXiv preprint arXiv:2306.15195, 2023. Chen, K., Shen, D., Zhong, H., Zhong, H., Xia, K., Xu, D., Yuan, W., Hu, Y., Wen, B., Zhang, T., et al. Evlm: An efficient vision-language model for visual understanding. arXiv preprint arXiv:2407.14177, 2024b. Chen, Z., Wang, W., Cao, Y., Liu, Y., Gao, Z., Cui, E., Zhu, J., Ye, S., Tian, H., Liu, Z., et al. Expanding performance boundaries of open-source multimodal models
with model, data, and test-time scaling. arXiv preprint arXiv:2412.05271, 2024c. Chi, Z., Huang, H., Xu, H.-D., Yu, H., Yin, W., and Mao, X.-L. Complicated table structure recognition. arXiv preprint arXiv:1908.04729, 2019. Chng, C. K., Liu, Y., Sun, Y., Ng, C. C., Luo, C., Ni, Z., Fang, C., Zhang, S., Han, J., Ding, E., et al. Icdar2019 robust reading challenge on arbitrary-shaped text-rrc-art. In ICDAR, pp. 1571-1576. IEEE, 2019. Clark, C. and Gardner, M. Simple and effective multiparagraph reading comprehension. arXiv preprint arXiv:1710.10723, 2017. Dai, W., Lee, N., Wang, B., Yang, Z., Liu, Z., Barker, J., Rintamaki, T., Shoeybi, M., Catanzaro, B., and Ping, W. Nvlm: Open frontier-class multimodal llms. arXiv preprint arXiv:2409.11402, 2024. Davis, B., Morse, B., Cohen, S., Price, B., and Tensmeyer, C. Deep visual template-free form parsing. In ICDAR, pp. 134-141. IEEE, 2019. Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan, A., et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024. Fu, C., Chen, P., Shen, Y., Qin, Y., Zhang, M., Lin, X., Yang, J., Zheng, X., Li, K., Sun, X., et al. Mme: A comprehensive evaluation benchmark for multimodal large language models. arXiv preprint arXiv:2306.13394, 2023. Fu, X., Hu, Y., Li, B., Feng, Y., Wang, H., Lin, X., Roth, D., Smith, N. A., Ma, W.-C., and Krishna, R. Blink: Multimodal large language models can see but not perceive. In European Conference on Computer Vision, pp. 148-166. Springer, 2025. Goyal, Y., Khot, T., Summers-Stay, D., Batra, D., and Parikh, D. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. pp. 6904-6913, 2017. Gu, J., Meng, X., Lu, G., Hou, L., Minzhe, N., Liang, X., Yao, L., Huang, R., Zhang, W., Jiang, X., et al. Wukong: A 100 million large-scale chinese cross-modal pre-training benchmark. 35:26418-26431, 2022. Guo, H., Qin, X., Liu, J., Han, J., Liu, J., and Ding, E. Eaten: Entity-aware attention for single shot visual text extraction. In ICDAR, pp. 254-259. IEEE, 2019. He, M., Liu, Y., Yang, Z., Zhang, S., Luo, C., Gao, F., Zheng, Q., Wang, Y., Zhang, X., and Jin, L. Icpr2018 contest on robust reading for multi-type web images. pp. 7-12. IEEE, 2018.
He, X., Zhang, Y., Mou, L., Xing, E., and Xie, P. Pathvqa: 30000+ questions for medical visual question answering. arXiv preprint arXiv:2003.10286, 2020. Hiippala, T., Alikhani, M., Haverinen, J., Kalliokoski, T., Logacheva, E., Orekhova, S., Tuomainen, A., Stone, M., and Bateman, J. A. Ai2d-rst: A multimodal corpus of 1000 primary school science diagrams. Language Resources and Evaluation, 55:661-688, 2021. Hosu, V., Lin, H., Sziranyi, T., and Saupe, D. Koniq-10k: An ecologically valid database for deep learning of blind image quality assessment. 29:4041-4056, 2020. Hu, A., Xu, H., Ye, J., Yan, M., Zhang, L., Zhang, B., Li, C., Zhang, J., Jin, Q., Huang, F., et al. mplug-docowl 1.5: Unified structure learning forOCR-free document understanding. arXiv preprint arXiv:2403.12895, 2024. Hu, X., Gu, L., An, Q., Zhang, M., Liu, L., Kobayashi, K., Harada, T., Summers, R., and Zhu, Y. Medical-diff-vqa: a large-scale medical dataset for difference visual question answering on chest x-ray images, 2023. Huang, Q., Xiong, Y., Rao, A., Wang, J., and Lin, D. Movienet: A holistic dataset for movie understanding. pp. 709-727. Springer, 2020. Huang, Z., Chen, K., He, J., Bai, X., Karatzas, D., Lu, S., and Jawahar, C. Icdar2019 competition on scanned receiptOCR and information extraction. In ICDAR, pp. 1516-1520. IEEE, 2019. Hudson, D. A. and Manning, C. D. Gqa: A new dataset for real-world visual reasoning and compositional question answering. pp. 6700-6709, 2019. Jiang, D., He, X., Zeng, H., Wei, C., Ku, M., Liu, Q., and Chen, W. Mantis: Interleaved multi-image instruction tuning. arXiv preprint arXiv:2405.01483, 2024. Johnson, J., Hariharan, B., Van Der Maaten, L., Fei-Fei, L., Lawrence Zitnick, C., and Girshick, R. Clevr: A diagnostic dataset for compositional language and elementary visual reasoning. pp. 2901-2910, 2017. Kafle, K., Price, B., Cohen, S., and Kanan, C. Dvqa: Understanding data visualizations via question answering. pp. 5648-5656, 2018. Kahou, S. E., Michalski, V., Atkinson, A., Kádár, Á., Trischler, A., and Bengio, Y. Figureqa: An annotated figure dataset for visual reasoning. arXiv preprint arXiv:1710.07300, 2017. Kantharaj, S., Leong, R. T. K., Lin, X., Masy, A., Thakkar, M., Hoque, E., and Joty, S. Chart-to-text: A large-scale benchmark for chart summarization. arXiv preprint arXiv:2203.06486, 2022.
Kazemzadeh, S., Ordonez, V., Matten, M., and Berg, T. Referitgame: Referring to objects in photographs of natural scenes. pp. 787-798, 2014. Kembhavi, A., Salvato, M., Kolve, E., Seo, M., Hajishirzi, H., and Farhadi, A. A diagram is worth a dozen images. pp. 235-251, 2016. Kembhavi, A., Seo, M., Schwenk, D., Choi, J., Farhadi, A., and Hajishirzi, H. Are you smarter than a sixth grader? textbook question answering for multimodal machine comprehension. pp. 4999-5007, 2017. Kuang, J., Hua, W., Liang, D., Yang, M., Jiang, D., Ren, B., and Bai, X. Visual information extraction in the wild: practical dataset and end-to-end solution. In ICDAR, pp. 36-53. Springer, 2023. LAION. Laion-gpt4v dataset. https://huggingface.co/datasets/laion/gpt4v-dataset, 2023. Lau, J. J., Gayen, S., Ben Abacha, A., and Demner-Fushman, D. A dataset of clinically generated visual questions and answers about radiology images. Scientific data, 5(1):1-10, 2018. Laurençon, H., Tronchon, L., Cord, M., and Sanh, V. What matters when building vision-language models? arXiv preprint arXiv:2405.02246, 2024. Lerner, P., Ferret, O., Guinaudeau, C., Le Borgne, H., Besançon, R., Moreno, J. G., and Lovón Melgarejo, J. Viquae, a dataset for knowledge-based visual question answering about named entities. In SIGIR, pp. 3108-3120, 2022. Li, J., Zhang, D., Wang, X., Hao, Z., Lei, J., Tan, Q., Zhou, C., Liu, W., Yang, Y., Xiong, X., et al. Chemvlm: Exploring the power of multimodal large language models in chemistry area. arXiv preprint arXiv:2408.07246, 2024. Li, Z., Wang, X., Stengel-Eskin, E., Kortylewski, A., Ma, W., Van Durme, B., and Yuille, A. L. Super-clevr: A virtual benchmark to diagnose domain robustness in visual reasoning. pp. 14963-14973, 2023. Lin, J., Yin, H., Ping, W., Molchanov, P., Shoeybi, M., and Han, S. Vila: On pre-training for visual language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 26689-26699, 2024. Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., and Zitnick, C. L. Microsoft coco: Common objects in context. In Computer Vision-ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part V 13, pp. 740-755. Springer, 2014a.
Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollár, P., and Zitnick, C. L. Microsoft coco: Common objects in context. pp. 740-755. Springer, 2014b. Liu, B., Zhan, L.-M., Xu, L., Ma, L., Yang, Y., and Wu, X.-M. Slake: A semantically-labeled knowledge-enhanced dataset for medical visual question answering. In ISBI, pp. 1650-1654. IEEE, 2021. Liu, C.-L., Yin, F., Wang, D.-H., and Wang, Q.-F. Casia online and offline chinese handwriting databases. In ICDAR, pp. 37-41. IEEE, 2011. Liu, F., Emerson, G., and Collier, N. Visual spatial reasoning. Transactions of the Association for Computational Linguistics, 11:635-651, 2023a. Liu, F., Lin, K., Li, L., Wang, J., Yacoob, Y., and Wang, L. Mitigating hallucination in large multi-modal models via robust instruction tuning. 2023b. Liu, F., Wang, X., Yao, W., Chen, J., Song, K., Cho, S., Yacoob, Y., and Yu, D. Mmc: Advancing multimodal chart understanding with large-scale instruction tuning. arXiv preprint arXiv:2311.10774, 2023c. Liu, H., Li, C., Li, Y., Li, B., Zhang, Y., Shen, S., and Lee, Y. J. Llava-last: Improved reasoning,OCR, and world knowledge, January 2024a. URL https://llava-v1.github.io/blog/2024-01-30-llava-last/. Liu, H., Li, C., Wu, Q., and Lee, Y. J. Visual instruction tuning. Advances in neural information processing systems, 36, 2024b. Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., and Liang, P. Lost in the middle: How language models use long contexts. Transactions of the Association for Computational Linguistics, 12:157-173, 2024c. Liu, S., Zheng, K., and Chen, W. Paying more attention to image: A training-free method for alleviating hallucination in lvlms. In European Conference on Computer Vision, pp. 125-140. Springer, 2025a. Liu, Y., Duan, H., Zhang, Y., Li, B., Zhang, S., Zhao, W., Yuan, Y., Wang, J., He, C., Liu, Z., et al. Mmbench: Is your multi-modal model an all-around player? In European conference on computer vision, pp. 216-233. Springer, 2025b. Liu, Z., Chu, T., Zang, Y., Wei, X., Dong, X., Zhang, P., Liang, Z., Xiong, Y., Qiao, Y., Lin, D., et al. Mmdu: A multi-turn multi-image dialog understanding benchmark and instruction-tuning dataset for lvlms. arXiv preprint arXiv:2406.11833, 2024d.
Liu, Z., Chu, T., Zang, Y., Wei, X., Dong, X., Zhang, P., Liang, Z., Xiong, Y., Qiao, Y., Lin, D., et al. Mmdu: A multi-turn multi-image dialog understanding benchmark and instruction-tuning dataset for lvlms. arXiv preprint arXiv:2406.11833, 2024e. Lu, P., Gong, R., Jiang, S., Qiu, L., Huang, S., Liang, X., and Zhu, S.-C. Inter-gps: Interpretable geometry problem solving with formal language and symbolic reasoning. arXiv preprint arXiv:2105.04165, 2021. Lu, P., Mishra, S., Xia, T., Qiu, L., Chang, K.-W., Zhu, S.-C., Tafjord, O., Clark, P., and Kalyan, A. Learn to explain: Multimodal reasoning via thought chains for science question answering. 35:2507-2521, 2022a. Lu, P., Qiu, L., Chang, K.-W., Wu, Y. N., Zhu, S.-C., Rajpurohit, T., Clark, P., and Kalyan, A. Dynamic prompt learning via policy gradient for semi-structured mathematical reasoning. arXiv preprint arXiv:2209.14610, 2022b. Lu, P., Bansal, H., Xia, T., Liu, J., Li, C., Hajishirzi, H., Cheng, H., Chang, K.-W., Galley, M., and Gao, J. Mathvista: Evaluating mathematical reasoning of foundation models in visual contexts. arXiv preprint arXiv:2310.02255, 2023. Mao, H., Cheung, M., and She, J. Deepart: Learning joint representations of visual arts. pp. 1183-1191, 2017. Marino, K., Rastegari, M., Farhadi, A., and Mottaghi, R. Okvqa: A visual question answering benchmark requiring external knowledge. pp. 3195-3204, 2019. Marti, U.-V. and Bunke, H. The iam-database: an english sentence database for offline handwriting recognition. International journal on document analysis and recognition, 5:39-46, 2002. Masry, A., Do, X. L., Tan, J. Q., Joty, S., and Hoque, E. Chartqa: A benchmark for question answering about charts with visual and logical reasoning. In ACL, pp. 2263-2279, 2022a. Masry, A., Long, D. X., Tan, J. Q., Joty, S., and Hoque, E. Chartqa: A benchmark for question answering about charts with visual and logical reasoning. arXiv preprint arXiv:2203.10244, 2022b. Masry, A., Kavehzadeh, P., Do, X. L., Hoque, E., and Joty, S. Unichart: A universal vision-language pretrained model for chart comprehension and reasoning. arXiv preprint arXiv:2305.14761, 2023. Mathew, M., Bagal, V., Tito, R., Karatzas, D., Valveny, E., and Jawahar, C. Infographicvqa. pp. 1697-1706, 2022.
Methani, N., Ganguly, P., Khapra, M. M., and Kumar, P. Plotqa: Reasoning over scientific plots. pp. 1527-1536, 2020. OpenGVLab. Opengvlab/internvl-chat-v1-2-sft-data, Jan 2024. URL https://huggingface.co/ OpenGVLab/InternVL-Chat-V1-2. Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730-27744, 2022. Peng, Z., Wang, W., Dong, L., Hao, Y., Huang, S., Ma, S., and Wei, F. Kosmos-2: Grounding multimodal large language models to the world. arXiv preprint arXiv:2306.14824, 2023. Plummer, B. A., Wang, L., Cervantes, C. M., Caicedo, J. C., Hockenmaier, J., and Lazebnik, S. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In Proceedings of the IEEE international conference on computer vision, pp. 2641-2649, 2015. Schuhmann, C., Beaumont, R., Vencu, R., Gordon, C., Wightman, R., Cherti, M., Coombes, T., Katta, A., Mullis, C., Wortsman, M., et al. Laion-5b: An open large-scale dataset for training next generation image-text models. 35:25278-25294, 2022a. Schuhmann, C., Köpf, A., Vencu, R., Coombes, T., and Beaumont, R. Laion coco: 600m synthetic captions from laion2b-en. https://laion.ai/blog/ laion-coco/, 2022b. Seo, M., Hajishirzi, H., Farhadi, A., Etzioni, O., and Malcolm, C. Solving geometry problems: Combining text and diagram interpretation. pp. 1466-1476, 2015. Shah, S., Mishra, A., Yadati, N., and Talukdar, P. P. Kvqa: Knowledge-aware visual question answering. volume 33, pp. 8876-8884, 2019. Shao, S., Li, Z., Zhang, T., Peng, C., Yu, G., Zhang, X., Li, J., and Sun, J. Objects365: A large-scale, high-quality dataset for object detection. pp. 8430-8439, 2019. Singh, A., Natarajan, V., Shah, M., Jiang, Y., Chen, X., Batra, D., Parikh, D., and Rohrbach, M. Towards vqa models that can read. pp. 8317-8326, 2019a. Singh, A., Natarajan, V., Shah, M., Jiang, Y., Chen, X., Batra, D., Parikh, D., and Rohrbach, M. Towards vqa models that can read. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8317-8326, 2019b.
Singh, A., Pang, G., Toh, M., Huang, J., Galuba, W., and Hassner, T. Textocr: Towards large-scale end-to-end reasoning for arbitrary-shaped scene text. pp. 8802-8812, 2021. Song, D., Chen, S., Chen, G. H., Yu, F., Wan, X., and Wang, B. Milebench: Benchmarking mllms in long context. arXiv preprint arXiv:2404.18532, 2024. Su, J. Transformer roadmap: 2. rotary position embedding, Mar 2021. URL https://spaces.ac.cn/archives/8265. Sun, Y., Ni, Z., Chng, C.-K., Liu, Y., Luo, C., Ng, C. C., Han, J., Ding, E., Liu, J., Karatzas, D., et al. Icdar 2019 competition on large-scale street view text with partial labeling-rrc-lsvt. In ICDAR, pp. 1557-1562. IEEE, 2019. Team, O. Internvl2: Better than the best—expanding performance boundaries of open-source multimodal models with the progressive scaling strategy, 2024. URL https://internvl.github.io/blog/2024-07-02-InternVL-2.0/. Touvron, H., Martin, L., Stone, K., Albert, P., Almahairi, A., Babaei, Y., Bashlykov, N., Batra, S., Bhargava, P., Bhosale, S., et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. Veit, A., Matera, T., Neumann, L., Matas, J., and Belongie, S. Coco-text: Dataset and benchmark for text detection and recognition in natural images. arXiv preprint arXiv:1601.07140, 2016. Wang, J., Zhang, P., Chu, T., Cao, Y., Zhou, Y., Wu, T., Wang, B., He, C., and Lin, D. V3det: Vast vocabulary visual detection dataset. pp. 19844-19854, 2023a. Wang, K., Pan, J., Shi, W., Lu, Z., Zhan, M., and Li, H. Measuring multimodal mathematical reasoning with math- vision dataset. arXiv preprint arXiv:2402.14804, 2024a. Wang, P., Bai, S., Tan, S., Wang, S., Fan, Z., Bai, J., Chen, K., Liu, X., Wang, J., Ge, W., Fan, Y., Dang, K., Du, M., Ren, X., Men, R., Liu, D., Zhou, C., Zhou, J., and Lin, J. Qwen2-vl: Enhancing vision-language model's perception of the world at any resolution. arXiv preprint arXiv:2409.12191, 2024b. Wang, W., Shi, M., Li, Q., Wang, W., Huang, Z., Xing, L., Chen, Z., Li, H., Zhu, X., Cao, Z., et al. The all-seeing project: Towards panoptic visual recognition and understanding of the open world. arXiv preprint arXiv:2308.01907, 2023b. Wang, W., Zhang, S., Ren, Y., Duan, Y., Li, T., Liu, S., Hu, M., Chen, Z., Zhang, K., Lu, L., et al. Needle in a
multimodal haystack. arXiv preprint arXiv:2406.07230, 2024c. Wang, X., Liu, Y., Shen, C., Ng, C. C., Luo, C., Jin, L., Chan, C. S., Hengel, A. v. d., and Wang, L. On the general value of evidence, and bilingual scene-text visual question answering. pp. 10126-10135, 2020. Wu, C. Pmc-casereport. https://huggingface.co/datasets/chaoyi-wu/PMC-CaseReport, 2023. Wu, Z., Chen, X., Pan, Z., Liu, X., Liu, W., Dai, D., Gao, H., Ma, Y., Wu, C., Wang, B., et al. Deepseek-vl2: Mixture-of-experts vision-language models for advanced multimodal understanding. arXiv preprint arXiv:2412.10302, 2024. Xiao, G., Tian, Y., Chen, B., Han, S., and Lewis, M. Efficient streaming language models with attention sinks. arXiv preprint arXiv:2309.17453, 2023. Yao, Y., Yu, T., Zhang, A., Wang, C., Cui, J., Zhu, H., Cai, T., Li, H., Zhao, W., He, Z., et al. Minicpm-v: A gpt-4v level mllm on your phone. arXiv preprint arXiv:2408.01800, 2024. Ye, J., Xu, H., Liu, H., Hu, A., Yan, M., Qian, Q., Zhang, J., Huang, F., and Zhou, J. mplug-owl3: Towards long image-sequence understanding in multi-modal large language models. arXiv preprint arXiv:2408.04840, 2024. Ying, K., Meng, F., Wang, J., Li, Z., Lin, H., Yang, Y., Zhang, H., Zhang, W., Lin, Y., Liu, S., et al. Mmtbench: A comprehensive multimodal benchmark for evaluating large vision-language models towards multitask agi. arXiv preprint arXiv:2404.16006, 2024. Yu, L., Jiang, W., Shi, H., Yu, J., Liu, Z., Zhang, Y., Kwok, J. T., Li, Z., Weller, A., and Liu, W. Metamath: Bootstrap your own mathematical questions for large language models. arXiv preprint arXiv:2309.12284, 2023. Yuan, T., Zhu, Z., Xu, K., Li, C., Mu, T., and Hu, S. A large chinese text dataset in the wild. 34(3):509-521, 2019. Yuan, Y., Liu, X., Dikubab, W., Liu, H., Ji, Z., Wu, Z., and Bai, X. Syntax-aware network for handwritten mathematical expression recognition. arXiv preprint arXiv:2203.01601, 2022. Zhang, R., Zhou, Y., Jiang, Q., Song, Q., Li, N., Zhou, K., Wang, L., Wang, D., Liao, M., Yang, M., et al. Icdar 2019 robust reading challenge on reading chinese text on signboard. In ICDAR, pp. 1577-1581. IEEE, 2019. Zhang, X., Wu, C., Zhao, Z., Lin, W., Zhang, Y., Wang, Y., and Xie, W. Pmc-vqa: Visual instruction tuning
for medical visual question answering. arXiv preprint arXiv:2305.10415, 2023a. Zhang, Y., Zhang, R., Gu, J., Zhou, Y., Lipka, N., Yang, D., and Sun, T. Llavar: Enhanced visual instruction tuning for text-rich image understanding. arXiv preprint arXiv:2306.17107, 2023b. Zheng, X., Burdick, D., Popa, L., Zhong, X., and Wang, N. X. R. Global table extractor (gte): A framework for joint table identification and cell structure recognition using visual context. pp. 697-706, 2021. Zhong, Y., Liang, L., Zharkov, I., and Neumann, U. Mmvp: Motion-matrix-based video prediction. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4273-4283, 2023.
# A. Theoretical Derivation of Remote Decay
Definition A.1 (RoPE-induced Inner Product). Given a query vector $q \in \mathbb{C}^d$ and a key vector $k \in \mathbb{C}^d$ , their inner product under Rotary Position Embedding (RoPE) is defined as:
$$(R _ {m} q) ^ {\top} (R _ {n} k) \triangleq \operatorname {R e} \left[ \sum_ {i = 0} ^ {d / 2 - 1} q _ {[ 2 i: 2 i + 1 ]} k _ {[ 2 i: 2 i + 1 ]} ^ {*} e ^ {\mathrm {i} (m - n) \theta_ {i}} \right]$$
where $q_{[2i:2i + 1]}$ denotes the $i$ -th 2D subvector of $q$ , $\theta_i$ is the preset rotational frequency, and * represents complex conjugation.
Building on Definition A.1, we establish the following core lemma:
Lemma A.2 (Abel Transform Representation). Let $h_i \triangleq q_{[2i:2i+1]} k_{[2i:2i+1]}^*$ and $S_j \triangleq \sum_{i=0}^{j-1} e^{\mathrm{i}(m-n)\theta_i}$ , with boundary conditions $h_{d/2} = 0$ and $S_0 = 0$ . Then:
$$\sum_ {i = 0} ^ {d / 2 - 1} h _ {i} e ^ {\mathrm {i} (m - n) \theta_ {i}} = \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} \left(S _ {i + 1} - S _ {i}\right) = - \sum_ {i = 0} ^ {d / 2 - 1} S _ {i + 1} \left(h _ {i + 1} - h _ {i}\right)$$
Proof. By Abel summation by parts:
$$\begin{array}{l} \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} \left(S _ {i + 1} - S _ {i}\right) = \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} S _ {i + 1} - \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} S _ {i} \\ = \sum_ {i = 1} ^ {d / 2} h _ {i - 1} S _ {i} - \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} S _ {i} \quad (\text {i n d e x s h i f t}) \\ = - \sum_ {i = 0} ^ {d / 2 - 1} S _ {i} \left(h _ {i} - h _ {i - 1}\right) + h _ {d / 2 - 1} S _ {d / 2} - h _ {- 1} S _ {0} \\ = - \sum_ {i = 0} ^ {d / 2 - 1} S _ {i + 1} \left(h _ {i + 1} - h _ {i}\right) \quad (\text {u s i n g b o u n d a r y c o n d i t i o n s}) \\ \end{array}$$
Theorem A.3 (Decay Rate Bound). Under the assumptions of Lemma A.2, the absolute value of the inner product satisfies:
$$\left| \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} e ^ {\mathrm {i} (m - n) \theta_ {i}} \right| \leq \left(\max _ {0 \leq i \leq d / 2 - 1} | h _ {i + 1} - h _ {i} |\right) \sum_ {i = 0} ^ {d / 2 - 1} | S _ {i + 1} |$$
Proof. From Lemma A.2 and the triangle inequality:
$$\begin{array}{l} \left| \sum_ {i = 0} ^ {d / 2 - 1} h _ {i} e ^ {\mathrm {i} (m - n) \theta_ {i}} \right| = \left| \sum_ {i = 0} ^ {d / 2 - 1} S _ {i + 1} \left(h _ {i + 1} - h _ {i}\right) \right| \\ \leq \sum_ {i = 0} ^ {d / 2 - 1} | S _ {i + 1} | \cdot | h _ {i + 1} - h _ {i} | \\ \leq \left(\max _ {i} \left| h _ {i + 1} - h _ {i} \right|\right) \sum_ {i = 0} ^ {d / 2 - 1} | S _ {i + 1} | \\ \end{array}$$

# B. Training Details
The hyperparameters used for pretraining and finetuning across the three architectures are listed in Table 5. We observed that the 2B model, with its smaller hidden dimension, requires less extensive training, making Phase 2 optional. Therefore, in the ablation experiments in the main text, we only used Pretraining Phase 1 for the 2B model, while the 8B model utilized both pretraining phases.
Table 5: Hyperparameters for Training and Inference
<table><tr><td>Parameter</td><td>Pretraining Phase 1</td><td>Pretraining Phase 2</td><td>Finetuning</td></tr><tr><td>Max sequence length</td><td>8192</td><td>8192</td><td>8192</td></tr><tr><td>Max tile/image</td><td>12</td><td>12</td><td>12</td></tr><tr><td>Optimizer</td><td>AdamW</td><td>AdamW</td><td>AdamW</td></tr><tr><td>Learning rate</td><td>\( 1 \times 10^{-4} \)</td><td>\( 1 \times 10^{-4} \)</td><td>\( 4 \times 10^{-5} \)</td></tr><tr><td>Weight decay</td><td>0.01</td><td>0.01</td><td>0.01</td></tr><tr><td>Optimizer momentum</td><td>\( \beta_1, \beta_2 = 0.9, 0.999 \)</td><td>\( \beta_1, \beta_2 = 0.9, 0.999 \)</td><td>\( \beta_1, \beta_2 = 0.9, 0.999 \)</td></tr><tr><td>Learning rate schedule</td><td>Constant with warmup</td><td>Constant with warmup</td><td>Cosine decay</td></tr><tr><td>Warmup ratio</td><td>0.03</td><td>0.03</td><td>0.03</td></tr><tr><td>Training steps</td><td>2000</td><td>2000</td><td>9000</td></tr><tr><td>Batch size</td><td>1024</td><td>1024</td><td>1024</td></tr><tr><td>Number of mixin layers</td><td>4</td><td>4</td><td>4</td></tr><tr><td rowspan="4">Trainable weights</td><td colspan="2">LVLM-S: MLP</td><td rowspan="4">All</td></tr><tr><td colspan="2">LVLM-X: Mixin layers + MLP</td></tr><tr><td colspan="2">CoMemo: Mixin layers + MLP</td></tr><tr><td colspan="2">(Freeze gate in Phase 2)</td></tr></table>
# C. Detailed Experiment Results
We provide the detailed ablation study results in Table 9.
Table 9: Detailed results on albation study.
<table><tr><td rowspan="2">Model</td><td colspan="3">Caption</td><td colspan="2">Long-Generation</td><td colspan="3">Multi-Image</td><td colspan="2">Long-Context</td><td colspan="2">Math</td><td colspan="3">General VQA</td><td colspan="3">OCR-Related</td></tr><tr><td>COCO</td><td>Flickr</td><td>No-Caps</td><td>LLaVABen.</td><td>MMDU</td><td>BLINK</td><td>Mantis</td><td>MMT</td><td>MM-NIAH</td><td>MileBench</td><td>MathVista</td><td>MathVision</td><td>MMBench</td><td>MME</td><td>MMVP</td><td>AI2D</td><td>ChartQA</td><td>TextVQA</td></tr><tr><td>Variant 1</td><td>79.1</td><td>65.4</td><td>60.0</td><td>62.9</td><td>28.7</td><td>38.2</td><td>48.3</td><td>50.2</td><td>27.0</td><td>52.1</td><td>48</td><td>16.5</td><td>73.1</td><td>1869</td><td>31.3</td><td>74.3</td><td>75.6</td><td>74.2</td></tr><tr><td>Variant 2</td><td>74.1</td><td>63.5</td><td>64.0</td><td>64.0</td><td>38.8</td><td>42.7</td><td>48.8</td><td>51.1</td><td>30.2</td><td>53.8</td><td>48.1</td><td>15.2</td><td>72.8</td><td>1899</td><td>40</td><td>73.4</td><td>72.5</td><td>72.9</td></tr><tr><td>Variant 3</td><td>98.0</td><td>74.4</td><td>75.7</td><td>65.2</td><td>34.1</td><td>37</td><td>51.6</td><td>49.4</td><td>31.9</td><td>54.2</td><td>50.1</td><td>14.3</td><td>73.1</td><td>1834</td><td>35.3</td><td>75.9</td><td>76.2</td><td>74.6</td></tr><tr><td>Variant 4</td><td>90.2</td><td>67.2</td><td>81.9</td><td>64.2</td><td>39.6</td><td>42.7</td><td>52.1</td><td>50.6</td><td>30.6</td><td>55.6</td><td>49.9</td><td>19.4</td><td>74.0</td><td>1826</td><td>36.7</td><td>74.2</td><td>76.1</td><td>74.2</td></tr><tr><td>Variant 5</td><td>98.6</td><td>78.5</td><td>78.8</td><td>66.9</td><td>38.7</td><td>43.5</td><td>50.6</td><td>51.3</td><td>34.2</td><td>54.6</td><td>50.0</td><td>17.0</td><td>74.2</td><td>1904</td><td>36</td><td>74.2</td><td>73.6</td><td>72.6</td></tr><tr><td>Variant 6</td><td>90.1</td><td>73.0</td><td>69.9</td><td>73.7</td><td>48.2</td><td>49.2</td><td>65.0</td><td>57.9</td><td>29.8</td><td>60.8</td><td>58.3</td><td>19.1</td><td>79.1</td><td>2210</td><td>45.3</td><td>83.5</td><td>84.6</td><td>78.7</td></tr><tr><td>Variant 7</td><td>102.0</td><td>82.2</td><td>92.2</td><td>76.2</td><td>46.5</td><td>49.7</td><td>65.4</td><td>58.0</td><td>38.2</td><td>63.4</td><td>59.7</td><td>18.1</td><td>79.8</td><td>2182</td><td>45.3</td><td>83.5</td><td>77.2</td><td>76.6</td></tr><tr><td>Variant 8</td><td>92.0</td><td>61.7</td><td>85.6</td><td>42</td><td>30.2</td><td>40.5</td><td>44.2</td><td>47.8</td><td>15.6</td><td>41.9</td><td>39.9</td><td>17.7</td><td>63.8</td><td>1674</td><td>28</td><td>63.2</td><td>63.8</td><td>58.6</td></tr><tr><td>Variant 9</td><td>100.5</td><td>71.5</td><td>96.6</td><td>44.8</td><td>32.0</td><td>40.6</td><td>48.8</td><td>49.2</td><td>17.5</td><td>45.6</td><td>44.2</td><td>13.2</td><td>67.6</td><td>1759</td><td>31.3</td><td>63.3</td><td>64.7</td><td>62.6</td></tr></table>
# D. Dataset Details
The data used in the pre-training stage are listed in Table 6. And datasets used for instruction tuning are listed in Table 7.
Table 6: Summary of datasets used in the pretraining stage.
<table><tr><td>task</td><td>dataset</td></tr><tr><td>Short Caption</td><td>Laion (en&zh) (Schuhmann et al., 2022a), COYO (Byeon et al., 2022), COCO (Lin et al., 2014b)</td></tr><tr><td>OCR</td><td>Wukong-OCR (Gu et al., 2022), LaionCOCO-OCR (Schuhmann et al., 2022b)</td></tr><tr><td>Detection</td><td>GRIT (Peng et al., 2023), Objects365 (Shao et al., 2019)</td></tr><tr><td>Conversation</td><td>All-Seeing (en&zh) (Wang et al., 2023b)</td></tr><tr><td>Image-text instruction data</td><td>(see Table 7)</td></tr></table>
Table 7: Summary of datasets used in the instruction tuning stage.
<table><tr><td>task</td><td>dataset</td></tr><tr><td>General QA</td><td>VQAv2 (Goyal et al., 2017), GQA (Hudson & Manning, 2019), OKVQA (Marino et al., 2019), VSR (Liu et al., 2023a)</td></tr><tr><td>Science</td><td>AI2D (Kembhavi et al., 2016), ScienceQA (Lu et al., 2022a), Chemistry Data (Li et al., 2024)TQA (Kembhavi et al., 2017)</td></tr><tr><td>Medical</td><td>PMC-VQA (Zhang et al., 2023a), VQA-RAD (Lau et al., 2018), VQA-Med (Ben Abacha et al., 2019)Medical-Diff-VQA (Hu et al., 2023), PathVQA (He et al., 2020),SLAKE (Liu et al., 2021), PMC-CaseReport (Wu, 2023)</td></tr><tr><td>Chart</td><td>ChartQA (Masry et al., 2022a), LRV-Instruction (Liu et al., 2023b), PlotQA (Methani et al., 2020)Unichart (Masry et al., 2023), MMC-Inst (Liu et al., 2023c), DVQA (Kafle et al., 2018)TableMWP (Lu et al., 2022b), FigureQA (Kahou et al., 2017), MapQA (Chang et al., 2022)SciTSR (Chi et al., 2019), Fintabnet (Zheng et al., 2021)</td></tr><tr><td>Mathematics</td><td>CLEVR (Johnson et al., 2017), MetaMath (Yu et al., 2023), GeoQA+ (Cao & Xiao, 2022)Geometry3k (Lu et al., 2021), GeoS (Seo et al., 2015), Unigeo (Chen et al., 2022)Super-CLEVR (Li et al., 2023), MathQA (Amini et al., 2019)</td></tr><tr><td>Knowledge</td><td>Art500k (Mao et al., 2017), MovieNet (Huang et al., 2020), KonIQ-10k (Hosu et al., 2020)KVQA (Shah et al., 2019), ViQuAE (Lerner et al., 2022)</td></tr><tr><td>OCR</td><td>InfoVQA (Mathew et al., 2022), TextVQA (Singh et al., 2019a), ArT (Chng et al., 2019)CASIA (Liu et al., 2011), Chart-to-text (Kantharaj et al., 2022), COCO-text (Veit et al., 2016)CTW (Yuan et al., 2019), EATEN (Guo et al., 2019), ICDAR2019-LSVT (Sun et al., 2019)ICPR MTWI (He et al., 2018), NAF (Davis et al., 2019), ReCTS (Zhang et al., 2019)TextOCR (Singh et al., 2021), LLaVAR (Zhang et al., 2023b), HME-100k (Yuan et al., 2022)POIE (Kuang et al., 2023), SROIE (Huang et al., 2019), ST-VQA (Biten et al., 2019)EST-VQA (Wang et al., 2020), IAM (Marti & Bunke, 2002)</td></tr><tr><td>Document</td><td>DocVQA (Clark & Gardner, 2017), DocReason25k (Hu et al., 2024)</td></tr><tr><td>Grounding</td><td>RefCOCO (Kazemzadeh et al., 2014), RefCOCO+ (Kazemzadeh et al., 2014), RefCOCOg (Kazemzadeh et al., 2014)RD-BoxCoT (Chen et al., 2023)</td></tr><tr><td>Conversation</td><td>ALLaVA (Chen et al., 2024a), LAION-GPT4V (LAION, 2023)MMDU (Liu et al., 2024d), TextOCR-GPT4V (Carter, 2024)</td></tr><tr><td>Detection</td><td>Objects365 (Shao et al., 2019), V3Det (Wang et al., 2023a)</td></tr></table>123version https://git-lfs.github.com/spec/v1oid sha256:b6ce79ec79b0f606772a991691ef88858dbf90c8896a1775119ac424fbd59044size 931570123version https://git-lfs.github.com/spec/v1oid sha256:5e961f873bd83f23a038f4833b9f5d24654a15fed16c6920f7448751e1c22872size 596190123version https://git-lfs.github.com/spec/v1oid sha256:1e5f3bd952ae845bd50e753160e7afc4e42a16a958e14ab981ab367bb62e1b7csize 126535123version https://git-lfs.github.com/spec/v1oid sha256:eaa683dfa99ab46ed56f998307aefcb3a29ff2de7c501f1924209c28708193casize 153469ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_content_list.jsonAdded+3
ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_model.jsonAdded+3
ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/0fa55ccf-bfc5-47e4-8022-c70ce2032c08_origin.pdfAdded+3
ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/full.mdAdded
ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/images.zipAdded+3
ICML/2025/Closed-Loop Long-Horizon Robotic Planning via Equilibrium Sequence Modeling/layout.jsonAdded+3
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_content_list.jsonAdded+3
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_model.jsonAdded+3
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/952e6b9d-b268-4e8d-9d2f-8ce57c8cef94_origin.pdfAdded+3
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/full.mdAdded+565
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/images.zipAdded+3
ICML/2025/Closed-form Solutions_ A New Perspective on Solving Differential Equations/layout.jsonAdded+3
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_content_list.jsonAdded+3
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_model.jsonAdded+3
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/aaefa96a-3e61-48f1-8430-9cf2c440f3ad_origin.pdfAdded+3
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/full.mdAdded
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/images.zipAdded+3
ICML/2025/Clustering Items through Bandit Feedback_ Finding the Right Feature out of Many/layout.jsonAdded+3
ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_content_list.jsonAdded+3
ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_model.jsonAdded+3
ICML/2025/Clustering Properties of Self-Supervised Learning/5bc677d1-e5b2-4061-8715-7101929c0f96_origin.pdfAdded+3
ICML/2025/Clustering Properties of Self-Supervised Learning/full.mdAdded+640
ICML/2025/Clustering Properties of Self-Supervised Learning/images.zipAdded+3
ICML/2025/Clustering Properties of Self-Supervised Learning/layout.jsonAdded+3
ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_content_list.jsonAdded+3
ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_model.jsonAdded+3
ICML/2025/Clustering via Self-Supervised Diffusion/f1ae5f98-b38b-45d7-aaab-3bcc218f0f19_origin.pdfAdded+3
ICML/2025/Clustering via Self-Supervised Diffusion/full.mdAdded+486
ICML/2025/Clustering via Self-Supervised Diffusion/images.zipAdded+3
ICML/2025/Clustering via Self-Supervised Diffusion/layout.jsonAdded+3
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_content_list.jsonAdded+3
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_model.jsonAdded+3
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/07d2bd4f-a2a7-48c9-81c6-b9ae22cbf5ca_origin.pdfAdded+3
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/full.mdAdded+552
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/images.zipAdded+3
ICML/2025/CoCoA-Mix_ Confusion-and-Confidence-Aware Mixture Model for Context Optimization/layout.jsonAdded+3
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_content_list.jsonAdded+3
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_model.jsonAdded+3
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/24fcccad-3bc6-46d7-8bbd-0164896ebd6d_origin.pdfAdded+3
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/full.mdAdded+612
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/images.zipAdded+3
ICML/2025/CoDy_ Counterfactual Explainers for Dynamic Graphs/layout.jsonAdded+3
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_content_list.jsonAdded+3
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_model.jsonAdded+3
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/edbd8beb-c531-4711-89a7-153127cff7fd_origin.pdfAdded+3
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/full.mdAdded+531
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/images.zipAdded+3
ICML/2025/CoMemo_ LVLMs Need Image Context with Image Memory/layout.jsonAdded+3
ICML/2025/CoPINN_ Cognitive Physics-Informed Neural Networks/25e85583-5294-43b0-9529-8cfb9838845c_content_list.jsonAdded+3
ICML/2025/CoPINN_ Cognitive Physics-Informed Neural Networks/25e85583-5294-43b0-9529-8cfb9838845c_model.jsonAdded+3